The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

error in Naming.bind of basis server application

What is going wrong here concerning the "bindings"
Learning server stuff and testing some basic applications from the Corejava II book.
Here is the error code when "Naming.bind" two strings called toaster and microwave:
ProductImpl p1 = new ProductImpl("Blackwell Toaster");
Naming.bind("toaster", p1);
(see the productserver class of the liste code):

The ClassNotFoundException is getting thrown because of RMI registry has its own classpath. It doesn't matter that the class containing the InitialContext has the custom objects on its classpath - The RMI registry must be initialised such that the custom objects are on its classpath as well.

To do this set the classpath environment value on the comman line prior to starting rmiregistry. If this classpath contains the custom object's class, the ClassNotFoundException is not thrown, and subsequently ServerException and `CommunicationException' are avoided.

--- Update ---

Keep getting this error which says: ClassNotFoundException: serverstuff.Product
While that file is present at the serverstuff!
The file is actually a interface..... might that be the problem... I don't think so?

Re: error in Naming.bind of basis server application

You see gimbal until now I have been working, without exception, in the Netbeans environment (very cozy).
I had no command line experience at all! Working with netbeans you run very little into flags
classpath etc because Netbeans does it all for you. Until now that was perfect since I concentrated fully onto the java programming language which was already hard enough to learn.
But from learning DB I was forced to look into doing java from the command line which turned out to be
a real disaster because I had no idea how to do things. So I looked into Unix.
You see most programming books do not go a lot into flags classpath etc. they tend to focus on the java grammar only!
Since I do not have a computer science education I am picking up things in a unconventional way, but I am gone make it (eventually).