java.lang.NullPointerException

Jenkins JIRA | Pavel Janoušek | 2 years ago
  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. 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
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    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.NullPointerException

      No message provided

      at hudson.Util.copyStream()
    2. Hudson
      Main.main
      1. hudson.Util.copyStream(Util.java:460)
      2. hudson.Main.remotePost(Main.java:184)
      3. hudson.Main.run(Main.java:73)
      4. hudson.Main.main(Main.java:55)
      4 frames