java SocketTimeoutException running under WAS

Hi,

I'm getting the following error whilst trying to create a secured socket connection whilst running my application in Websphere App Server. (I don't get this error if I run on Tomcat!)

java.net.SocketTimeoutException: connect timed out
      at java.lang.Throwable.<init>(Throwable.java:195)
      at java.lang.Exception.<init>(Exception.java:41)
      at java.io.IOException.<init>(IOException.java:40)
      at java.net.SocketTimeoutException.<init>(SocketTimeoutException.java:24)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:488)
      at com.ibm.jsse2.by.connect(by.java:82)
      at com.ibm.jsse2.by.<init>(by.java:22)
      at com.ibm.jsse2.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:8)
      at com.ibm.net.ssl.www.protocol.https.b.b(Unknown Source)
      at com.ibm.net.ssl.www.protocol.http.ca.a(Unknown Source)
      at com.ibm.net.ssl.www.protocol.http.ca.p(Unknown Source)
      at com.ibm.net.ssl.www.protocol.https.b.<init>(Unknown Source)
      at com.ibm.net.ssl.www.protocol.https.b.a(Unknown Source)
      at com.ibm.net.ssl.www.protocol.https.q.c(Unknown Source)
      at com.ibm.net.ssl.www.protocol.https.q.connect(Unknown Source)
      at com.ibm.net.ssl.www.protocol.http.ch.getOutputStream(Unknown Source)
      at com.ibm.net.ssl.www.protocol.https.t.getOutputStream(Unknown Source)

Does anyone have any thoughts as to why I might be having this problem on WAS?

Cheers.
Steve

HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/xml;charset=utf-8");
try {
      	conn.connect();
} catch (Exception e) {
       	e.printStackTrace();
}

Open in new window

stevebeechAsked:
Who is Participating?
 
BigRatConnect With a Mentor Commented:
So it's a setup problem in WebSphere. This could either be a firewall/proxy due to the new environment, port 9443 being blocked on the WebSphere machine (try doing a telnet from that machine), or the connection time out period is too small. There is a ConnectionIOTimeOut parameter somewhere, but it's a long time since I was on that platform :(
0
 
BigRatCommented:
What is the URL? Is the port chosen correctly?
0
 
stevebeechAuthor Commented:
I think so:

The command: System.out.println("HttpsURLConnection: "+conn.toString());
              
gives:

HttpsURLConnection: com.ibm.net.ssl.www.protocol.https.r:https://myserver.net:9443/myapp

And it works just fine if I run the app under Tomcat4.1

Cheers, Steve
0
 
stevebeechAuthor Commented:
Thanks BigRat.

Connection appears to have been timing out.

Cheers.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.