Forum Discussion

Driver23's avatar
Driver23
Visitor
2 years ago

Cannot cast object with class 'java.lang.String' to class 'java.util.map'

Hi Guys. We are facing the problem:
Org.codehaus.groovy.runtime.typehandling.GroovyCastException:
Cannot cast object with class 'java.lang.String' to class 'Java.util.Map' when starting readyapi-testrunner under Docker with our gitlab ci instance. Whereas the same code works fine under 1) ReadyApi itself 2) local testrunner 3) testrunner running locally in docker!
The problem drives us crazy. Any help will be appreciated.
Versions of readyApi and respective docker image are 3.47.0
By the way, one more detail: the behaviour is flaky, that means sometimes it starts the tests, sometimes not (with the error above). Classloader problem?
  • nmrao's avatar
    nmrao
    Champion Level 3

    For a groovy script test step?

    Is there any sample script to which the problem is happening?

  • KarelHusa's avatar
    KarelHusa
    Champion Level 2

    Driver23,

    the issue seems to relate to Groovy runtime, as nmrao pointed out earlier.

     

    There are different places where Groovy scripts may cause the issue:

    • Groovy inline scripts (in requests, properties, etc.)
    • Test case/suite startup or teardown scripts
    • Groovy test steps or script assertions
    • Script library (directory with scripts)

    Is the error a startup issue or does it relate to some of the test cases? You can debug that by executing a new simple test case without Groovy.