Google Groups

Re: [rest-assured] java.lang.IncompatibleClassChangeError

Markus Moldaschl Apr 12, 2013 12:36 AM
Posted in group: REST assured
Hi Johan,

thanks for the quick response, which fixed my problem!

Yes, we use Maven and I found that the dependency com.sun.jersey:jersey-server:1.16 has a dependendy to asm 3.1. I tried to exclude that dependendy from jersey-server and use rest-assured without exclusions but then the IncompatibleClassChangeError appeared again. So I'm not exactly sure what caused the problem in my case.

However, it works now. Thx

Am Freitag, 12. April 2013 08:36:07 UTC+2 schrieb Johan Haleby:

Thanks for your comments. Are you using Maven? In that case you may have conflicting versions of asm in classpath. REST Assured depends on Groovy 2.1.2 which depends on asm 4.x which is not backward compatible with asm 3.x. I actually had the same issue myself in my current project where Groovy and jersey-spring were in conflict. In that case you can do something like this:

                    <!-- There's a classpath clash with groovy and jersey-spring in because of incompatible asm versions, let's
                           depend on groovy-all instead which fixes the problem. -->
                <!-- Needs to be the same version that REST Assured depends on -->

Please see if it works for you. I'll probably add this to an FAQ and write a blog about it if it works.


On Fri, Apr 12, 2013 at 8:20 AM, Markus Moldaschl <> wrote:

I attended the REST-assured talk at confess 2013 in vienna and was pretty impressed. So I gave it a try today, but got the following stacktrace where I don't have any clue of what is wrong:

java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.MethodVisitor, but class was expected
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.genConstructor(
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.genPojoMetaMethodSite(
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePojoMethod(
at org.codehaus.groovy.reflection.CachedMethod.createPojoMetaMethodSite(
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createCachedMethodSite(
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createPojoMetaMethodSite(
at groovy.lang.MetaClassImpl.createPojoCallSite(
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
at com.jayway.restassured.internal.ResponseParserRegistrar.<init>(ResponseParserRegistrar.groovy:44)
at com.jayway.restassured.RestAssured.createTestSpecification(
at com.jayway.restassured.RestAssured.expect(
at at.willhaben.iad.remote.v2.integrationtest.LocationsRemoteIT.testGetSingleLocation(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(
at com.intellij.rt.execution.junit.JUnitStarter.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at com.intellij.rt.execution.application.AppMain.main(

The test looks like this:

import org.junit.Test;
import static com.jayway.restassured.RestAssured.expect;
import static org.hamcrest.Matchers.*;

 * @author markus.moldaschl
public class LocationsRemoteIT {

    public void testGetSingleLocation() {
        expect().body("", hasItems(117225)).when().get("/restapi/v2/locations/1030");

I use rest-assured 1.8.0 in a maven environment. The rest-assured dependency is defined before the junit dependency.

Does anybody know what is wrong?


You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit