Hi,
i am trying dynamic stub downloading but getting following error
message when stub gets downloaded..........
------------------------------------------------------------
Exception in
thread "main" java.lang.IllegalAccessError: class server_Stub cannot access its superinterface remoteI
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.inputClassDescriptor(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.inputObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at client.main(client.java:16)
------------------------------------------------------------
I had started rmiregistry after setting no classpath.
My server and client files are in seperate directories.
In server directory
classpath is current directory only)
---------------------
remoteI.class (interface class)
server.class (main server program)
server_Stub.class
server_Skel.class
policy (policy file having all permission set)
---------------------
in client directory
classpath is current directory only)
--------------------------
client.class (client program)
remoteI.class (interface class)
policy (All permissions granted)
--------------------------
---------client.java------------------------
public class client
{
public static void main(
String []s)
{
System.setSecurityManager(new RMISecurityManager());
try
{
remoteI _server=(remoteI)Naming.lookup("rmi://"+"192.168.1.78"+"/"+"Test");
System.out.println(_server.getMessage());
}catch(Exception e)
{
e.printStackTrace();
}
}
}
---------------------------------
Now what is the problem.Why downloaded stub is not able to access interface class?
I have already set all permission in the policy file.
please send reply soon
Thanks in advance....