This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with ORACLE port when using with RMI  RSS feed

 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 202.46.209.44: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.

Its really urgent.thank you for your time.

Thanks
Raj
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!