aspose file tools*
The moose likes Websphere and the fly likes ClassLoader Hierarchy Issues in RAD 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "ClassLoader Hierarchy Issues in RAD 7" Watch "ClassLoader Hierarchy Issues in RAD 7" New topic
Author

ClassLoader Hierarchy Issues in RAD 7

Bryan Meyer
Greenhorn

Joined: Nov 18, 2008
Posts: 6
Hello All:

I am working on a web application in RAD 7 that is being built using the Struts v1.1 framework. I have two projects - let's call them projJava and projWeb. I have a JAR file containing some utility classes - called projUtility.jar - that has been added to the WEB-INF\lib folder in the projWeb project and is on the build path for both the projJava and projWeb projects. Everything compiles perfectly - there are no errors.

When I run the application, one of my Struts action classes fails when it attempts to import the class com.test.subtest.SecondChild. SecondChild is the child class of FirstChild which is the child class of the ParentOfChildren class. The exception is provided below.

------------
Exception forwarding for name firstAction: javax.servlet.ServletException: Error while defining class: com.test.subtest.SecondChild

This error indicates that the class: Error while defining class: com.test.subtest.FirstChild

This error indicates that the class: com.test.ParentOfChildren
could not be located while defining the class: com.test.subtest.FirstChild

This is often caused by having the class at a higher point in the classloader hierarchy

Dumping the current context classloader hierarchy:

==> indicates defining classloader

*** indicates classloader where the missing class could have been found
------------

The SecondChild class and FirstChild class are located in the source folder of the projJava project. Their parent class - ParentOfChildren - is located in projUtility.jar which is on the build path for both the projJava and projWeb projects. The Struts actions are located in the JavaSource folder on the projWeb project.

If the Struts action class can see the classes FirstChild and SecondChild which are in the source folder of a completely different project - namely projJava - then why could their parent class, ParentOfChildren, not be loaded when it is in the projUtility.jar file which is on the build path of the project (projWeb) where the Struts action class is located?

I don't get the reason for the error.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassLoader Hierarchy Issues in RAD 7