Jboss and terracotta deployment problem.
jpori May 7, 2009 8:45 AMI have been trying to put our AS and app under TC for a while, but I'm constantly getting this error(No bean class specified on bean definition) when jboss is put to connection with terracotta.
Our spring module is following
app.ear
- a_persistence.spring
In jboss-spring we have:
<description>BeanFactory=(a_persistence)</description> <import resource="classpath:spring/component1-spring.xml" /> <import resource="classpath:spring/component2-spring.xml" />
- a_service.spring
In jboss-spring we have:
<description> BeanFactory=(b_service) ParentBeanFactory=(a_persistence) </description> <import resource="classpath:spring/service1-spring.xml" /> <import resource="classpath:spring/service2-spring.xml" />
Libraries:
component1.jar
component2.jar
service1.jar
service2.jar
The a_persistence.spring deploys ok, but when deploying a_service.spring and from the service1-spring.xml the first bean throws exception:
Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition; - nested throwable: (org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BEANNAME' defined in class path resource [spring/service2-spring.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition)
This happens only if the bean is defined in the xml, this works ok if the bean is annotated. Meaning that I use component-scan in the file.
Bean definition:
<bean id="UserService" class="com.company.usermgr.UserServiceImpl"/>
Also this error happens when there is NO hierachy between spring content(no ParentBeanFactory).
I would like to keep the component design, but I have no idea what is causing this. I have checked all the jar and libraries, tested with different versions and so on.
Also noticed that if I use bean factory from the deployer, it deploys, but autowires will not work(beans are nulls).
But if I get the TC config out from the jboss, everything work like a dream.
Not sure if this is the correct forum, but I will try my luck...
Environment is
Jboss 4.2.3
Spring 2.5.4 - 2.5.6SEC
jdk 1.6
Terracotta 3.0.0
Deployer 2.1 for spring 2.5