Win a copy of Securing DevOps this week in the Security forum!

NJ Ban

Greenhorn
+ Follow
since Oct 17, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by NJ Ban

Mike, I tried but it doesn't make any difference. I still get the same error. Is there any known software conflicts?
14 years ago
I was running Sun's sample RMI code and it still gives me a problem. I looked up many helps on-line and I think I did everything correctly but I am still facing problem. Please help.
1. First everthing is under D:\TIEJ1.1\Code\rmiex and the service name is given as following in engine\ComputeEngine.java
String name = "//localhost/Compute";
2. Then compiled this code.
set classpath=D:\TIEJ1.1\Code\rmiex
javac engine\ComputeEngine.java
rmic -d . engine.ComputeEngine
3. So there are three classes in engine directory, ComputeEngine.class, ComputeEngine_Stub.class and ComputeEngine_Skel.class.
4. java2.policy file is set like this in D:\TIEJ1.1\Code\rmiex.
grant codebase "file://D:/TIEJ1.1/Code/rmiex/*" {
permission java.net.SocketPermission "*:1024-",
"connect,accept";
permission java.net.SocketPermission "*:80",
"connect";
};
5. Run the server code.
set classpath=D:\TIEJ1.1\Code\rmiex
java -Djava.rmi.server.codebase=file// :/TIEJ1.1/Code/rmiex
-Djava.rmi.server.hostname=localhost
-Djava.security.policy=".\java2.policy"
engine.ComputeEngine
6. Now i get SocketPermission error.
ComputeEngine exception: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 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.connect(Unknown Source)
at java.net.Socket.connect(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.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at engine.ComputeEngine.main(ComputeEngine.java:27)
Most of the people who saw the same error seemed to solve the problem by fixing policy file but I cannot do that. I don't know why. The only thing that I could think of was Norton firewall. So I tried the same thing turning on and off Norton but it doesn't make any difference. Does anyone have a clue? Please help me on this.
14 years ago