Hi all,
I am running JBOSS 4.0.1 on Windows. I have a client code within Jboss that 
connects to the same jboss server URL (this is part of CAS authentication).
All is well when Jboss starts up initially. But if I leave my Jboss server 
running overnight and try accessing it after a period of inactivity, I get a 
connection refused exception during socket connect. The server responds with 
the same URL from the browser window. Also if I run a test program that 
connects to jboss using the same URL it  is successful. However, after a period 
of inactivity a URL connection from within a client code in the same jboss 
returns an error. My code snippet and  exception log are given below.

I really appretiate your help on this ! Thanks !!

/************* CODE ***************/
      URL u = new URL(url);
      if (!u.getProtocol().equals("https"))
        throw new IOException("only 'https' URLs are valid for this method");
      URLConnection uc = u.openConnection();
      uc.setRequestProperty("Connection", "close");
      r = new BufferedReader(new InputStreamReader(uc.getInputStream()));

-------> The getInputStream() is from where the exception is thrown !!!

/*************** EXCEPTION LOGS *************/
java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:452)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(DashoA6275)
        at 
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA6275)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
        at sun.net.www.protocol.https.HttpsClient.(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at 
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(DashoA6275)
        at 
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:617)
        at 
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA6275)
        at edu.yale.its.tp.cas.util.SecureURL.retrieve(Unknown Source)


Thanks,
K

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3874929#3874929

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3874929


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to