[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin edited comment on ARQ-1944 at 1/31/16 3:02 PM:
------------------------------------------------------------
I find your linkage error to be very strange. The reason that there's a problem with the Hamcrest matchers is that an extra copy of {{org.hamcrest.*}} is bundled inside the {{arquillian-junit.jar}} object that Arquillian includes to make a deployment "testable". Removing the duplicate Hamcrest objects (by whatever means) therefore resolves the problem.
Assuming that your problem is fundamentally the same as mine, this would imply that you also have duplicated objects somewhere -({{org.joda.time.*}} perhaps?)-. I suggest examining the artifacts that Arquillian deploys by adding these lines to your {{arquillian.xml}} file:
{code:XML}<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>{code}
Hmm, a closer look at the error suggests that {{myorg/rest/model/OrderStatus}} could be your problem: possibly the same class packaged into multiple jars, or maybe even two different implementations with the same class name?
was (Author: chrisjr):
I find your linkage error to be very strange. The reason that there's a problem with the Hamcrest matchers is that an extra copy of {{org.hamcrest.*}} is bundled inside the {{arquillian-junit.jar}} object that Arquillian includes to make a deployment "testable". Removing the duplicate Hamcrest objects (by whatever means) therefore resolves the problem.
Assuming that your problem is fundamentally the same as mine, this would imply that you also have duplicated objects somewhere ({{org.joda.time.*}} perhaps?). I suggest examining the artifacts that Arquillian deploys by adding these lines to your {{arquillian.xml}} file:
{code:XML}<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>{code}
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin commented on ARQ-1944:
-----------------------------------
I find your linkage error to be very strange. The reason that there's a problem with the Hamcrest matchers is that an extra copy of {{org.hamcrest.*}} is bundled inside the {{arquillian-junit.jar}} object that Arquillian includes to make a deployment "testable". Removing the duplicate Hamcrest objects (by whatever means) therefore resolves the problem.
Assuming that your problem is fundamentally the same as mine, this would imply that you also have duplicated objects somewhere ({{org.joda.time.*}} perhaps?). I suggest examining the artifacts that Arquillian deploys by adding these lines to your {{arquillian.xml}} file:
{code:XML}<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>{code}
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Marc Richards (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Marc Richards edited comment on ARQ-1944 at 1/30/16 6:22 PM:
-------------------------------------------------------------
Just wanted to add a few clarifications from my own testing as well
1) Yea, the latest releases of arquillian-tomcat-embedded have a bug when used with tomcat versions lower than 7.0.52, which makes the issue even more tricky: https://issues.jboss.org/browse/ARQ-1965
2) My errors are not related to hamcrest at all, the loader constraint violations are thrown for my own classes e.g.
{code:java}
java.lang.LinkageError: loader constraint violation: when resolving method "myorg.model.PollingEvent.<init>(Lorg/joda/time/DateTime;Lmyorg/rest/model/OrderStatus;Lorg/joda/time/DateTime;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, myorg/db/PollingEventManager, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, myorg/model/PollingEvent, have different Class objects for the type myorg/rest/model/OrderStatus used in the signature
{code}
or
{code:java}
java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "myorg/rest/model/Product"
{code}
3) Using @RunAsClient does workaround the issue for me as well except for some tests, however some tests make use of features of the app server and cannot be run as client
was (Author: talawahdotnet):
Just wanted to add a few clarifications from my own testing as well
1) Yea, the latest releases of arquillian-tomcat-embedded have a bug when used with tomcat versions lower than 7.0.52, which makes the issue even more tricky: https://issues.jboss.org/browse/ARQ-1965
2) My errors are not related to hamcrest at all, the loader constraint violations are thrown for my own classes e.g.
{code:java}
java.lang.LinkageError: loader constraint violation: when resolving method "myorg.model.PollingEvent.<init>(Lorg/joda/time/DateTime;Lmyorg/rest/model/OrderStatus;Lorg/joda/time/DateTime;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, myorg/db/PollingEventManager, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, myorg/model/PollingEvent, have different Class objects for the type myorg/rest/model/OrderStatus used in the signature
{code}
or
{code:java}
java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "myorg/rest/model/Product"
{code}
3) Using @RunAsClient does workaround the issue for me as well except for some tests, however some tests make use of features of the app server and cannot be run as client
3)
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Marc Richards (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Marc Richards commented on ARQ-1944:
------------------------------------
Just wanted to add a few clarifications from my own testing as well
1) Yea, the latest releases of arquillian-tomcat-embedded have a bug when used with tomcat versions lower than 7.0.52, which makes the issue even more tricky: https://issues.jboss.org/browse/ARQ-1965
2) My errors are not related to hamcrest at all, the loader constraint violations are thrown for my own classes e.g.
{code:java}
java.lang.LinkageError: loader constraint violation: when resolving method "myorg.model.PollingEvent.<init>(Lorg/joda/time/DateTime;Lmyorg/rest/model/OrderStatus;Lorg/joda/time/DateTime;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, myorg/db/PollingEventManager, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, myorg/model/PollingEvent, have different Class objects for the type myorg/rest/model/OrderStatus used in the signature
{code}
or
{code:java}
java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "myorg/rest/model/Product"
{code}
3) Using @RunAsClient does workaround the issue for me as well except for some tests, however some tests make use of features of the app server and cannot be run as client
3)
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Marc Richards (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Marc Richards edited comment on ARQ-1944 at 1/30/16 5:43 PM:
-------------------------------------------------------------
I ran into this error using arquillian-tomcat-embedded with Tomcat 7.0.52 and 8.0.28. It appears that a change was made to the which classloader is used by default for Tomcat versions after 7.0.50:
https://bz.apache.org/bugzilla/show_bug.cgi?id=55943
https://tomcat.apache.org/tomcat-7.0-doc/changelog.html#Tomcat 7.0.51 (violetagg)
https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html#Class_Lo...
I was able to successfully work around the issue by adding the following line to context.xml: <Loader delegate="true"/>
was (Author: talawahdotnet):
I ran into this error using arquillian-tomcat-embedded with Tomcat 7.0.52 and 8.0.28. It appears that a change was made to the which classloader is used by default for Tomcat versions after 7.5.0:
https://bz.apache.org/bugzilla/show_bug.cgi?id=55943
https://tomcat.apache.org/tomcat-7.0-doc/changelog.html#Tomcat 7.0.51 (violetagg)
https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html#Class_Lo...
I was able to successfully work around the issue by adding the following line to context.xml: <Loader delegate="true"/>
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin updated ARQ-1944:
------------------------------
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:
{code}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)
{code}
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|https://github.com/arquillian/arquillian-core/issues/78]
was:
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:
{code}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)
{code}
This error can be resolved in three 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}}.
See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> 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|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin edited comment on ARQ-1944 at 1/29/16 11:37 AM:
-------------------------------------------------------------
In my _particular_ case, I am deploying a ROOT.war file into an embedded Tomcat and then testing its HTTP endpoints. This means that I don't really need the Arquillian JARs to be packaged into my WAR at all! I can therefore do this:
{code}@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.create(WebArchive.class, "ROOT.war")
...;
}
{code}
And then annotate all of my test cases as:
{code}(a)RunWith(Arquillian.class)
@RunAsClient
public class MyTestCaseIT {
...
}
{code}
The point here is that {{@Deployment(testable = false)}} effectively stops Arquillian from including the extra and unwanted Hamcrest artifact.
was (Author: chrisjr):
In my _particular_ case, I am deploying a ROOT.war file into an embedded Tomcat and then testing its HTTP endpoints. This means that I don't really need the Arquillian JARs to be packaged into my WAR at all! I can therefore do this:
{code}@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.creaste(WebArchive.class, "ROOT.war")
...;
}
{code}
And then annotate all of my test cases as:
{code}(a)RunWith(Arquillian.class)
@RunAsClient
public class MyTestCaseIT {
...
}
{code}
The point here is that {{@Deployment(testable = false)}} effectively stops Arquillian from including the extra and unwanted Hamcrest artifact.
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> This error can be resolved in three 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}}.
> See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin commented on ARQ-1944:
-----------------------------------
In my _particular_ case, I am deploying a ROOT.war file into an embedded Tomcat and then testing its HTTP endpoints. This means that I don't really need the Arquillian JARs to be packaged into my WAR at all! I can therefore do this:
{code}@Deployment(testable = false)
public static WebArchive createDeployment() {
return ShrinkWrap.creaste(WebArchive.class, "ROOT.war")
...;
}
{code}
And then annotate all of my test cases as:
{code}(a)RunWith(Arquillian.class)
@RunAsClient
public class MyTestCaseIT {
...
}
{code}
The point here is that {{@Deployment(testable = false)}} effectively stops Arquillian from including the extra and unwanted Hamcrest artifact.
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> This error can be resolved in three 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}}.
> See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin edited comment on ARQ-1944 at 1/29/16 8:57 AM:
------------------------------------------------------------
Confirmed that Tomcat 7.0.50 is actually unaffected, although I have also needed to downgrade my example project to use arquillian-tomcat-embedded-7:1.0.0.CR5 for this version to pass.
Adding {code:XML}<Loader delegate="true"/>{code} to the context.xml also works, although I wouldn't want fundamentally to alter how Tomcat behaves just to work around a problem with using Arquillian!
was (Author: chrisjr):
Confirm that Tomcat 7.0.50 is actually unaffected, although I have also needed to downgrade my example project to use arquillian-tomcat-embedded-7:1.0.0.CR5 for this version to pass.
Adding {code:XML}<Loader delegate="true"/>{code} to the context.xml also works, although I wouldn't want to fundamentally alter how Tomcat behaves just to work around an Arquillian bug.
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> This error can be resolved in three 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}}.
> See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin updated ARQ-1944:
------------------------------
Affects Version/s: 1.1.11.Final
1.1.10.Final
1.1.9.Final
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> 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:
> {code}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)
> {code}
> This error can be resolved in three 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}}.
> See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months