wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes HttpsURLConnection Connects Time out on Geronimo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HttpsURLConnection Connects Time out on Geronimo " Watch "HttpsURLConnection Connects Time out on Geronimo " New topic
Author

HttpsURLConnection Connects Time out on Geronimo

Rob Silver
Greenhorn

Joined: Sep 06, 2006
Posts: 2
I have a servlet that makes a secure connection to a remote system to execute a REST message (XML over HTTP). There is no WSDL portion unfortunately ... the remote party made their own design decisions outside of my control.

I am housing my servlet on a Geronimo 1.1 server. For some reason I cannot make the connection to the remote service when it is housed on Geronimo 1.1. When I attempt to make the connection in a stand alone stub application, or deploy the servlet under Tomcat 5.5, the system works properly. It is only Geronimo 1.1 that things fail to function. I am wondering if someone can help shed some light as it has held me up for far too long.

Some code:

The method I use to setup security settings. I have PKIS verificaiton path issues so I use the following code...




Note that H_V refers to the following object.
(Implemented because cert hostname does not match IP used. This is an issue with the remote system rather than my cert so I just need to work with it best I can).





These are 2 helper classes I use for the SSL Factory





Now for the meat and potatoes....
This method is what I call to send a string message (XML format) to the remote system. When I run it on Geronimo the "OutputStreamWriter osw = new OutputStreamWriter(urlc.getOutputStream());" line times out trying to connect and an exception is thrown. Again.. this is ONLY under Geronimo.




Any and all input is appreciated.. I have reviewed forumns and tried various work arounds but nothing seems to work under Geronimo.

Thanks,
Rob
Rob Silver
Greenhorn

Joined: Sep 06, 2006
Posts: 2
So I found a solution to the problem...

I use a Proxy object in the url open connection method which resolves the issue.

The change was from:




to





Originally I was setting the java system proxy property, which seems to work on Tomcat but for whatever reason it doesn't on Geronimo. I have checked that the involved classes are of the same type (java.net.URL and sun.net.www.protocol.https.HttpsURLConnectionImpl) so either its one of the classes used by my objects of these classes, or a system setting I guess that is changed in Geronimo as opposed to Tomcat.
 
 
subject: HttpsURLConnection Connects Time out on Geronimo