Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rmic and J2SE 6

 
Paul Murphy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody!!

Im currently in the process of the SCJD project and began working on the RMI network server portion of the project. I'm new to RMI, so began with a simple tutorial, found here http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html. I just spent the past 2 hours try to start the RMI server, but continually got the following error.

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException:

The solution in the end was to create a server_stub using RMIC. However in the documentation (URL above) the following statement can be found

"Note: As of the J2SE 5.0 release, stub classes for
remote objects no longer need to be pregenerated using the
rmic stub compiler, unless the remote object needs
to support clients running in pre-5.0 VMs. If your application
needs to support such clients, you will need to generate stub
classes for the remote objects used in the application and deploy
those stub classes for clients to download."

Yet i had to create the stub using rmic. Am i missing something? Should i call it a night.

My java version is

java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

Many thanks in advance
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

The link you have specified is broken, so i could not see the code.
From the stack trace, it looks like the exception is not in starting the server but during an RMI method call. (The exception is an Unmarshal exception which occurs when the arguments/return value is unmarshalled or deserialized)

Will appreciate if you can post the server code.
 
Paul Murphy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Sorry the bad link was my fault. Put a full stop at the end of the URL.

http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html

The code here works, but i needed to create a stub using the rmic tool. Yet the documentation clearly states that this should only be necessary for pre-5.0 VMs. My current build is 1.6.0


Thanks again
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!