hi,
i'm using RMIClassLoader.loadClass(u,"helloClient"),
where u is the object of URL(i gave it as URL u=new URL("http://localhost:8080/")) and helloClient is the name of the class located in public_html directory of JavaWebServer2.0, to load the helloClient class located at the server, into the client. While running the file(
java helloLoader) i'm getting the following exceptions:
java.lang.ClassNotFoundException: java.security.AccessControlException: access d
enied (java.net.SocketPermission localhost:8080 connect,resolve)
at java.security.AccessControlContext.checkPermission(Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java:
403)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at sun.rmi.server.LoaderHandler.lookupLoader(Compiled Code)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:274)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:246)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:104)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:77)
at helloLoader.main(helloLoader.java:15)
15th line of helloLoader.java, has a statement like this
Class c=RMIClassLoader.loadClass(u,"helloClient");
and the file contains the following code:
import java.rmi.*;
import java.rmi.server.*;
import java.net.*;
public class helloLoader
{
public static void main(
String []a)
{
System.setSecurityManager(new helloSecurity());
try
{
URL u=new URL("http://localhost:8080/");
Class c=RMIClassLoader.loadClass(u,"helloClient");
c.newInstance();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}//end of class
In the above code helloSecurity is the class which implements the 4 policies of RMISecurityManager.
Now, pls tell me why am I getting these exceptions? Is the problem with JWS2.0 or problem with code.
Please help me to solve this problem,
regds,
Sandeep.