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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
BigRatCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stevebeechAuthor Commented:
Thanks BigRat.

Connection appears to have been timing out.

Cheers.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.