java.lang.NullPointerException

Jenkins JIRA | Mirko Friedenhagen | 9 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

    I've tried to use [Monitoring External Jobs plug-in|https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs] as described on Wiki. Plug-in works correctly, but I'm not satisfied with error handling - user isn't navigated properly what goes wrong. Example: Jenkins instance needs a proper credentials provided by client, otherwise request is rejected... Well, through programatical way I've got an expected result: {code} curl -X POST -d '<run><log encoding="hexBinary">4142430A</log><result>0</result><duration>2000</duration></run>' https://<_hostname_>/hudson/job/<_job_>/postBuildResult <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Authorization Required</title> </head><body> <h1>Authorization Required</h1> . . {code} The same via Jenkins core produces a NPE: {code} export JENKINS_HOME="https://<_hostname_>/hudson/" java -Djavax.net.ssl.trustStore=my.store -jar jenkins-core-1.580.3-3.5febb286.jar <_job_> echo ABC ABC java.lang.NullPointerException at hudson.Util.copyStream(Util.java:460) at hudson.Main.remotePost(Main.java:184) at hudson.Main.run(Main.java:73) at hudson.Main.main(Main.java:55) {code} Why isn't the second way handled and correctly reported to the user? In addition my Jenkins instance is a bit slow (let say, Jenkins spends approx. 30s in each request/response cycle), I've got quite often an SocketTimeoutException for the same request on client side (as described above in second example with fixed JENKINS_HOME content): {code} java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:152) at java.net.SocketInputStream.read(SocketInputStream.java:122) at sun.security.ssl.InputRecord.readFully(InputRecord.java:442) at sun.security.ssl.InputRecord.read(InputRecord.java:480) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927) at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884) at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) at hudson.Main.remotePost(Main.java:183) at hudson.Main.run(Main.java:73) at hudson.Main.main(Main.java:55) {code} *BUT* the output is correctly saved on Jenkins side into the run though...

    Jenkins JIRA | 2 years ago | Pavel Janoušek
    java.lang.NullPointerException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    I've tried to use [Monitoring External Jobs plug-in|https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs] as described on Wiki. Plug-in works correctly, but I'm not satisfied with error handling - user isn't navigated properly what goes wrong. Example: Jenkins instance needs a proper credentials provided by client, otherwise request is rejected... Well, through programatical way I've got an expected result: {code} curl -X POST -d '<run><log encoding="hexBinary">4142430A</log><result>0</result><duration>2000</duration></run>' https://<_hostname_>/hudson/job/<_job_>/postBuildResult <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Authorization Required</title> </head><body> <h1>Authorization Required</h1> . . {code} The same via Jenkins core produces a NPE: {code} export JENKINS_HOME="https://<_hostname_>/hudson/" java -Djavax.net.ssl.trustStore=my.store -jar jenkins-core-1.580.3-3.5febb286.jar <_job_> echo ABC ABC java.lang.NullPointerException at hudson.Util.copyStream(Util.java:460) at hudson.Main.remotePost(Main.java:184) at hudson.Main.run(Main.java:73) at hudson.Main.main(Main.java:55) {code} Why isn't the second way handled and correctly reported to the user? In addition my Jenkins instance is a bit slow (let say, Jenkins spends approx. 30s in each request/response cycle), I've got quite often an SocketTimeoutException for the same request on client side (as described above in second example with fixed JENKINS_HOME content): {code} java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:152) at java.net.SocketInputStream.read(SocketInputStream.java:122) at sun.security.ssl.InputRecord.readFully(InputRecord.java:442) at sun.security.ssl.InputRecord.read(InputRecord.java:480) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927) at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884) at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) at hudson.Main.remotePost(Main.java:183) at hudson.Main.run(Main.java:73) at hudson.Main.main(Main.java:55) {code} *BUT* the output is correctly saved on Jenkins side into the run though...

    Jenkins JIRA | 2 years ago | Pavel Janoušek
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at hudson.Proc$LocalProc.environment()
    2. Hudson
      Main.main
      1. hudson.Proc$LocalProc.environment(Proc.java:88)
      2. hudson.Proc$LocalProc.<init>(Proc.java:80)
      3. hudson.Proc$LocalProc.<init>(Proc.java:76)
      4. hudson.Main.remotePost(Main.java:93)
      5. hudson.Main.run(Main.java:40)
      6. hudson.Main.main(Main.java:26)
      6 frames