• Post Reply Bookmark Topic Watch Topic
  • New Topic

HeadFirst Java RMI  RSS feed

 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble creating this simple RMI setup illustrated in HeadFirst java. I tried it using Tomcat but then heard that Tomcat isn't an RMI server - how do I set this up?

Thanks!
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You definitely not need Tomcat to use RMI.

Check out the Oracle tutorial https://docs.oracle.com/javase/tutorial/rmi/
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay so I started following that - I got apache up and running and created a test page and packaged up and compiled all the example code

I also created a new user called test and created a public_html file under that user

Then I tried to build the server classes - this is where I came to a roadblock

I put the compute.jar file into both the test/public_html/classes path and the frank/Java/RMI path and then tried to build it using:

javac -cp /home/ann/public_html/classes/compute.jar
engine/ComputeEngine.java


and got:

engine/ComputeEngine.java:7: package compute does not exist
import compute.Compute;
^
engine/ComputeEngine.java:8: package compute does not exist
import compute.Task;
^
engine/ComputeEngine.java:10: cannot find symbol
symbol: class Compute
public class ComputeEngine implements Compute {
^
engine/ComputeEngine.java:16: cannot find symbol
symbol : class Task
location: class engine.ComputeEngine
public <T> T executeTask(Task<T> t) {
^
engine/ComputeEngine.java:26: cannot find symbol
symbol : class Compute
location: class engine.ComputeEngine
Compute engine = new ComputeEngine();
^
engine/ComputeEngine.java:27: cannot find symbol
symbol : class Compute
location: class engine.ComputeEngine
Compute stub =
^
engine/ComputeEngine.java:28: cannot find symbol
symbol : class Compute
location: class engine.ComputeEngine
(Compute) UnicastRemoteObject.exportObject(engine, 0);
^
7 errors


I have tried everything and just don't know what to do. If you need anymore information just ask.

Thanks!

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!