Websphere Classloading?

When installing web-apps under WAS, you can set the classloading policy in the options for that application (or globally on server/node level).

When installing web-apps under WAS, you can set the classloading policy in the options for that application (or globally on server/node level) If the policy options are (search) "parent first" / "parent last" and one class loader per application or per war. The default is "parent first / war". If your web-app comes with all jars it needs you'll be better off with the policy set to "parent last / application".

Also if you edit your web. Xml to reflect changes, be sure to set "use binary configuration" otherwise it will always use what it stored during install.

I have already completed those steps. The point of confusion is different. Supposing my web-app lib folder contains 4 jars like a.

Jar,b. Jar,c. Jar,d.

Jar, in what order are these 4 jars loaded? Hope I am making myself clear. Its not abut loading of jars relative to server and application.

Rather the relative order of loading of the application jars. – Barun Dec 16 '09 at 4:54 If you need a specific sequence you can use the MANIFEST classpath setting (I've never done this but WAS docs mention it. ) WEB-INF/classes is searched before the jars in WEB-INF/lib so you can extract the classes you need into that location.

A workaround (to an unwanted situation) is to remove the offensive classes from the . Jar before you package it into the . War – rsp Dec 16 '09 at 10:12 Hmm...both seem a bit ugly workarounds but then its fair as its a ugly problem.

I had tried the second option. It gave more issues..basically because of a mixed up class environment at runtime. Any idea on what factors the loading of this jar depends?

– Barun Dec 16 '09 at 10:59 1 Search order in /lib is undefined (as far as I know) when no classpath is set. So finding out how to define the web-app classpath in the MANIFEST file is your best bet. If you are able to place the .

Jar you want loaded first on the filesystem, you can define a shared library via the admin console and add it to your web-app's classpath. In WAS 6.1 the admin console contains a classloader explorer that might give insight in a solution. – rsp Dec 16 '09 at 12:03.

Java loads classes in the order they are specified in the classpath. So if your classpath is "c:\jar1. Jar;c:\jar2.

Jar" and jar1. Jar and jar2. Jar contain the same class, the class from jar1.

Jar will always be used. If the order was reversed, then the jar2. Jar class would always be used.

Wikipedia explains how Class Loaders work pretty well en.wikipedia.org/wiki/Java_Classloader The classpath can be configured through the WAS Admin Console on the Server under Server > Process Definition > Java Virtual Machine It can also be configured per application.

I have already completed those steps. The point of confusion is different. Supposing my web-app lib folder contains 4 jars like a.

Jar,b. Jar,c. Jar,d.

Jar, in what order are these 4 jars loaded? Hope I am making myself clear. Its not abut loading of jars relative to server and application.

Rather the relative order of loading of the application jars. – Barun Dec 16 '09 at 4:54 Gotcha, you may be able to specify the order for the WAR by adding a MANIFEST. MF file and specifying the Class-Path attribute there.

More info here: java.sun. Com/j2ee/verified/packaging. Html – Bert Lamb Dec 16 '09 at 13:24.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions