Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java_server thread: Problems with RMI example Ch 2 in Java Server Prog J2EE


Message #1 by "Travis Robertson" <techcon3000@y...> on Sun, 11 Feb 2001 23:30:43
Hi, have a look at the reply I sent to Manish's query on a similar problem
(copied in below). It lists the steps necessary to compile and run this
example. (sorry about the delay in answering guys). My guess is that you
either have an old rmi compiler installed or that you may not have used the
correct command line arguments in your compilation but have a look at how I
compiled the code.

chanoch

Thankyou Manish for the html page you sent me, it's fine.

I couldnt reproduce the error that you have been getting but I have written
the list of things that you have to do to make this example work since they
are not included in the book per say. Here they are (I've written them so
that they might help other people besides youself in case they get stuck
too):

Supposing that you are using the code in the download I first added the
relevant context in my tomcat installation this meant adding the lines:

 <Context path="/Callbacks"
      docBase="c:/ProJavaServer/Chapter02/Callbacks">
    </Context>

in the server.xml file for tomcat. That means that if I start tomcat and
type http://localhost:8080/Callbacks I get index.html loading. OK.

Now we must compile the code. First I compiled RegisterIt.java with the
line:

    javac -classpath . RegisterIt.java

Now I use rmic to compile the applet and server

    rmic -v1.2 CallbackApplet
    rmic -v1.2 HelloServer

I opened a new window in the /Callbacks directory and started the rmi
registry:

    rmiregistry -J-Djava.security.policy=Registerit.policy

I opened another new window in the /Callbacks directory and type the
following:

java RegisterIt

that should have everything under control. Its worth restarting tomcat now
if it is already running just to make sure. If its not, now is the time to
do so. The URL in the book should now come up and run the applet correctly.
Just to refresh your memory its

appletviewer -J-Djava.security.policy=registerit.policy
http://localhost:8080/Callbacks/Applet.html

try this out yourself, if it does not work then write back and we'll see
what happens. If you need to write back please include the list of files
that are in the callback directory please:

chanoch

-----Original Message-----
From: Travis Robertson [mailto:techcon3000@y...]
Sent: 11 February 2001 23:31
To: Java Server
Subject: Problems with RMI example Ch 2 in Java Server Prog J2EE


I am having trouble getting the first example to run in Chapter 2 (pp. 45-
49).  I created all of the files and successfully compiled the 
HelloInterface file.  When I go to compile the HelloServer and HelloClient
 Files, I receive an error telling me that it doesn't recognize the
HelloInterface class.  I have the jdk1.3 folders on my C drive and the 
java files stored on another partition.  I have tried compiling the java 
files (HelloServer and HelloClient) while they are in a different folder 
as the HelloInterface and while they are in the same folder.  Does anybody 
know why I receive a compile error telling me that it doesn't recognize the
HelloInterface class?


Thanks in advance,
Travis


  Return to Index