2 Replies Latest reply on May 8, 2009 3:06 AM by Jussi Pöri

    Jboss and terracotta deployment problem.

    Jussi Pöri Newbie

      I 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




        • 1. Re: Jboss and terracotta deployment problem.
          Marius Bogoevici Expert

          Hi,

          It's alright - this is the correct forum.

          Would you mind to provide the full 'spring2-service' file?

          I am especially concerned about this:

          (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 exc
          eption is java.lang.IllegalStateException: No bean class specified on bean definition)


          Not sure where does 'BEANNAME' come from.

          Thanks,
          Marius


          • 2. Re: Jboss and terracotta deployment problem.
            Jussi Pöri Newbie

            I changed that, the correct bean name is that UserService.

            I was wondering that could the TC mess up the classloading when I use hierachy? Without TC it works nicely.

            I have configured it so now that the application is now shared via TC. Basicalyl it should be the same deployment as without tc.