Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

VAJ RMI classpath

 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I follow instructions given by "Effective Use of Visual Age for Java" to create an RMI application. As said, I have to add project path to the workspace classpath so that the server program (implements rmi) can find the stub class. I did it but VAJ still throws exception, complaining xxx_Stub class not found. Does anyone out there use VAJ rmi? Thanks! KH
 
Bredan Tomong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to compute or select the projcet you need for the excutable class.
Right click the excutable class then click "classpath".
 
khyau
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added the project into classpath. My classes are organised as follows.
----------------------------------------------
project: Effective VisualAge for Java
package: effectivevaj.adv.dist.traditionalrmi
Interface: Counter
classes: CounterClient (excutable)
CounterImpl (ex.. )
CounterImpl_Stub
-----------------------------------------------

Selecting CounterImpl -> Property -> classpath
the classpath settings are as follows.
-----------------------------------------------
"checked" project path: Effective VisualAge for Java
"unchecked" additional directory
complete classpath:
.;
c:\program files\ibm\visualage for java\ide\project_resources\Effective VisualAge for Java;
---------------------------------------------------------
Running CounterImpl results in:
----------------------------------
[deleted]
java.lang.ClassNotFoundException: effectivevaj.adv.dist.traditionalrmi.CounterImpl_Stub
[deleted]
---------------------------------------------------
Can you help? KH.
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer myself. I have to invoke rmi registry by coding the following line in the main program of CounterImpl.java
LocateRegistry.createRegistry(1099);
Previously, I invoke registry from
Windows->Options->rmi registry
and then click "restart rmi registry".
Don't understand why the above procedures do not work (suggested by the book).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic