• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is RMI Callback?

 
M Chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having problems with RMI and firewalls like many people. I believe it may be because the system is using Call back but I am not sure exactly what it is!

I tried the solution http://www.javacoding.net/articles/technical/rmi-firewall.html
but have had no luck.
The RMI methods return a String/String arrays. Does this type of return statement fall under the 'call back' heading I have been reading about? I have read that it is not possible to use a fixed the port when using callback hence my question.

What happens is the client successfully instantiates the remote object locally (by accessing the RMI registry) but cannot run the methods, as it tries to connect through random ports over port 2000.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea of a 'callback' has nothing to do with the return types. Basically, a callback is where the client sends a Remote reference to the server, and the server calls methods on the client's reference whenever it needs to.

Since you're using the custom Socket factory approach, just to make sure, but you remembered to open the ports you specified (and 1099, or whatever your RMI registry is running on) right?

Can you post the error message you are getting?
 
M Chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where 192.168.254.201 is the clientIP.
===================
java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.254.201:3899 accept,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkAccept(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
ssion(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(Unknown Sour
ce)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
=========================
This error occurs whenever a remote method is called on the client. For each successive attempt to connect, it increments the port. So the next attempt would be on port 3900.

Without any firewall, when i grant socket permissions (through the java.policy) on all ports to the client, it works, however I need it to work through a firewall. I have the java.policy set up to allow connections to the client on 1070. The firewall is a physical machine that has ports 1099 and 1070 open.
[ May 12, 2005: Message edited by: M Chan ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you are using the custom socket factory code that you referenced, and that you set the port in the socket factory to match port 1070 in your firewall and security policy? Each time you run your code, do you always get an error on port 3899, or is it a different port each time? If it's a different port each time, your custom socket factory isn't being used.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!