Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8979

JDK 11,java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.5
    • JSON
    • None
    • java version "11.0.2" 2019-01-15 LTS
      Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
      Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

    Description

      cast issue happening while parsing HTTP  response to Java class  in jdk 11, but not in jdk 8.

      please let us know, do you have further questions or advice to fix with JDK 11 

      Caused by: java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')at deployment.application.war//groovy.json.internal.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:88)at deployment.application.war//groovy.json.internal.FastStringUtils.toCharArray(FastStringUtils.java:175)at deployment.application.war//groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:103)at deployment.application.war//groovy.json.JsonSlurper.parseText(JsonSlurper.java:208)at groovy.json.JsonSlurper$parseText.call(Unknown Source)at deployment.application.war//org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)at deployment.application.war//org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)at deployment.application.war//org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)at deployment.application.war//com.company.agent.commons.services.AuthorizeService.requestToken(AuthrizeService.groovy:76)at deployment.application.war//com.company.agent.commons.services.AuthorizeService.initBean(AuthrizeService.groovy:52)
      

      Attachments

        1. TestGroovyJsonSlurper.zip
          2 kB
          Matteo Steccolini

        Activity

          People

            Unassigned Unassigned
            TarakA TarakA
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: