• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unable to run client

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
In the client.jar you have to have the stub files in a server package. Dont put them in the client package!
 
Mike Skinner
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To simplify:
client.jar
/client - all client files
/db - all db files
/server - the stub and interfaces you need
Hope this helps!
 
Richard Yip
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike,
Thanks! It works! What a killer. I was stuck with this for the last three days. And it turn out to be something so simple.
Now I can concentrate on finishing up. Need to do some more testing before cleaning up the code and writing design docs for the upload by next week.
Intend to take the exams end of next week.
Richard
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic