cancel
Showing results for 
Search instead for 
Did you mean: 

NoClassDefFound error.. again

former_member190457
Contributor
0 Kudos

Hi everybody

Hi have four WDJ DCs

1. Constants (mainly public static final variables in plain java files)

2. Config (used for config data retrieval from .properties files)

3. Finders (mainly UI trees and search functions)

4. Test (Test application and component)

Constants uses nothing

Config uses Constants

Finder uses Config, Constants

Test uses Finders, Config, Constants

Constants' plain java classes are all included in the public part, as well as: package, package tree, folder, folder tree.

Dependencies are declared as compile time.

Applications in Test DC requiring INDIRECTLY a class from Constants will dump:

ClassDefNotFoundException...

the error is located in a class belonging to Config DC.

How to solve this?

Thanks, points will be awarded

Vincenzo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

can you please show me the error stack trace

with regards

shanto aloor

former_member190457
Contributor
0 Kudos

Hi, I checked the .ears and the public part is correctly created. Which other check can I run?

I have found out that the same plain java class which is not resolved in Test DC, is resolved is Finders DC, i.e. if I create a new app belonging to Finders DC, everything works smoothly. Don't know why...

This is the (very typical) stacktrace


java.lang.NoClassDefFoundError: it.sap.fsh.costanti.IconEntry
	at it.sap.fsh.frmz.commons.config.ConfigLocator.parseIconRecord(ConfigLocator.java:282)
	at it.sap.fsh.frmz.commons.config.ConfigLocator.caricaMappaIcone(ConfigLocator.java:238)
	at it.sap.fsh.frmz.commons.config.wdp.InternalConfigLocator.caricaMappaIcone(InternalConfigLocator.java:153)
	at it.sap.fsh.frmz.commons.config.ConfigLocatorInterface.caricaMappaIcone(ConfigLocatorInterface.java:118)
	at it.sap.fsh.frmz.commons.config.wdp.InternalConfigLocatorInterface.caricaMappaIcone(InternalConfigLocatorInterface.java:124)
	at it.sap.fsh.frmz.commons.config.wdp.InternalConfigLocatorInterface$External.caricaMappaIcone(InternalConfigLocatorInterface.java:168)
	at it.sap.fsh.formazione.comps.finders.StandFinderView.wdDoInit(StandFinderView.java:205)
	at it.sap.fsh.formazione.comps.finders.wdp.InternalStandFinderView.wdDoInit(InternalStandFinderView.java:526)
	at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
	at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
	at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
	at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
	at com.sap.tc.webdynpro.progmodel.view.InterfaceView.initController(InterfaceView.java:43)
	at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.bind(ViewManager.java:555)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:724)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
	at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
	at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
	at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
	at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
	at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
	at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:754)
	at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:289)
	at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
	at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
	at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
	at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
	at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
	at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
	at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
	at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
	at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
	at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
	at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
	at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
	at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
	at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
	at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
	at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
	at java.security.AccessController.doPrivileged(AccessController.java:207)
	at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
	at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

Thanks for any help.

Vincenzo

former_member190457
Contributor
0 Kudos

Hi, I've run a couple of tests

The problem boils down to this:

DC Test uses class UserPreferences in Constants DC.

UserPreferences is as follows:


package it.sap.fsh.costanti;

import java.math.BigDecimal;

public class UserPreferences {
public static final BigDecimal N_MAX_HIT = new BigDecimal(50);
public static final String WIDTH_FULL = "100%";
public static final String HEIGHT_STD = "300px";
}

If from Test I reference variables of type:

String, int, long, ... (primitive types) everything works ok.

If I reference variables such as N_MAX_HIT (BigDecimal, Long, Integer, ...) I get the NoClassDefFound error for UserPreferences.class.

Example:

this will not work


String t = UserPreferences.HEIGHT_STD;
BigDecimal s = UserPreferences.N_MAX_HIT;
wdComponentAPI.getMessageManager().reportSuccess(t);

this will work:


String t = UserPreferences.HEIGHT_STD;
//BigDecimal s = UserPreferences.N_MAX_HIT;
wdComponentAPI.getMessageManager().reportSuccess(t);

Only primitive types are accepted, this is absolutely weird...

Can anyon please provide help? I'm stuck... Thanks

Vincenzo

Edited by: VINCENZO TURCO on Oct 20, 2008 5:42 PM

Former Member
0 Kudos

Hi Vincenzo,

try to add your class into your public part as "assembly" and check the "build-time" dependency.

Assembly: (to package DCs, which are not deployable into a deployable DC)

A type that "can be packaged into other build result"

The public part for assembly provides a library that other DCs can include in their own resulting builds.

Your situation is the same of "Use of External library" in which you have to create a public part of type "compilation" and add the JAR file as a public part entity. Then you have to create another public part of type "Assembly" and again add the jar file as a part entity.

You can now wrap this public part into another DC type and make it available on the server.

(JA340)

Let me know your results.

Regards,

Mirco.

Edited by: Mirco Veltri on Oct 20, 2008 6:40 PM

Answers (3)

Answers (3)

former_member190457
Contributor
0 Kudos

Great job! The plain java class must be added to an assembly public part and to an API public part. The client DC must declare build time dependency from both api pp and assembly pp.

Thanks, Kind regards

Former Member
0 Kudos

perfect Vincenzo.

Have fun.

Regards,

Mirco.

siddharth_jain
Active Contributor
0 Kudos

Hi,

Some how some of the java classes of Constant WD Dc are not getting Deployed on server.

Please make sure that Constant ,Config and Finder WD dc are deployed on server before running any test from Test WD Dc.

Also make sure that if you have created new java class than it is included in PP and Dc is deployed with the new changes.

Siddharth

Former Member
0 Kudos

Hi,

For your java classes in Constants, you might have one library DC. You need to set the reference for this library DC under Project>Properties>WebDynpro Refrences-->Library References.

Regards,

Murtuza

former_member190457
Contributor
0 Kudos

Hi thanks for replying

actually I am using WDJ DCs and not libraries firstly because there are several known bugs about libraries and moreover I would like to be able to possibly group constants and WDJ Utilities components under the same DC.

So please can anyone help with WDJ DC issue described?

Thanks, Vincenzo