Rest-assured: Receiver class io.restassured.internal.ResponseParserRegistrar Exception with 4.3.0

Created on 9 Jun 2020  路  6Comments  路  Source: rest-assured/rest-assured

The tests working fine on 4.2.0, but we are seeing the following with 4.3.0.
Possibly a missing dependency with the latest version?

java.lang.AbstractMethodError: Receiver class io.restassured.internal.ResponseParserRegistrar does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject. at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:309) at io.restassured.internal.ResponseParserRegistrar.<init>(ResponseParserRegistrar.groovy:44) at io.restassured.RestAssured.createTestSpecification(RestAssured.java:1448) at io.restassured.RestAssured.given(RestAssured.java:653) at com.mytaxi.freemon.domain.model.actions.passenger.PaymentActions.addPaymentProvider(PaymentActions.kt:141) at com.mytaxi.freemon.domain.model.Passenger.addPaymentProvider(Passenger.kt) at com.mytaxi.freemon.domain.scenarios.payments.PaymentsBase.payByAppTour(PaymentsBase.java:65) at com.mytaxi.freemon.domain.scenarios.payments.PaymentsBase.takeTour(PaymentsBase.java:111) at com.mytaxi.freemon.domain.scenarios.payments.PayPalTourScenario.execute(PayPalTourScenario.kt:29) at com.mytaxi.freemon.domain.scenarios.payments.PayPalTourScenario$$FastClassBySpringCGLIB$$2fb6ef8c.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91) at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164) at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118) at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) at com.mytaxi.freemon.domain.scenarios.payments.PayPalTourScenario$$EnhancerBySpringCGLIB$$8fde0d17.execute(<generated>) at com.mytaxi.freemon.scheduling.ScenarioScheduler.runSingleScenario(ScenarioScheduler.kt:88) at com.mytaxi.freemon.scheduling.ScenarioScheduler.executeScenario(ScenarioScheduler.kt:68) at com.mytaxi.freemon.scheduling.ScenarioScheduler.access$executeScenario(ScenarioScheduler.kt:19) at com.mytaxi.freemon.scheduling.ScenarioScheduler$executeParallel$1$invokeSuspend$$inlined$map$lambda$1.invokeSuspend(ScenarioScheduler.kt:53) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)

All 6 comments

1283

I'm using gradle 6.5 (running groovy 2.5.11) and have a GradlePlugin depends on rest-assured. buildSrc folder. The plugin is running fine with 4.2.0 but getting the same error for 4.3.0 due to the class ResponseParserRegistrar is completely rewritten in Java and don't have the getProperty method.

Receiver class io.restassured.internal.ResponseParserRegistrar does not define or inherit an implementation of the resolved method abstract getProperty(Ljava/lang/String;)Ljava/lang/Object; of interface groovy.lang.GroovyObject.

and I can't find a way to force gradle to use another groovy version.

RestAssured 4.3.0 does not work with Spring Boot 2.4.0 馃憥

Hi,

I am getting the following exception with 4.3.0 and 4.3.3 it works with 4.2.1 (Springboot app 2.4.3). Is this a known issue?

java.lang.AbstractMethodError: Receiver class io.restassured.internal.RequestSpecificationImpl does not define or inherit an implementation of the resolved method 'abstract java.lang.Object invokeMethod(java.lang.String, java.lang.Object)' of interface groovy.lang.GroovyObject.\n\tat org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)\n\tat org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55)\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)\n\tat io.restassured.internal.RequestSpecificationImpl.<init>(RequestSpecificationImpl.groovy:145)\n\tat io.restassured.RestAssured.createTestSpecification(RestAssured.java:1452)\n\tat io.restassured.RestAssured.given(RestAssured.java:653)\n\

Is there any workaround?

effectively for me it only works with version 4.2.1 and I had to add jason-path and xml-path.

I work whit spring boot 2.4.3 and apache netbeans ide 12.2
pom.xml


org.springframework.boot
spring-boot-starter-web

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
                <type>jar</type>
            </dependency>

            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>4.2.1</version>
                <scope>test</scope>
                <type>jar</type>
            </dependency>

            <!-- https://mvnrepository.com/artifact/io.rest-assured/json-path -->
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>json-path</artifactId>
                <version>4.2.1</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/io.rest-assured/xml-path -->
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>xml-path</artifactId>
                <version>4.2.1</version>
            </dependency>
    </dependencies>

@Esther74 that's correct.
With Spring Boot 2.4.5 I had to downgrade from rest-assured from 4.4.0 to 4.2.1 and also adding xml-path and json-path to get it working.

Was this page helpful?
0 / 5 - 0 ratings