2 Replies Latest reply on Apr 3, 2012 10:31 AM by Aslak Knutsen

    Unable to Find JBoss Module Classes - org.apache.xml.resolver.Catalog

    David Salter Novice

      Hi,

       

      I'm using Arquillian on AS7 and trying to test a piece of code that uses the Commons Configuration library.

       

      In my depoyment I believe I've added all the commons configuration packages

       

       

      @Deployment
      public static Archive createTestArchive() {
        return ShrinkWrap.create(JavaArchive.class, "test.jar")
          .addPackage("org.apache.commons.configuration.beanutils")
          .addPackage("org.apache.commons.configuration")
          .addPackage("org.apache.commons.configuration.event")
          .addPackage("org.apache.commons.configuration.reloading")
          .addPackage("org.apache.commons.configuration.resolver")
          .addPackage("org.apache.commons.configuration.tree")
      }
      
      

       

       

       

      However, when I run the test and this gets deployed to JBoss, I get the following error:

       

      14:51:40,008 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.commons.configuration.resolver.CatalogResolver$Catalog in Module "deployment.test.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/commons/configuration/resolver/CatalogResolver$Catalog (Module "deployment.test.jar:main" from Service Module Loader)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:171)

              at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:489) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:851) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:596) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]

      Caused by: java.lang.NoClassDefFoundError: org/apache/xml/resolver/Catalog

              at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_31]

              at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_31]

              at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_31]

              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_31]

              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]

       

      This class (org.apache.xml.resolver.Catalog) is deployed by standard as a JBoss AS 7 module in the modules/apache/xml-resolver directory, yet it's not picked up when run my Arquillian test.

       

      Can anyone help me with what I'm missing?

       

      Thanks.