1 Reply Latest reply on Jul 7, 2013 9:04 AM by Tanya Ruttenberg

    jboss 7.2 remote container OSGiManifestBuilder class not found

    Tanya Ruttenberg Expert

      I'm trying to get jboss as7.2/eap 6.1 remote container working.

      error, arq.xml, pom.xml below

       

      error:

       

      java.lang.NoClassDefFoundError: org/jboss/osgi/metadata/OSGiManifestBuilder

      at org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager.addModulesManifestDependencies(JMXProtocolPackager.java:227)

      at org.jboss.as.arquillian.protocol.jmx.JMXProtocolPackager.generateDeployment(JMXProtocolPackager.java:105)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.buildTestableDeployments(DeploymentGenerator.java:193)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.createTestableDeployments(DeploymentGenerator.java:148)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:85)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:601)

      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

      at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:601)

      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

      at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

      at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:601)

      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

      at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:601)

      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)

      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)

      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:601)

      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

      Caused by: java.lang.ClassNotFoundException: org.jboss.osgi.metadata.OSGiManifestBuilder

      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

      at java.security.AccessController.doPrivileged(Native Method)

      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

      ... 58 more

       

       

      pom.xml (note overrides at the bottom, the default dependencies were not on my nexus server and I don't have access to the internet):

       

      <profile>
      <id>arquillian-jbossas-remote</id>
      <dependencies>
        <dependency>
         <groupId>org.jboss.as</groupId>
         <artifactId>jboss-as-arquillian-container-remote</artifactId>
         <version>7.2.0.Final</version>
         <scope>test</scope>
        </dependency>
        <!-- In order for JBoss to use Servlet protocol instead of JMX include
         this artifact -->
        <!-- https://community.jboss.org/wiki/WhyDoIGetNoActiveContextsForScopeTypeWhenTestingOnJBossAS7 -->
        <dependency>
         <groupId>org.jboss.arquillian.protocol</groupId>
         <artifactId>arquillian-protocol-servlet</artifactId>
         <scope>test</scope>
        </dependency>
       
        <!-- Override non-existant dependencies. Try removing these at some point
         in the future -->
        <dependency>
         <groupId>org.jboss.metadata</groupId>
         <artifactId>jboss-metadata-common</artifactId>
         <version>7.0.5.Final</version>
         <scope>test</scope>
        </dependency>
        <dependency>
         <groupId>org.jboss.osgi.framework</groupId>
         <artifactId>jbosgi-framework-core</artifactId>
         <version>2.0.0.CR9</version>
         <scope>test</scope>
        </dependency>
        <!-- Ended override of non-existent dependencies -->

      </dependencies>

      </profile>

       

      arq.xml:

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
              http://jboss.org/schema/arquillian
              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

      <!-- Jboss uses JMX by default. Force it to use Servlet 3.0 -->
      <!-- https://community.jboss.org/wiki/WhyDoIGetNoActiveContextsForScopeTypeWhenTestingOnJBossAS7 -->
      <!-- <defaultProtocol type="Servlet 3.0"/> -->

      <!-- Better to specify servlet explicitly since embedded container doesn't use it -->
      <container qualifier="arquillian-jbossas-remote" default="true">
        <configuration>
         <property name="providerUrl">jnp://127.0.0.1:9999</property>
        </configuration>
        <protocol type="Servlet 3.0">
         <property name="host">127.0.0.1</property>
         <property name="port">8080</property>
        </protocol>
      </container>

      </arquillian>