Hi!
Have you found any solution to your problem?
I might be having a similar problem myself.
Please see the configuration of the project bellow:
Code:
smth.ear
|
+- smth.war
|
+- WEB-INF
|
+- lib
|
+- libA.jar
| + common-beans.xml
| + com.a.b.c (package)
| + BaseClass.class
| + ImplClass_1.class |
| + ImplClass_2.class | - BaseClass is visible and the beans are instantiated
| + ImplClass_2.class |
|
+- libB.jar
+ implClass_4-beans.xml
+ com.x.y.z (package)
+ ImplClass_4.class - BaseClass is NOT visible and I get the following error
The error I get is:
Code:
Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.x.y.z.ImplClass_4] for
bean with name 'implClass_4' defined in class path resource [implClass_4-beans.xml]: problem with class file or
dependent class; nested exception is java.lang.NoClassDefFoundError: com/a/b/c/BaseClass
The bean definition for BaseClass is written in common-beans.xml which is placed in libA.jar:
Code:
<bean abstract="true" id="abstractBaseClass" class="com.a.b.c.BaseClass">
The bean definition for ImplClass_4 is written in implClass_4-beans.xml which is placed in libB.jar:
Code:
<bean id="implClass_4" class="com.x.y.z.ImplClass_4" parent="abstractBaseClass">
Any suggestions are welcome.
Thanks in advance!