Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Imported library throwing signature exception #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setting up a new project
2. Imported the 3 libraries as asked
3. 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 reported on code.google.com by brucew...@gmail.com on 14 Mar 2011 at 4:59

GoogleCodeExporter commented 9 years ago
It seems to be a problem with the Hamcrest library. See 
http://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.

Original comment by johan.ha...@gmail.com on 15 Mar 2011 at 7:14

GoogleCodeExporter commented 9 years ago
Thanks Johan, I put Junit down the bottom and that seems to have worked.

Original comment by brucew...@gmail.com on 15 Mar 2011 at 9:00

GoogleCodeExporter commented 9 years ago
Great! Thanks for using the project.

Original comment by johan.ha...@gmail.com on 15 Mar 2011 at 1:42

GoogleCodeExporter commented 9 years ago
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

Original comment by Guido.Sc...@googlemail.com on 23 Feb 2015 at 9:54