Hi, WE are trying to invoke an application from ORACLE 9i using RMI we get an exception as
ERROR: java.security.AccessControlException: the Permission
(java.net.SocketPermission 18.104.22.168:38766 connect,resolve) has not been
granted to WEBX
The port 38766 is not being used by our application nor the RMI.RMI is using the port 1099. once permission is granted to this 38766 port,the application is working fine. The same application,again if invoked some time later,it again comes up with a different Port and again throws the exception.
Could any one please help me out with this? why is that the oracle is randomly coming up with ports?? IS it some firewall problem? or is it that oracle is creating random ports by itself as a security measure? if so how to overcome this port problem.
Actually, port 38766 *is* being used by your application, and specifically the RMI portion. But I guess you gathered that already... the only question is why.
Port 1099 is only the port used by the RMI *Naming Server*. Your RMI server is assigned a different port to listen on.
In the default RMI implementation the port assigned to your server is basically a random port above 1024 which is available. You can get around this by either specifying a port number in the super() constructor in your server's constructor if you extend UnicastRemoteObject. if you don't extend UnicastRemoteObject and use the UnicastRemoteObject.export() method, use the one that specifies a port. Or you can build your own RmiSocketFactory and handle port assignment however you see fit - always assign specific ports to specific apps, use your own range of ports, etc.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.