Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException, really strange  RSS feed

 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I�m running the examples from the excelent tutorial at: http://developer.java.sun.com/developer/onlineTraining/rmi/RMI.html
and at the exercise Simple Bank System when I try to run the BankSystemServer it give�s me the error:
java.lang.ClassNotFoundException : BankManagerImpl_Stub.class
the funny thing is that I�ve already passed rmic on the remote classes and BankManagerImpl_stub.class is on the directory as I checked, so I�m relly lost here, I�ve tryied to set the classpath also and still don�t work.
I have the following .class files in the directory:
BankManager.class
Account.class
Client.class
NoCashAvailableException.class
AccountImpl.class
BankManagerImpl.class
BankSystemServer.class
BankUser.class
ClientImpl.class
BankManagerImpl_Stub.class
BankManagerImpl_Skel.class
AccountImpl_Stub.class
AccountImpl_Skel.class
ClientImpl_Stub.class
ClientImpl_Skel.class
Any help will be welcome.
thanks in advance.
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, I solved the problem all I did was to reboot my machine and don�t set the classpath to the directory.
If someone has an explanation for it I�m still trying to understand.
regards.
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just found an explanation for this problem:
http://java.sun.com/j2se/1.4/docs/guide/rmi/faq.html#regpath
 
Gautam Newalkar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's how I fixed the problem.
when you start the rmiregistry program, make sure you explicitly specify the port number:
C:\>rmiregistry 1099
I had the same problem as you and my code now works.
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting your solution Marcos. Its really helpful for the next person seraching for a solution to a problem like yours. I wish more people would post their solutions when they get things working.
Chris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!