1 Reply Latest reply on Aug 3, 2011 9:57 AM by mitchelladam83

    JBoss 4.2.3 - 6.0.0 migration - ClassNotFoundException

    mitchelladam83 Newbie

      Hi there,

      I'm migrating an enteprise app  from 4.2.3 to 6.0 and am getting a classnotfound on startup despite that class being in a jar in APP-INF/lib (this same app is also deployed to weblogic) and in the META-INF\jboss-app.xml <library-directory>APP-INF/lib</library-directory> is specified

       

      exception thrown is:

      nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.context.support.ClassPathXmlApplicationContext] for bean with name 'example.context' defined in URL [vfs:/C:/jbossdev/jboss-6.0.0.Final/server/default/conf/beanRefFactory.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.context.support.ClassPathXmlApplicationContext from BaseClassLoader@20272fec{deployers-classloader:0.0.0$MODULE}

              at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.ja

      va:389)

       

      beanRefFactory.xml:

      <beans xmlns="http://www.springframework.org/schema/beans"

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xmlns:context="http://www.springframework.org/schema/context"

             xsi:schemaLocation="http://www.springframework.org/schema/beans

              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

              http://www.springframework.org/schema/context

              http://www.springframework.org/schema/context/spring-context-3.0.xsd">

       

       

                <bean id="example.context" class="org.springframework.context.support.ClassPathXmlApplicationContext">

                          <constructor-arg>

                                    <list>

                                              <value>example-context.xml</value>

                                              <value>classpath*:META-INF/example-context.xml</value>

                                    </list>

                          </constructor-arg>

                </bean>

      </beans>

       

      jboss-app.xml:

      <jboss-app>

      <library-directory>APP-INF/lib</library-directory>

      <module>

      <service>startup-service.sar</service>

      </module>

      </jboss-app>

       

      org.springframework.context.support.ClassPathXmlApplicationContext is in jar org.springframework.context.support-3.0.2.RELEASE.jar which is in APP-INF/lib at the root of my ear.

       

      i just can't understand how this isn't loaded at this point.