Hello Ranchers,
I got problems in running my client jar file and hence the title.
Although I looked through all the previous threads regarding the stub and the client jar file, I am still unable to solve it.
Here's my output when run my client jar.
C:\scjd\dist\client>
java -jar client.jar localhost 1099 db.db
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: suncertify.server.RemoteDataServer_Stu
b (no security manager: RMI class loader disabled)
Exception in
thread "main" java.lang.NullPointerException
at suncertify.client.DataAccess.readData(DataAccess.java:139)
at suncertify.client.DataAccess.<init>(DataAccess.java:82)
at suncertify.client.Client.<init>(Client.java:32)
at suncertify.client.Client.main(Client.java:62)
I did not apply any security manager or codebase.
I have added the main class in the manifest file of the client jar.
Manifest-Version: 1.0
Created-By: Apache
Ant 1.5.1
Built-By: richard yip
Main-Class: suncertify.client.Client
I have three packages.
suncertify.db
suncertift.client
suncertify.server
I generate the stubs and skeletons within the server package and copied the stub to the client package.
For the cient jar, I pack the client and db together. For server jar, I pack the server and db together.
I put the common interface files in db since both server and client package access it.
Just confirm that it didn't even work when I unjared it.
This is my code which I used to access the registry.
private RemoteDataService remoteData;
Registry remoteRegistry = LocateRegistry.getRegistry(host, portNumber);
remoteData = (RemoteDataService)remoteRegistry.lookup(RemoteDataService.SERVICENAME);
RemoteDataService is the remote interface.
I have tested both the client and server together in my coding environment before jarring the packages.
Need help in solving this. Any ideas?
Richard