Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1944

Linkage error with arquillian-junit.jar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
    • None
    • None
    • Hide

      Unpack test-arquillian-hamcrest.tar.xz, then:

      $ mvn clean verify

      The project contains an implementation of org.jboss.arquillian.junit.container.JUnitDeploymentAppender, which has been copied directly from GitHub. (Yes, the test still fails if you delete it!) This class is included to show how removing "org.hamcrest" fixes the problem.

      Show
      Unpack test-arquillian-hamcrest.tar.xz , then: $ mvn clean verify The project contains an implementation of org.jboss.arquillian.junit.container.JUnitDeploymentAppender , which has been copied directly from GitHub. (Yes, the test still fails if you delete it!) This class is included to show how removing "org.hamcrest" fixes the problem.

    Description

      Testing a WAR in embedded Tomcat >= 7.0.51 using Restassured, JUnit and Hamcrest matchers. (TestNG works fine).

      The test fails with this error message:

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.404 sec <<< FAILURE! - in org.testing.web.TroubleIT
      testTrouble(org.testing.web.TroubleIT)  Time elapsed: 0.774 sec  <<< ERROR!
      java.lang.LinkageError: loader constraint violation: when resolving interface method "com.jayway.restassured.specification.ResponseSpecification.statusCode(Lorg/hamcrest/Matcher;)Lcom/jayway/restassured/specification/ResponseSpecification;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/testing/web/TroubleIT, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, com/jayway/restassured/specification/ResponseSpecification, have different Class objects for the type cification.statusCode(Lorg/hamcrest/Matcher;)Lcom/jayway/restassured/specification/ResponseSpecification; used in the signature
      	at org.testing.web.TroubleIT.testTrouble(TroubleIT.java:35)
      

      This error can be resolved in four different ways:

      • Rewrite the test using TestNG
      • Rewrite the test without using any Hamcrest matchers.
      • Remove "org.hamcrest" from org.jboss.arquillian.junit.container.JUnitDeploymentAppender.
      • Set @Deployment(testable = false) to prevent Arquillian from packaging its artifacts into the deployment in the first place.

      See Issue #78 for arquillian-core

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrisjr_jira Chris Rankin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: