Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

rmi: access denied (java.net.SocketPermission

Posted on 2002-03-15
3
Medium Priority
?
2,436 Views
Last Modified: 2012-06-22
I met a rmi access denied exception. server works well, just that when client try to connect to server, we got this problem. exception as follows:
access denied (java.net.SocketPermission 155.69.149.78:10000 connect,resolve)

java.security.AccessControlException: access denied (java.net.SocketPermission 155.69.149.78:10000 connect,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.checkConnect(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)

     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 MathExplorer1$panelPlot.paint(MathExplorer1.java:343)

     at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)

     at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)

     at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)

     at java.awt.Container.paint(Unknown Source)

     at sun.awt.RepaintArea.paint(Unknown Source)

     at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)

     at java.awt.Component.dispatchEventImpl(Unknown Source)

     at java.awt.Container.dispatchEventImpl(Unknown Source)

     at java.awt.Component.dispatchEvent(Unknown Source)

     at java.awt.EventQueue.dispatchEvent(Unknown Source)

     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

     at java.awt.EventDispatchThread.run(Unknown Source)
0
Comment
Question by:gordon_guan
3 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 6867549
Are you using applet?
0
 

Accepted Solution

by:
maggari earned 30 total points
ID: 6867774
1. Create a new security policy file. See your JDK docs or the links referenced from the Sun RMI tutorial for more information on this.

Sun RMI tutorial
http://java.sun.com/products/jdk/1.3/docs/guide/rmi/getstart.doc.html

2. When you run the client or the server, pass the location of your new security policy file in as an argument. This allows you to run under a new policy without having to modify your system policy files. Below is a .policy file that grants all permissions to everybody. DO NOT install this policy file in a production system. However, you can use it in trivial testing. You can then run the server with the command line
java -Djava.security.policy=<policy_filepath> myRMIServer
or the client with
java -Djava.security.policy==<policy_filepath> myRMIClient 127.0.0.1

0
 

Author Comment

by:gordon_guan
ID: 6868015
well, I have solved(hope so) it myself, I just don't use the bat file to run the RMI server program and just run the rmiregistry and java command in two different windows and then it does give me no exception. But haven't tested with client program, so not sure whether can work with client correctly or not.
But any way, I think maggri does put in effort, so thanks a lot
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question