2 Replies Latest reply on Oct 27, 2011 6:00 PM by Daniel Gimenes

    Can't use Arquillian with remote Glassfish - ClassFormatError: Absent Code...

    Daniel Gimenes Newbie

      Hi everybody,

       

      I'm trying to use Arquillian with a remote Glassfish (because I need JPA), but I keep getting the following errors:

       

      org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator getActivatedConfiguration

      INFO: Could not read active container configuration: null

      java.lang.reflect.UndeclaredThrowableException

          [...]

      Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ws/rs/core/MediaType

          at java.lang.ClassLoader.defineClass1(Native Method)

          at java.lang.ClassLoader.defineClass(ClassLoader.java:634)

          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

          at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)

          at java.net.URLClassLoader.access$000(URLClassLoader.java:73)

          [...]

       

      my pom.xml has the following:

       

            <profile>

                  <id>arquillian-profile</id>

                  <dependencies>

                      <dependency>

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

                          <artifactId>arquillian-glassfish-remote-3.1</artifactId>

                          <version>1.0.0.CR2</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>javax</groupId>

                          <artifactId>javaee-api</artifactId>

                          <version>6.0</version>

                          <scope>provided</scope>

                      </dependency>

                  </dependencies>

                  <build>

                      <testResources>

                          <testResource>

                              <directory>src/test/resources</directory>

                          </testResource>

                          <testResource>

                              <directory>src/test/resources-glassfish-remote</directory>

                          </testResource>

                      </testResources>

                  </build>

              </profile>

       

      and my arquillian.xml (on src/test/resources) is:

       

      <?xml version="1.0"?>

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

          xmlns="http://jboss.org/schema/arquillian"

          xsi:schemaLocation="http://jboss.org/schema/arquillian

          http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

         

              <container qualifier="local-glassfish-3.1.1" default="true">

                  <configuration>

                      <property name="adminUser">daniel</property>

                      <property name="adminPassword">password</property>

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

                  </configuration>

              </container>

      </arquillian>

       

      Also, I'm sure my glassfish is running on localhost:4848 (admin console) and localhost:8080, and I'm calling maven with the right profile.

       

      Oh, and my test itself is irrelevant: I even deleted everything and created a @Test just with assertTrue(true) and a @Deployment that does not include any classes, and the error persists.

       

      Any ideas?

       

      Thank you.

        • 2. Re: Can't use Arquillian with remote Glassfish - ClassFormatError: Absent Code...
          Daniel Gimenes Newbie

          Perfect!

           

          My pom.xml now has this:

           

               <profile>

                      <id>arquillian</id>

                      <dependencies>

                          <dependency>

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

                              <artifactId>arquillian-glassfish-remote-3.1</artifactId>

                              <version>1.0.0.CR2</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.glassfish.extras</groupId>

                              <artifactId>glassfish-embedded-all</artifactId>

                              <version>3.1</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>javax</groupId>

                              <artifactId>javaee-api</artifactId>

                              <version>6.0</version>

                              <scope>provided</scope>

                          </dependency>

                      </dependencies>

                      <build>

                          <testResources>

                              <testResource>

                                  <directory>src/test/resources</directory>

                              </testResource>

                              <testResource>

                                  <directory>src/test/resources-glassfish-remote</directory>

                              </testResource>

                          </testResources>

                      </build>

                  </profile>

           

          Thank you, Aslak Knutsen.