java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String

Jenkins JIRA | François Benaiteau | 1 year ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    [JIRA] [cucumber-testresult-plugin] (JENKINS-33041) Could not parse resulting json

    Google Groups | 1 year ago | francois.benaiteau+jenkins@gmail.com (JIRA)
    java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String
  2. 0

    I am using cucumber 2.3.2 (ruby) to run my tests and generate the tests' results. I am getting the following error: ``` ERROR: Build step failed with exception java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String at gherkin.JSONParser.getString(JSONParser.java:225) at gherkin.JSONParser.location(JSONParser.java:208) at gherkin.JSONParser.step(JSONParser.java:110) at gherkin.JSONParser.parse(JSONParser.java:51) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:77) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:43) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:159) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:105) at hudson.FilePath.act(FilePath.java:990) at hudson.FilePath.act(FilePath.java:968) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:99) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:99) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:112) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Build step 'Publish Cucumber test result report' marked build as failure Finished: FAILURE ``` Attached is the json file.

    Jenkins JIRA | 1 year ago | François Benaiteau
    java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String
  3. 0

    I am using cucumber 2.3.2 (ruby) to run my tests and generate the tests' results. I am getting the following error: ``` ERROR: Build step failed with exception java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String at gherkin.JSONParser.getString(JSONParser.java:225) at gherkin.JSONParser.location(JSONParser.java:208) at gherkin.JSONParser.step(JSONParser.java:110) at gherkin.JSONParser.parse(JSONParser.java:51) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:77) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:43) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:159) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:105) at hudson.FilePath.act(FilePath.java:990) at hudson.FilePath.act(FilePath.java:968) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:99) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:99) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:112) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Build step 'Publish Cucumber test result report' marked build as failure Finished: FAILURE ``` Attached is the json file.

    Jenkins JIRA | 1 year ago | François Benaiteau
    java.lang.ClassCastException: gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This is the error i got in the console for the job when it tried to parse the attached json file. {code} [Cucumber Tests] Parsing results. [Cucumber Tests] parsing cucumber.json ERROR: Build step failed with exception java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String at gherkin.JSONParser.step(JSONParser.java:131) at gherkin.JSONParser.parse(JSONParser.java:51) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:94) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:44) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:161) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:107) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:101) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:116) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:93) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Build step 'Publish Cucumber test result report' marked build as failure {code}

    Jenkins JIRA | 2 years ago | olivier destrebecq
    java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String
  6. 0

    This is the error i got in the console for the job when it tried to parse the attached json file. {code} [Cucumber Tests] Parsing results. [Cucumber Tests] parsing cucumber.json ERROR: Build step failed with exception java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String at gherkin.JSONParser.step(JSONParser.java:131) at gherkin.JSONParser.parse(JSONParser.java:51) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:94) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:44) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:161) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:107) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:101) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:116) at org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:93) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Build step 'Publish Cucumber test result report' marked build as failure {code}

    Jenkins JIRA | 2 years ago | olivier destrebecq
    java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String

    Root Cause Analysis

    1. java.lang.ClassCastException

      gherkin.deps.com.google.gson.internal.StringMap cannot be cast to java.lang.String

      at gherkin.JSONParser.getString()
    2. Gherkin
      JSONParser.parse
      1. gherkin.JSONParser.getString(JSONParser.java:225)
      2. gherkin.JSONParser.location(JSONParser.java:208)
      3. gherkin.JSONParser.step(JSONParser.java:110)
      4. gherkin.JSONParser.parse(JSONParser.java:51)
      4 frames
    3. org.jenkinsci.plugins
      DefaultTestResultParserImpl$ParseResultCallable.invoke
      1. org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:77)
      2. org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:43)
      3. org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:159)
      4. org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl$ParseResultCallable.invoke(DefaultTestResultParserImpl.java:105)
      4 frames
    4. Hudson
      FilePath.act
      1. hudson.FilePath.act(FilePath.java:990)
      2. hudson.FilePath.act(FilePath.java:968)
      2 frames
    5. org.jenkinsci.plugins
      CucumberTestResultArchiver.perform
      1. org.jenkinsci.plugins.cucumber.jsontestsupport.DefaultTestResultParserImpl.parse(DefaultTestResultParserImpl.java:99)
      2. org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberJSONParser.parse(CucumberJSONParser.java:99)
      3. org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver.perform(CucumberTestResultArchiver.java:112)
      3 frames
    6. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      4. hudson.model.Build$BuildExecution.post2(Build.java:185)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      6. hudson.model.Run.execute(Run.java:1763)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:410)
      9 frames