1 Reply Latest reply on Jan 2, 2013 9:17 AM by Karel Piwko

    java.lang.ClassNotFoundException: org.jboss.seam.international.status.builder.BundleKey

    Andi Andi Newbie

      Hello,

       

      I'm trying to run some arquillian managed test cases. Unfortunely it doesn' t works.

       

      1. First of all I set up my pom.xml.

       

       

      {code:xml}
      <?xml version="1.0" encoding="UTF-8"?>


      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

      <modelVersion>4.0.0</modelVersion>

      ...

          <dependencyManagement>

              <dependencies>

                  ...

                  <dependency>

                      <groupId>org.jboss.arquillian</groupId>

                      <artifactId>arquillian-bom</artifactId>

                      <version>1.0.3.Final</version>

                      <scope>import</scope>

                      <type>pom</type>

                  </dependency>

                  ...

              </dependencies>

          </dependencyManagement>


          <dependencies>

             ...

             <dependency>

                  <groupId>junit</groupId>

                  <artifactId>junit</artifactId>

                  <version>4.8.1</version>

                  <scope>test</scope>

              </dependency>


              <dependency>

                  <groupId>org.jboss.arquillian.junit</groupId>

                  <artifactId>arquillian-junit-container</artifactId>

                  <scope>test</scope>

              </dependency>

              ...

          </dependencies>


          <build>

          ...     

         </build>


          <profiles>

              <profile>

                  <id>arquillian-jbossas-managed</id>

                  <dependencies>

                      <dependency>

                          <groupId>org.jboss.spec</groupId>

                          <artifactId>jboss-javaee-6.0</artifactId>

                          <version>1.0.0.Final</version>

                          <type>pom</type>

                          <scope>provided</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.jboss.as</groupId>

                          <artifactId>jboss-as-arquillian-container-managed</artifactId>

                          <version>7.1.1.Final</version>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

              </profile>

          </profiles>

      </project>

      {code}

       

      2. Then I create the arquillian.xml

       

      {code:xml}

      <?xml version="1.0" encoding="UTF-8"?>

      <arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:jbossas-remote="urn:arq:org.jboss.arquillian.container.jbossas.remote_6">


          <!-- Uncomment to have test archives exported to the file system for inspection -->

          <engine>

              <property name="deploymentExportPath">target/</property>

          </engine>


          <!-- Example configuration for a remote JBoss AS 7 instance -->

          <container qualifier="jboss" default="true"> 

              <configuration>

                  <property name="jbossHome">/opt/jboss-as-7.1.1.Final</property>

                  <property name="allowConnectingToRunningServer">true</property>

              </configuration>

          </container>  

      </arquillian>

      {code}

       

      3. Then I wrote a simple test case:

       

       

      {code}

      @RunWith(Arquillian.class)

      public class TestCase{

       

          @Inject

          private Repository repository;

       

          @Deployment

          public static JavaArchive createTestArchive() {

              JavaArchive archive = ShrinkWrap

                                  .create(JavaArchive.class)

                                  .addPackages(true, "com.company")

                                  .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))

                                  .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml");

              return archive;

          }

       

          @Test

          public void testGetAllRules() {

              Assert.assertNotNull(repository);

          }

      {code}

       

      4. I run the test case as a JUnit test

       

      Unfortunely it stops with this exception:

       

       

      {code}

      11:02:30,247 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."test.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "test.war"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-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.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]

      Caused by: java.lang.RuntimeException: Error getting reflective information for class de.fhhannover.inform.dataqualitycheckingengine.business.security.control.SuperAdminAccountController with ClassLoader ModuleClassLoader for Module "deployment.test.war:main" from Service Module Loader

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

      Caused by: java.lang.NoClassDefFoundError: org/jboss/seam/international/status/builder/BundleKey

          at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_07]

          at java.lang.Class.privateGetDeclaredFields(Class.java:2308) [rt.jar:1.7.0_07]

          at java.lang.Class.getDeclaredFields(Class.java:1760) [rt.jar:1.7.0_07]

          at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 10 more

      Caused by: java.lang.ClassNotFoundException: org.jboss.seam.international.status.builder.BundleKey from [Module "deployment.test.war:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [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]

          ... 15 more

      {code}

       

      Do I really have to add some seam packages? I already has them in my maven dependencies.