0

So I am having issues deploying code to my local websphere server (imagine the dred I have for installing it to my test server).

I get a java.lang.ClassNotFoundException when I attempt to run the application.

So after googling around it seems as though I need to add entries into one of the above files. Problem is, there doesn't seem to be good examples of how to do that.

In the Manifest.mf file, do I need to add the fullpath to where I expect the jar to be? Does anybody have a good example of a deployment.xml/libraries.xml? How do I translate what is in my project classpath to entries into those various files?

K139
  • 3,654
  • 13
  • 17
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
  • What class is not found? Is it your, from some kind of library? Do you have that library in application (ear or web-inf/lib)? – Gas Apr 30 '15 at 09:39

1 Answers1

0

Start with 'Websphere Class Loaders'.

Usually the order to load/find a class/resource is :

Current Module(war/jar/sar) --> (if not found then look inside) --> 

Another Module in EAR (via manifest.mf) --> (if not found then try to load it from) -->

Common shared library (libraries.xml) (or) Extensions library --> 

(if not found, then throw the error Class not found/No class Def found error).

Manifest.mf

Using this file you could point to the module/location directly to load the required classes/resources.

libraries.xml

Here you can define and maintain the shared libraries which can be used across many JVM's (like single jar file can be referenced from multiple jvm instances). Refer this for more information.

In my experience, I try to avoid using manifest.mf files, and refer the library jar files from shared library 'libraries.xml' file. (or) if you are trying to learn the Web sphare, then just include the jar files in lib/ folder of your package.

K139
  • 3,654
  • 13
  • 17