java.lang.NumberFormatException: empty String

Stack Overflow | Albin I | 2 months ago
  1. 0

    Calculate -x--y in java

    Stack Overflow | 2 months ago | Albin I
    java.lang.NumberFormatException: empty String
  2. 0

    Upgrading the junit-plugin from 1.11 to 1.12 fails with a parse error. I guess this relates to "PR #35" because the *skipped* (Ignore attr.) test result file's "time" attr. is *empty*. While the originator of the file (NUnit) should store a meaningful default (like -"00:00:00"- "0.0"), its up to the consumer to provide robust parsing, either by ignoring the "skipped" tests at all or by ignoring the empty string. // Jenkins log stacktrace \[16:48:06.879\] ERROR: Step ‘Publish NUnit test result report’ aborted due to exception: \[16:48:06.879\] java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:306) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:175) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:154) \[16:48:06.879\] at hudson.tasks.junit.TestResult.<init>(TestResult.java:126) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:243) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:226) \[16:48:06.879\] at hudson.FilePath.act(FilePath.java:990) \[16:48:06.879\] at hudson.FilePath.act(FilePath.java:968) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:226) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:189) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:152) \[16:48:06.879\] at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) \[16:48:06.879\] at hudson.model.Build$BuildExecution.post2(Build.java:185) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) \[16:48:06.879\] at hudson.model.Run.execute(Run.java:1763) \[16:48:06.879\] at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) \[16:48:06.879\] at hudson.model.ResourceController.execute(ResourceController.java:98) \[16:48:06.879\] at hudson.model.Executor.run(Executor.java:410) \[16:48:06.879\] Caused by: java.lang.NumberFormatException: empty String \[16:48:06.879\] at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) \[16:48:06.879\] at sun.misc.FloatingDecimal.parseFloat(Unknown Source) \[16:48:06.879\] at java.lang.Float.parseFloat(Unknown Source) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:301) \[16:48:06.879\] ... 20 more // UnitTest.result file <?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="Foo.Common.Test.Utils.AccessorTest" skipped="1" tests="1" time=""> <testcase classname="Foo.Common.Test.Utils.AccessorTest" name="InternalStaticMethod_DirectAccess()"> <skipped message="Assembly containing class to access is not the use case."/> </testcase> </testsuite>

    Jenkins JIRA | 8 months ago | André Fügenschuh
    java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml
  3. 0

    I recently upgraded jenkins and all our plugins and some of our builds are failing. After investigation it turns out that we produce some nunit test xml files that have no test results in (we might have set a test to [Ignore] temporarily for example). These used to work, and now do not. Example xml: <?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="RES.Coordinate.Calculation.Test.TurkeyTest" skipped="1" tests="1" time=""> <testcase classname="RES.Coordinate.Calculation.Test.TurkeyTest" name="ED1950_to_WGS84(&quot;T1&quot;,556351,4611739,27.67626007d,41.65371627d)"> <skipped message=""/> </testcase> </testsuite> The output is as follows: Recording NUnit tests results ERROR: Step ‘Publish NUnit test result report’ aborted due to exception: java.io.IOException: Failed to read D:\EX00_WS\temporary-junit-reports\TEST-RES.Coordinate.Calculation.Test.TurkeyTest_2.xml at hudson.tasks.junit.TestResult.parse(TestResult.java:306) at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244) at hudson.tasks.junit.TestResult.parse(TestResult.java:175) at hudson.tasks.junit.TestResult.parse(TestResult.java:154) at hudson.tasks.junit.TestResult.<init>(TestResult.java:126) at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:202) at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:191) at hudson.FilePath.act(FilePath.java:990) at hudson.FilePath.act(FilePath.java:968) at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:191) at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:147) at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:109) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) 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) Caused by: java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at sun.misc.FloatingDecimal.parseFloat(Unknown Source) at java.lang.Float.parseFloat(Unknown Source) at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170) at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144) at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129) at hudson.tasks.junit.TestResult.parse(TestResult.java:301) ... 20 more Build result "FAILURE". Skipping script. Cheers Cedd

    Jenkins JIRA | 7 months ago | cedd burge
    java.io.IOException: Failed to read D:\EX00_WS\temporary-junit-reports\TEST-RES.Coordinate.Calculation.Test.TurkeyTest_2.xml
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [JENKINS-34452] Nunit plugin in raises exception if there are no tests in nunit xml - Jenkins JIRA

    jenkins-ci.org | 3 months ago
    java.io.IOException: Failed to read D:\EX00_WS\temporary-junit-reports\TEST-RES.Coordinate.Calculation.Test.TurkeyTest_2.xml
  6. 0

    Upgrading the junit-plugin from 1.11 to 1.12 fails with a parse error. I guess this relates to "PR #35" because the *skipped* (Ignore attr.) test result file's "time" attr. is *empty*. While the originator of the file (NUnit) should store a meaningful default (like -"00:00:00"- "0.0"), its up to the consumer to provide robust parsing, either by ignoring the "skipped" tests at all or by ignoring the empty string. // Jenkins log stacktrace \[16:48:06.879\] ERROR: Step ‘Publish NUnit test result report’ aborted due to exception: \[16:48:06.879\] java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:306) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:175) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:154) \[16:48:06.879\] at hudson.tasks.junit.TestResult.<init>(TestResult.java:126) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:243) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:226) \[16:48:06.879\] at hudson.FilePath.act(FilePath.java:990) \[16:48:06.879\] at hudson.FilePath.act(FilePath.java:968) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:226) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:189) \[16:48:06.879\] at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:152) \[16:48:06.879\] at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) \[16:48:06.879\] at hudson.model.Build$BuildExecution.post2(Build.java:185) \[16:48:06.879\] at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) \[16:48:06.879\] at hudson.model.Run.execute(Run.java:1763) \[16:48:06.879\] at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) \[16:48:06.879\] at hudson.model.ResourceController.execute(ResourceController.java:98) \[16:48:06.879\] at hudson.model.Executor.run(Executor.java:410) \[16:48:06.879\] Caused by: java.lang.NumberFormatException: empty String \[16:48:06.879\] at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) \[16:48:06.879\] at sun.misc.FloatingDecimal.parseFloat(Unknown Source) \[16:48:06.879\] at java.lang.Float.parseFloat(Unknown Source) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144) \[16:48:06.879\] at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129) \[16:48:06.879\] at hudson.tasks.junit.TestResult.parse(TestResult.java:301) \[16:48:06.879\] ... 20 more // UnitTest.result file <?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="Foo.Common.Test.Utils.AccessorTest" skipped="1" tests="1" time=""> <testcase classname="Foo.Common.Test.Utils.AccessorTest" name="InternalStaticMethod_DirectAccess()"> <skipped message="Assembly containing class to access is not the use case."/> </testcase> </testsuite>

    Jenkins JIRA | 8 months ago | André Fügenschuh
    java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml

  1. paulgureghian 2 times, last 5 months ago
  2. Christopher 1 times, last 7 months ago
  3. tone5992 10 times, last 8 months ago
  4. Larten 1 times, last 8 months ago
6 unregistered visitors
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

    empty String

    at sun.misc.FloatingDecimal.readJavaFormatString()
  2. Java RT
    Float.parseFloat
    1. sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
    2. sun.misc.FloatingDecimal.parseFloat(Unknown Source)
    3. java.lang.Float.parseFloat(Unknown Source)
    3 frames
  3. Unknown
    raknare_Albin_iivari.main
    1. raknare_Albin_iivari.main(raknare_Albin_iivari.java:109)
    1 frame