29 мая 2010 г.

Java RMI HelloWorld

Problem
I catch exception during start server:
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException


Solve
I know two ways:
1. add jar of server project or folder, contains class folders of classes to CLASSPATH environment variable.
2. create script to set CLASSPATH and run rmiservece

example of script:

set CLASSPATH="%CLASSPATH%;c:\Users\...\NetBeansProjects\RMIServer\build\classes\"
call "C:\Program Files\Java\jdk1.6.0_20\jre\bin\rmiregistry.exe"

Комментариев нет:

Отправить комментарий