cant get rmi to work
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   hogehogetjk_hogehogetjk
Posted On:   Saturday, March 8, 2003 07:57 PM

I am using Teach yourself java2 in 21days 3rd edition local machine name : "Prometheus" original classpath--> .;c:/JAVAFILES; c:/javasdk1.4.1/lib/jar.tools 1 I have changed the "Default" to "Prometheus"on listing 16.5 2 created subdirectories to map the package structure as follows: JAVAFILES/com/prefect/pi 3 Piremote.class, Pi.class, OutputPi.class, Pi_Skel.class, Pi_Stub.class and policy.txt are saved in the above directory. 4 %set CLASSPATH= in order to disable the classpath. 5 %start rmiregistry 1010 6 C:JAVAFILES>java -Djava.rmi.server.codebase=c:/JAVAFILES/com/p   More>>

I am using Teach yourself java2 in 21days 3rd edition


local machine name : "Prometheus"

original classpath--> .;c:/JAVAFILES;
c:/javasdk1.4.1/lib/jar.tools


1 I have changed the "Default" to "Prometheus"on listing 16.5


2 created subdirectories to map the package structure as follows:
JAVAFILES/com/prefect/pi


3 Piremote.class, Pi.class, OutputPi.class, Pi_Skel.class, Pi_Stub.class and policy.txt are
saved in the above directory.


4 %set CLASSPATH= in order to disable the classpath.


5 %start rmiregistry 1010


6 C:JAVAFILES>java -Djava.rmi.server.codebase=c:/JAVAFILES/com/prefect/pi/ -Djava.security.policy=policy.txt com.prefect.pi.Pi


7 Error -- java.security.AccessControlException: access denied (java.net.SocketPermission Prometheus resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission Prometheus resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
at java.net.InetAddress.getAllByName0(InetAddress.java:937)
at java.net.InetAddress.getAllByName0(InetAddress.java:918)
at java.net.InetAddress.getAllByName(InetAddress.java:912)
at java.net.InetAddress.getByName(InetAddress.java:832)
at java.net.InetSocketAddress. (InetSocketAddress.java:109)
at java.net.Socket. (Socket.java:119)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Naming.java:111)
at com.prefect.pi.Pi.main(Pi.java:23)


where did i go wrong?

   <<Less

Re: cant get rmi to work

Posted By:   Edward_Harned  
Posted On:   Sunday, March 9, 2003 08:36 AM

Where did you go wrong?


First by not using formatting in your post so I get eye strain just looking at it


Second, you need a policy file for security. Generally, one that gives all permissions is best for testing.



grant {

permission java.security.AllPermission "", "";

};



Addionally, you usually don't need to specify a port for the rmi registry.

About | Sitemap | Contact