A
andersond3
I have an application which we are trying to refactor some of the web
code into a Java project so that it can be used as a framework for
other projects. One of the abstract classes extends
org.apache.struts.action.Action. For the sake of this discussion, the
application will be called MyApp, and so the EAR is MyAppEAR and the
web project is MyAppWeb. The Java project is called FmwkWeb. So, the
FmwkWeb is in the build path and in the Java Jar Dependencies for the
web porject. In the EAR, the FmwkWeb project is a project utility jar.
To make everything compile in FmwkWeb, I had to add a lib folder,
which is a replica of the WEBINF/lib folder in the real web project.
It contains, among other things, the struts.jar file. At this point,
the application compiles perfectly, but when starting the application,
I get this error:
org.springframework.beans.factory.BeanDefinitionStoreException: Error
registering bean with name '/preCert' defined in ServletContext
resource [/WEB-INF/beans-actions.xml]: Class that bean class
[com.aetna.precert.actions.PrecertInitialAction] depends on not found;
nested exception is java.lang.NoClassDefFoundError: Error while
defining class: com.aetna.precert.actions.MyAppInitialAction
This error indicates that the class: Error while defining class:
com.aetna.precert.actions.MyAppAction
This error indicates that the class: Error while defining class:
com.aetna.ads.actions.FmwkAction
This error indicates that the class: org.apache.struts.action.Action
could not be located while defining the class:
com.aetna.ads.actions.FmwkAction
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
***[0]
com.ibm.ws.classloader.CompoundClassLoader@1d711d71
Local ClassPath: C:\Data\vobworkspaces\java\MyApp\WebContent\WEB-INF
\classes;...
Delegation Mode: PARENT_FIRST
==>[1] com.ibm.ws.classloader.JarClassLoader@1899458871 Local
Classpath: C:\Data\vobworkspaces\java\MyApp\xsdbeans.jar;...
[2] com.ibm.ws.classloader.ExtJarClassLoader@2104786292 Local
ClassPath: C:\Data\...; Delegation Mode: PARENT_LAST
[3] com.ibm.ws.classloader.ExtJarClassLoader@735390677 Local
ClassPath: C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v51\lib
\app; Delegation Mode: PARENT_LAST
[4] com.ibm.ws.classloader.ProtectionClassLoader@49c649c6
[5] com.ibm.ws.bootstrap.ExtClassLoader@537d537d
[6] sun.misc.Launcher$AppClassLoader@5bc25bc2
[7] sun.misc.Launcher$ExtClassLoader@35663566
I can find no reason for this to occur, and would greatly appreciate
your assistance with this.
code into a Java project so that it can be used as a framework for
other projects. One of the abstract classes extends
org.apache.struts.action.Action. For the sake of this discussion, the
application will be called MyApp, and so the EAR is MyAppEAR and the
web project is MyAppWeb. The Java project is called FmwkWeb. So, the
FmwkWeb is in the build path and in the Java Jar Dependencies for the
web porject. In the EAR, the FmwkWeb project is a project utility jar.
To make everything compile in FmwkWeb, I had to add a lib folder,
which is a replica of the WEBINF/lib folder in the real web project.
It contains, among other things, the struts.jar file. At this point,
the application compiles perfectly, but when starting the application,
I get this error:
org.springframework.beans.factory.BeanDefinitionStoreException: Error
registering bean with name '/preCert' defined in ServletContext
resource [/WEB-INF/beans-actions.xml]: Class that bean class
[com.aetna.precert.actions.PrecertInitialAction] depends on not found;
nested exception is java.lang.NoClassDefFoundError: Error while
defining class: com.aetna.precert.actions.MyAppInitialAction
This error indicates that the class: Error while defining class:
com.aetna.precert.actions.MyAppAction
This error indicates that the class: Error while defining class:
com.aetna.ads.actions.FmwkAction
This error indicates that the class: org.apache.struts.action.Action
could not be located while defining the class:
com.aetna.ads.actions.FmwkAction
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
***[0]
com.ibm.ws.classloader.CompoundClassLoader@1d711d71
Local ClassPath: C:\Data\vobworkspaces\java\MyApp\WebContent\WEB-INF
\classes;...
Delegation Mode: PARENT_FIRST
==>[1] com.ibm.ws.classloader.JarClassLoader@1899458871 Local
Classpath: C:\Data\vobworkspaces\java\MyApp\xsdbeans.jar;...
[2] com.ibm.ws.classloader.ExtJarClassLoader@2104786292 Local
ClassPath: C:\Data\...; Delegation Mode: PARENT_LAST
[3] com.ibm.ws.classloader.ExtJarClassLoader@735390677 Local
ClassPath: C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v51\lib
\app; Delegation Mode: PARENT_LAST
[4] com.ibm.ws.classloader.ProtectionClassLoader@49c649c6
[5] com.ibm.ws.bootstrap.ExtClassLoader@537d537d
[6] sun.misc.Launcher$AppClassLoader@5bc25bc2
[7] sun.misc.Launcher$ExtClassLoader@35663566
I can find no reason for this to occur, and would greatly appreciate
your assistance with this.