happy
happy

Reputation: 2628

java.lang.ClassNotFoundException in RMI,no security manager RMI class loader disabled

I have created below bat file to run my RMI server

@echo Off

set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\bin\;
set classpath=C:\policy.all;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\log4j-1.2.12.jar;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\log4j-1.2.15.jar;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\log4j.jar;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\log4jProperties.jar;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\bcprov-jdk15-144.jar\bcprov-jdk15-144.jar;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\sevenzipjbinding.zip;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\sevenzipjbinding-AllPlatforms.zip;
set classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\RMI_Server\apache-log4j-1.2.17\log4j-1.2.17.jar;




set classpath=%classpath%;.

java -Djava.security.manager -Djava.security.policy=C:\policy.all

java -Xms512m -Xmx1024m ExecutorServer -Djava.rmi.server.codebase=file:C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/RMI_Server/bin/ -Djava.security.policy=C:\policy.all

pause

I am able to run my RMI server but when RMI tries to connect to RMI server I get following exception

Execption in RMI...java.rmi.UnmarshalException: error unmarshalling return; nest
ed exception is:
        java.lang.ClassNotFoundException: ExecutorInterface (no security manager
: RMI class loader disabled)
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: ExecutorInterface (no security manager
: RMI class loader disabled)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at java.rmi.Naming.lookup(Unknown Source)
        at com.mindcraft.queryExecutor.actionclass.acInsertExecutorDetails.rmiCl
ientCall(acInsertExecutorDetails.java:272)
        at com.mindcraft.queryExecutor.actionclass.acInsertExecutorDetails.execu
te(acInsertExecutorDetails.java:218)

I have give policy file and code base while running.I am not getting what I am missing here. How to add lcass in rmiregistry's path?

Upvotes: 1

Views: 17071

Answers (2)

Shubham Pratap Singh
Shubham Pratap Singh

Reputation: 35

Simple solution is that Add ExecutorInterface.class or its related jar in your client project class path.

Upvotes: 0

user207421
user207421

Reputation: 310893

  1. Setting the CLASSPATH to 10 consecutive values doesn't work. It only takes the last value. You need to set it =%classpath%;. You also need to quote all those directories with spaces in their names.
  2. Putting policy.all on the CLASSPATH is pointless.
  3. java.lang.ClassNotFoundException: ExecutorInterface says exactly what is wrong. That class is not present at the client.

Upvotes: 1

Related Questions