1 Reply Latest reply on Apr 17, 2009 10:41 AM by Ray DeCampo

    Classloading issue moving from 4.2.0 to 5.0.1

    Ray DeCampo Newbie

      I have an application which is running without issue on JBoss 4.2.0. I am attempting to run the same application on JBoss 5.0.1 and I am hitting a classloading issue. It happens during deployment while Spring is instantiating my Spring managed beans. The class which cannot be found is in the Facelets library and the bean being instantiated is one of mine. The Spring jar, the Facelets jar and the jar containing my class are all packaged at the root of the EAR and referenced by the WAR via the MANIFEST.MF. As I said before, this worked fine in 4.2.0.

      FWIW, I am using the standard configuration for JBoss (although I get the same results using the default configuration) on Windows 2000 SP4 with JDK 1.6.0_01.

      Here is the relevant portion of the error:

      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.mycompany.faces.FaceletViewRendererImpl]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/facelets/FaceletViewHandler
       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
       at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
       ... 101 more
      Caused by: java.lang.NoClassDefFoundError: com/sun/facelets/FaceletViewHandler
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
       at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:546)
       at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:506)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:504)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:481)
       at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
       at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
       at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
       at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:258)
       at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:152)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:259)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1102)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:772)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:415)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at com.mycompany.faces.FaceletViewRendererImpl.<init>(FaceletViewRendererImpl.java:74)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
       ... 103 more


      I did look over the release notes and documentation and found nothing to indicate a classloader change which would affect this (as far as I could tell anyway). I also tried the suggestions at http://www.jboss.org/community/wiki/ClassLoadingConfiguration to no avail.

      I'd appreciate any suggestions as to how to resolve this.