Rest-assured: Imported library throwing signature exception

Created on 20 Jul 2015  路  4Comments  路  Source: rest-assured/rest-assured

_From [email protected] on March 14, 2011 17:59:37_

What steps will reproduce the problem? 1. Setting up a new project

  1. Imported the 3 libraries as asked
  2. When running the first test created the following exception happens
    java.lang.SecurityException: class "org.hamcrest.Matchers"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.jayway.restassured.internal.ResponseSpecificationImpl.class$(ResponseSpecificationImpl.groovy)
    at com.jayway.restassured.internal.ResponseSpecificationImpl.$get$$class$org$hamcrest$Matchers(ResponseSpecificationImpl.groovy)
    at com.jayway.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:76)
    at test.java.SITRestTests.resttests.EM3GetTest.testEm3Rest(EM3GetTest.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) What is the expected output? What do you see instead? What version of the product are you using? On what operating system? The latest. Using eclipse in conjunction with junit.

Essentially no tests can run. Please provide any additional information below.

_Original issue: http://code.google.com/p/rest-assured/issues/detail?id=43_

Priority-Medium imported bug wontfix

Most helpful comment

_From [email protected] on February 23, 2015 01:54:37_

just had the problem too, found a solution somewhere else. Instead of import org.hamcrest.Matchers._; i used import static org.hamcrest.CoreMatchers._;
and it worked for me in Eclipse + Junit4

All 4 comments

_From [email protected] on March 15, 2011 00:14:53_

It seems to be a problem with the Hamcrest library. See https://code.google.com/p/hamcrest/issues/detail?id=128 for details and a solution. I doubt that there's anything that can be done in REST Assured to prevent this.

Status: WontFix

_From [email protected] on March 15, 2011 02:00:34_

Thanks Johan, I put Junit down the bottom and that seems to have worked.

_From [email protected] on March 15, 2011 06:42:29_

Great! Thanks for using the project.

_From [email protected] on February 23, 2015 01:54:37_

just had the problem too, found a solution somewhere else. Instead of import org.hamcrest.Matchers._; i used import static org.hamcrest.CoreMatchers._;
and it worked for me in Eclipse + Junit4

Was this page helpful?
0 / 5 - 0 ratings