• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

nullpointer at SSLSocketFactory.createSocket(SSLSocketFactory.java:362)

 
Greenhorn
Posts: 1
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attempting to make a HTTPS POST call from my Websphere application. Locally on my machine the below code works but when I move it up to the development environment it gives a null pointer exception on the below line.

URL url = null;
HttpsURLConnection conn = null;
thirdpartyComponentFacade.setErrorMessage( null );

try {

url = new URL(enrollmentSSOURL);

conn = (HttpsURLConnection)url.openConnection();

conn.setDoInput (true);
conn.setDoOutput (true);
conn.setUseCaches (false);
conn.setRequestMethod("POST");


conn.setConnectTimeout(Integer.parseInt(connectTimeout));
conn.setReadTimeout(Integer.parseInt(readTimeout));

System.out.println("Connect: " + conn.toString());

DataOutputStream output = new DataOutputStream(conn.getOutputStream()); --> NullPointer:

stacktrace:

[2/18/13 15:35:05:348 CST] 00000027 SystemErr R java.lang.NullPointerException
[2/18/13 15:35:05:349 CST] 00000027 SystemErr R at com.ibm.websphere.ssl.protocol.SSLSocketFactory.createSocket(SSLSocketFactory.java:362)
[2/18/13 15:35:05:349 CST] 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.b.afterConnect(b.java:39)
[2/18/13 15:35:05:349 CST] 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.c.connect(c.java:70)
[2/18/13 15:35:05:350 CST] 00000027 SystemErr R at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1040)
[2/18/13 15:35:05:350 CST] 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.a.getOutputStream(a.java:51)
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ever resolve this? Getting the same...

Thanks.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any solution?? I am facing the same problem too........
Runs fine in localinstance and throws nullpointerexception in live instance...
 
Ranch Hand
Posts: 98
Oracle Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There could be multiple scenarios where you can experience such NullPointerException.

Could you please paste the complete error stack trace here.

Few of the common SSL issues are listed below.

http://weblogic-wonders.com/weblogic/2010/01/28/troubleshooting-ssl-issues/

Regards,
Anandraj
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic