Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMI: proxy causes connection timed out

8 views
Skip to first unread message

Christiaan

unread,
Aug 9, 2004, 11:56:03 AM8/9/04
to
Hi all,
I 've been struggling with this problem for quite some days now so I hope
someone can help me! I 've created a simple rmi application and I am having
trouble deploying this with a client who is behind a proxy (which is causing
the problem, other clients dont have the problem). The client gets the
following error:
java.net.ConnectException: Connection timed out: connect
java.rmi.ConnectException: Connection refused to host: x.y.z.k; nested
exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at client.ComputePi.main(ComputePi.java:14)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
Source)
... 7 more

I have set logging on to get more insight into this error:
....
FINE: main: direct socket connection failed:
....
FINE: main: trying with factory:
sun.rmi.transport.proxy.RMIHttpToPortSocketFact
ory@1415de6
9-aug-2004 13:39:31 sun.rmi.transport.proxy.RMIMasterSocketFactory
createSocket
FINE: main: trying with factory:
sun.rmi.transport.proxy.RMIHttpToPortSocketFact
ory@1415de6
9-aug-2004 13:39:31 sun.rmi.transport.proxy.HttpSendSocket <init>
FINER: main: host = x.y.z.k, port = 1099, url = http://x.y.z.k:109
9/
....
FINE: main: failed to get input stream, exception:
java.io.IOException: Server returned HTTP response code: 504 for URL:
http://x.y.z.k:1099/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)

So the direct connections fails because of the proxy, after that,
http-to-port connection fails as well. (504 = Gateway timeout). If I
understand it correclty, the implemenation uses a HttpURLConnection. If I
create my own HttpURLConnection with http://x.y.z.k:1099/, the
httpurlconnection connects and does not give an exception??:
System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "some.proxy.com");
System.setProperty("http.proxyPort", "80");
//not sure if this is necessary
System.setProperty("firewallSet", "true");
System.setProperty("firewallHost", "some.proxy.com");
System.setProperty("firewallPort", "80");
URL url = new URL("http://x.y.z.k:" + rmiport);
System.out.println("Opening HttpURLConnection at " + rmiport);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect(); //does not throw an exception

Can anyone help me with this problem?

kind regards,
Christiaan


Christiaan

unread,
Aug 13, 2004, 10:27:00 AM8/13/04
to
do people use this forum anyway?

"Christiaan" <no...@nospam.com> schreef in bericht
news:41179e1a$1...@newsgroups.borland.com...

Paul Furbacher [TeamB]

unread,
Aug 13, 2004, 12:16:13 PM8/13/04
to
Christiaan wrote:

> do people use this forum anyway?

CORBA-RMI issues may be rather esoteric. So,
traffic in this newsgroup is generally pretty
low.

The only thing I can suggest is that you
do a Groups-Google search on keywords

corba "connection timed out" firewall


Here's one hit which may be relevant:

http://tinyurl.com/4m8v7


--


Paul Furbacher (TeamB)

Save time, search the archives:
http://www.borland.com/newsgroups/ngsearch.html

Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html

Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.

Christiaan

unread,
Aug 17, 2004, 3:01:40 AM8/17/04
to
Thnx for the reply. I already did a lot of searching on the subject, but
didn't find any satisfying solutions. I was under the impression that rmi is
the way to go for distributed computing (we make use of a framework that
only allows rmi for communication). Can you tell me what a more common used
technology is?


"Paul Furbacher [TeamB]" <pfurb...@mac.com> schreef in bericht
news:411ce94d$1...@newsgroups.borland.com...

Paul Furbacher [TeamB]

unread,
Aug 17, 2004, 1:40:43 PM8/17/04
to
Christiaan wrote:

> [...] I was under the impression that rmi is


> the way to go for distributed computing (we make use of a framework that
> only allows rmi for communication). Can you tell me what a more common used
> technology is?
>
> "Paul Furbacher [TeamB]" <pfurb...@mac.com> schreef in bericht
> news:411ce94d$1...@newsgroups.borland.com...
>
>>Christiaan wrote:
>>
>>>do people use this forum anyway?
>>
>>CORBA-RMI issues may be rather esoteric. So,
>>traffic in this newsgroup is generally pretty
>>low.

Ah, I can see how what I wrote could be taken as
saying "not too many people use RMI". Thanks
for catching me up on poor communication skills.
What I guess I tried to say was that the topic itself
is esoteric (compared to say Swing or java.lang issues),
and may not attract a lot of readers, especially among
those who are most skilled at it. That's what I meant.

Sorry that I cannot help you out with the particular
problem. Although I did some limited work with RMI
some four or more years ago, I cannot say that I know
much about it, let alone CORBA. I was hoping that the
one Google hit would do it. Apparently not.

Adrian Pitulac

unread,
Aug 24, 2004, 5:53:49 PM8/24/04
to
It is hard to get real support for RMI. I have also destroyed my nerves on
some problems connected to RMI. Please give me an e-mail with detailed info
about your problem and i'll try to help you solve it.. My e-mail is
john_...@yahoo.com Please mail me because it's an big event when i read
the newsgroup. You can also contact me on Yahoo IM.

Bye
"Christiaan" <no...@nospam.com> wrote in message
news:41179e1a$1...@newsgroups.borland.com...

0 new messages