cancel
Showing results for 
Search instead for 
Did you mean: 

ClassNotFound only for some variables

former_member190457
Contributor
0 Kudos

Hi developers,

I have an external jar (plain java project) with constants and utilities wrapped in an External Library DC and in turn in a J2EE library DC.

The J2EE lib DC is used by a WDP DC.

Everything works fine in code lines like this:

String children_existing = Utils.VAL_CHILDREN_EXISTING;

but I get a classNotFoundException for class Utils when I try this:

HashMap hashMap = Utils.iconMap;

or

Utils.handleReturnValue(wdContext.nodeXXX,this.messageManager)

the String, the HashMap and the method are all declared static in the Utils class.

Moreover the HashMap is initialized in a static {....} code block in Utils.

The Utils class includes in its build path some WDP libraries in order to compile.

they are just compile time references as I assume they will be automatically resolved at runtime, just as in WDP projects.

Any help would be much appreciated

Thanks

Vincenzo

Accepted Solutions (1)

Accepted Solutions (1)

monalisa_biswal
Contributor
0 Kudos

As you said you are not getting compilation error. So it could be due to the library dc has not been deployed properly. J2ee library dc has to be deployed to make the class files available during runtime.

former_member190457
Contributor
0 Kudos

Hi Monalisa, thanks for your reply

Actually if the DC was not properly deployed I think it shouldn't work either way.

What happens is that in Visual Administrator -> server -> libraries I can find my own library frmzlib and the .jar inside it.

However in VA only the name of the jar is displayed and not its path

(as the others it should be in C:\usr\sap\<SID>\JC01\j2ee\cluster\server0\bin\ext).

In fact on the file system I would expect a directory like .../ext/frmzlib/myjar.jar

Actually there's nothing there.

What I did is: create a directory named as the library es: it.sap~frmzlib in server0/bin/ext

Copy the .jar inside it.

This is a really frightening workaround... can anyone please help?

Thanks

Vincenzo

Former Member
0 Kudos

Have you given Library reference to WebDynpro Project?

Go through the below link and cross check the steps given for creating External Library project:

Thanks

Sandy

former_member190457
Contributor
0 Kudos

Hi, sure I did. I also opened [this thread|; on that subject.

Answers (0)