Solved

rmi: access denied (java.net.SocketPermission

Posted on 2002-03-15
3
2,381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

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

Accepted Solution

by:
maggari earned 15 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

623 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