• Post Reply Bookmark Topic Watch Topic
  • New Topic

help, RMI

 
Hellen Han
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I just start to learn some RMI. I have problems when I run the sample code there.
This is from http://www.execpc.com/~gopalan/java/java_rmi.html
I just follow the instruction from the above site, and this is basic information.
Server site: StockMarket(interface), StockMarketImpl(class),StockMarketServer.java(class), policy.all(security)
What I am doing is try to run the code in local machine.
There is one sentence in StockMarketImpl.java:
Naming.rebind(name, this);
There is anothe sentence in StockMarketServer.java:
StockMarketServer myObject = new StockMarketServer("NASDAQ")
When I run code everything looked fine, but when I finally do this:
java -Djava.security.policy=policy.all StockMarketServer
Just nothing come out, machine running all the time. I do not know what's wrong here. How to set up the bind, rebind information if I try to run in the standlone machine???
If any one of you can give me some info, apprecaite that.
Thanks advance.
 
a ali
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hellen Han:
hi, I just start to learn some RMI. I have problems when I run the sample code there.
This is from http://www.execpc.com/~gopalan/java/java_rmi.html
I just follow the instruction from the above site, and this is basic information.
Server site: StockMarket(interface), StockMarketImpl(class),StockMarketServer.java(class), policy.all(security)
What I am doing is try to run the code in local machine.
There is one sentence in StockMarketImpl.java:
Naming.rebind(name, this);
There is anothe sentence in StockMarketServer.java:
StockMarketServer myObject = new StockMarketServer("NASDAQ")
When I run code everything looked fine, but when I finally do this:
java -Djava.security.policy=policy.all StockMarketServer
Just nothing come out, machine running all the time. I do not know what's wrong here. How to set up the bind, rebind information if I try to run in the standlone machine???
If any one of you can give me some info, apprecaite that.
Thanks advance.

 
a ali
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried the exercise on my Windows NT box and it worked for me. I used the following commands at the MSDos prompt:
My code resides in D:\temp\MyProjects\StockRMI directory.
For Server :
D:\temp\MyProjects\StockRMI>c:\jdk1.2.2\bin\java -Djava.rmi.server.codebase="file:/d:\temp\MyProjects\StockRMI/" -Djava.security.policy=policy.all StockMarketServer
For Client :
D:\temp\MyProjects\StockRMI>c:\jdk1.2.2\bin\java -Djava.security.policy=policy.all StockMarketClient
Your machine should at least be running TCP/IP for it to work.
Hope this helps.
Originally posted by Hellen Han:
hi, I just start to learn some RMI. I have problems when I run the sample code there.
This is from http://www.execpc.com/~gopalan/java/java_rmi.html
I just follow the instruction from the above site, and this is basic information.
Server site: StockMarket(interface), StockMarketImpl(class),StockMarketServer.java(class), policy.all(security)
What I am doing is try to run the code in local machine.
There is one sentence in StockMarketImpl.java:
Naming.rebind(name, this);
There is anothe sentence in StockMarketServer.java:
StockMarketServer myObject = new StockMarketServer("NASDAQ")
When I run code everything looked fine, but when I finally do this:
java -Djava.security.policy=policy.all StockMarketServer
Just nothing come out, machine running all the time. I do not know what's wrong here. How to set up the bind, rebind information if I try to run in the standlone machine???
If any one of you can give me some info, apprecaite that.
Thanks advance.

 
Hellen Han
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi a ali:
That help lots, and now I can run it.
Thanks again.
 
Hellen Han
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi a ali:
That help lots, and now I can run it.
Thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!