• Post Reply Bookmark Topic Watch Topic
  • New Topic

WebSphere class loading issue  RSS feed

Bharathi Kongara
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

We ran into this issue and have been trying to resolve since yesterday with no luck. I'm wondering if anybody else has encountered this and has any thoughts ...

We are trying to call the methods of the com.ibm.websphere.runtime.ServerName class in a utility class that is packaged into a jar and put onto the JVM classpath in WebSphere 6.1. And we are running into NoClassDefFound errors. So we just did Class.forName("com.ibm.websphere.runtime.ServerName") in that utility class and got the ClassNotFoundException as expected. But when we do the same in a separate utility class that is outside of the classpath, both the forName and the actual method calls work without any problem.

That kind of suggested that the com.ibm.websphere.runtime.ServerName class is not "available"(/loaded) by the time our utility class gets loaded, may be. So we turned on the Verbose Class Loading to see the order in which the classes are loaded when the JVM starts up. But the com.ibm.websphere.runtime.ServerName class is loaded way before our utility class from the jar in the classpath.

So I'm wondering:

Why would it give me a ClassNotFound exception in my utility class (which is put on the classpath) when the log shows that the utility class is already loaded by the time this class starts loading?

Any feedback or thoughts would be greatly appreciated.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!