java.lang.NumberFormatException: For input string: "-"

Jenkins JIRA | torbent | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    My "journey" started with this exception: {noformat} 14-04-2010 12:43:13 hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling java.lang.NumberFormatException: For input string: "-" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.(Unknown Source) at com.tek42.perforce.parse.Changes.getChangeNumbers(Changes.java:144) at hudson.plugins.perforce.PerforceSCM.needToBuild(PerforceSCM.java:735) at hudson.plugins.perforce.PerforceSCM.pollChanges(PerforceSCM.java:639) at hudson.scm.SCM.poll(SCM.java:370) at hudson.model.AbstractProject.poll(AbstractProject.java:1157) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:330) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:359) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {noformat} I also added this text as a note to JENKINS-1873, thinking it was the same. Some further analysis revealed which job was failing (only one, consistently). After a while, trying to get output of "p4 changes -m 2 //clientspec/...", I discovered that this particular clientspec was using the wrong Root! Most of our builds use custom workspaces in the form "${N}/hudson/jobs/${JOB_NAME}/workspace" (N expands to a network drive or mount point, JOB_NAME is a Hudson standard variable). This job's Perforce clientspec consistently ends up with a root that is the workspace of a different build (one of its downstream builds, but that's probably coincidence). I have tried many things, including deleting the clientspec and letting the plugin start over; still the same thing happened.

    Jenkins JIRA | 7 years ago | torbent
    java.lang.NumberFormatException: For input string: "-"
  2. 0

    My "journey" started with this exception: {noformat} 14-04-2010 12:43:13 hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling java.lang.NumberFormatException: For input string: "-" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.(Unknown Source) at com.tek42.perforce.parse.Changes.getChangeNumbers(Changes.java:144) at hudson.plugins.perforce.PerforceSCM.needToBuild(PerforceSCM.java:735) at hudson.plugins.perforce.PerforceSCM.pollChanges(PerforceSCM.java:639) at hudson.scm.SCM.poll(SCM.java:370) at hudson.model.AbstractProject.poll(AbstractProject.java:1157) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:330) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:359) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {noformat} I also added this text as a note to JENKINS-1873, thinking it was the same. Some further analysis revealed which job was failing (only one, consistently). After a while, trying to get output of "p4 changes -m 2 //clientspec/...", I discovered that this particular clientspec was using the wrong Root! Most of our builds use custom workspaces in the form "${N}/hudson/jobs/${JOB_NAME}/workspace" (N expands to a network drive or mount point, JOB_NAME is a Hudson standard variable). This job's Perforce clientspec consistently ends up with a root that is the workspace of a different build (one of its downstream builds, but that's probably coincidence). I have tried many things, including deleting the clientspec and letting the plugin start over; still the same thing happened.

    Jenkins JIRA | 7 years ago | torbent
    java.lang.NumberFormatException: For input string: "-"
  3. 0

    Perforce Plugin - Jenkins - Jenkins Wiki

    jenkins-ci.org | 2 months ago
    java.lang.NumberFormatException: For input string: "-"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Perforce Plugin - hudson - Hudson Wiki

    hudson-ci.org | 7 months ago
    java.lang.NumberFormatException: For input string: "-"
  6. 0

    Perforce Plugin - hudson - Hudson Wiki

    hudson-ci.org | 8 months ago
    java.lang.NumberFormatException: For input string: "-"
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NumberFormatException

    For input string: "-"

    at java.lang.NumberFormatException.forInputString()
  2. Java RT
    Integer.<init>
    1. java.lang.NumberFormatException.forInputString(Unknown Source)
    2. java.lang.Integer.parseInt(Unknown Source)
    3. java.lang.Integer.<init>(Unknown Source)
    3 frames
  3. com.tek42.perforce
    Changes.getChangeNumbers
    1. com.tek42.perforce.parse.Changes.getChangeNumbers(Changes.java:144)
    1 frame
  4. hudson.plugins.perforce
    PerforceSCM.pollChanges
    1. hudson.plugins.perforce.PerforceSCM.needToBuild(PerforceSCM.java:735)
    2. hudson.plugins.perforce.PerforceSCM.pollChanges(PerforceSCM.java:639)
    2 frames
  5. Hudson
    SequentialExecutionQueue$QueueEntry.run
    1. hudson.scm.SCM.poll(SCM.java:370)
    2. hudson.model.AbstractProject.poll(AbstractProject.java:1157)
    3. hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:330)
    4. hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:359)
    5. hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
    5 frames
  6. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    2. java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    3. java.util.concurrent.FutureTask.run(Unknown Source)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    5. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    6. java.lang.Thread.run(Unknown Source)
    6 frames