JsonSlurp Lexing failed 1 error; after upgrading the Maven Groovy Eclipse Compiler

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JsonSlurp Lexing failed 1 error; after upgrading the Maven Groovy Eclipse Compiler

Robert Brooks
Hi All,

After upgrading my 'maven's groovy-eclipse-compiler' to 2.8.0-01 and my 'groovy-all' artifact to 2.1.8. I am running into an error with the JsonSlurper. I believe it is a problem with upgrading because the same Json is parsed when use older versions (2.6.0-01, 2.1.6) maven's groovy-eclipse-compiler and groovy-all. I was forced to upgrade one module because a teammate decided to start writing Spock tests and the spring-core-0.7-groovy-2.0 module was not compatible with the mave

Lexing failed on line: 1, column: 2, while reading 'R', no possible valid JSON value or punctuation could be recognized.
groovy.json.JsonException
    at groovy.json.JsonLexer.nextToken(JsonLexer.java:82)
    at groovy.json.JsonSlurper.parseObject(JsonSlurper.java:172)
    at groovy.json.JsonSlurper.parse(JsonSlurper.java:75)
    at groovy.json.JsonSlurper.parseText(JsonSlurper.java:59)
    at resource.common.controller.auth.MasheryCredentialController.run(MasheryCredentialController.groovy:19)
    at groovy.lang.GroovyShell.evaluate(GroovyShell.java:518)
    at groovy.lang.GroovyShell.evaluate(GroovyShell.java:565)
    at resource.common.MasheryCredentialControllerTest.Credentials Request Handler should parse response and bind credential to
       Groovy context(MasheryCredentialControllerTest.groovy:38)


JSON Text:
{
    "ReadResponse": {
        "requestId": "scl-1svad-m:admin-services:o0n18r84",
        "version": "UNKNOWN",
        "startTime": "2013-02-06T20:00:20.691Z",
        "endTime": "2013-02-06T20:00:21.136Z",
        "processTime": 445,
        "uri": "http://localhost:8080/mgmt/admin-services/v1/credentials/A40C782D-40BD-4199-ACAB-F643DF17992F",
        "credential": {
            "id": "http://localhost:8080/mgmt/admin-services/v1/credentials/A40C782D-40BD-4199-ACAB-F643DF17992F",
            "username": "foobar",
            "password": "password",
            "active": true,
            "locked": false,
            "email": "[hidden email]",
            "businessUnit": {
                "id": "http://localhost:8080/mgmt/admin-services/v1/businessunits/2"
            },
            "applicationId": "D4804842-FB2E-4A30-B8F9-D1271B0A6B39"
        }
    }
}


pom.xml

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <compilerId>groovy-eclipse-compiler</compilerId>
          <verbose>true</verbose>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.8.0-01</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.1.8-01</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>groovy-eclipse-compiler</artifactId>
        <groupId>org.codehaus.groovy</groupId>
        <version>2.8.0-01</version>
        <extensions>true</extensions>
      </plugin>

    <dependency>
      <artifactId>groovy-all</artifactId>
      <groupId>org.codehaus.groovy</groupId>
      <version>2.1.8</version>
    </dependency>
  </dependencies> 
Loading...