Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-1671

CNFE when injecting @Resource of application specific type in an application packaged as EAR with jboss-app.xml classloading configuration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0-Beta12
    • 1.0.0-Beta11
    • None
    • None
    • Workaround Exists
    • Hide

      Possible workarounds:

      1) Probably the easiest - Remove all @Resource injection of application specific classes
      OR
      2) Deploy the application as a standalone jar instead of EAR. The problem does not arise in a standalone jar
      OR
      3) Do not configure classloading through jboss-app.xml - You can leave that file empty or remove it.

      Show
      Possible workarounds: 1) Probably the easiest - Remove all @Resource injection of application specific classes OR 2) Deploy the application as a standalone jar instead of EAR. The problem does not arise in a standalone jar OR 3) Do not configure classloading through jboss-app.xml - You can leave that file empty or remove it.

      When a @Resource injection is attempted on a application specific type in a EJB deployed through an EAR containing classloader configuration in jboss-app.xml, a ClassNotFoundException for the application specific type is thrown:

      vfsfile:/home/jpai/jboss-5.0.0.GA/server/default/deploy/myapp.ear/ -> java.lang.ClassNotFoundException: org.myapp.ejb.AnotherBeanLocal from
      BaseClassLoader@12e712f{VFSClassLoaderPolicy@8f57a

      {name=vfsfile:/home/jpai/jboss-5.0.0.GA/server/default/conf/jboss-service.xml domain=ClassLoaderDomain@1bd669d {name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.system.NoAnnotationURLClassLoader@2a15cd}


      roots=[MemoryContextHandler@2903774[path= context=vfsmemory://3j001-sl378g-fpr19973-1-fpr19fkl-6 real=vfsmemory://3j001-sl378g-fpr19973-1-fpr19fkl-6], DelegatingHandler@15593128[path=bcel.jar
      context=file:/home/jpai/jboss-5.0.0.GA/common/lib/ real=file:/home/jpai/jboss-5.0.0.GA/common/lib/bcel.jar],
      DelegatingHandler@13595063[path=jboss-ejb3-interceptors.jar context=file:/h....
      ..........

      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:385)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:164)
      at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:203)

      See referenced forum thread for more details

              jaikiran Jaikiran Pai (Inactive)
              jaikiran Jaikiran Pai (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: