Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMI activation Programm running over my own port (not the stanard port)

843793Jan 20 2005 — edited Mar 6 2006
I`m a newbie on RMI so excuse if my topic causes doubles under topic list but I tried to search my problem and found nothing :(

I followed the tutorial from:
http://java.sun.com/j2se/1.4.2/docs/guide/rmi/activation/activation.1.html

I working with a LinuxOS "Server" and a WinXP Client

using statndard ports of "rmiregistry" and "rmid" the hole works fin !!

Now I wanted to use a port different from 1099 and 1098 (standard ports).

I made the following changes:

rmiregistry 50000 &

rmid -J-Djava.security.policy=myFileSystemPath/policy &

Serversides:
[..]Naming.rebind("rmi://localhost:50000/ActivatableImplementation",mri);
Clientside:
[..]Naming.lookup("rmi://myserver:50000/ActivatableImplementation");
and it still working fin
but rmid is also still working on standard port !!!

if I called rmid as follow
rmid -port 50001 -J-Djava.security.policy=myFileSystemPath/policy &

What codechanges I have to do ???
I couldn`t find this out :(

Using the same code on serverside bring me up this:
Exception in thread "main" java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:
java.rmi.ConnectException: Connection refused to host: 129.103.126.29; nested exception is:
java.net.ConnectException: Connection refused
at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:453)
at de.sbs.bwg.examples.activation.Setup.main(Setup.java:27)
Caused by: java.rmi.ConnectException: Connection refused to host: 129.103.126.29; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:449)
... 1 more
Caused by: java.net.ConnectException: Connection refused
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 java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 7 more


Is there anyone who can explane this behaviour or can tell me the code-changes I need to implement ?
Which methods need this rmid call ????
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2006
Added on Jan 20 2005
12 comments
654 views