• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

command line parameter question

 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,
I have a simple question here. ( I use RMI for FBN assignment )
1.in local mode:
the command line is: java MenuMain D:\SCJD\suncertify\db\db.db
I don't the parameter is right for every platform. Whether we should use another form: D:\\SCJD\\suncertify\\db\\db.db
2. in network mode:
A.i start a server to register the remote objet, Naming.rebind("serviceFactory", serviceFactory); I check the JDK docs, they said: the first parameter should be "a URL-formatted name associated with the remote object". Could anyone give me example? Why need a url-formated name?
B. when i start the rmi client, the command line is: java -Djava.rmi.server.codebase=http://kuanfan-server/ MenuMain rmi://hostname/serviceFactory. Then use Naming.lookup(args[0]) to connect to rmi server.
Is that right? I look up the instruction of sun. They said "DNS name of the server". What is their meaning? It's just the RMI server machine's name or the local DNS server's name? I'm really confused.
could anyone give me suggestions? thanks in advanced!
stephen
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, i make a little mistake about B of 2.in network mode
B. when i start the rmi client, the command line is: java -Djava.rmi.server.codebase=http://hostname/ MenuMain rmi://hostname/serviceFactory.
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Could anyone give me the answer? I look up lots of similar topic in the forum but i can't find anyone exactly same as mine.
thanks guys!
stephen
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am answering this because no one else is answering you...
Anyway ..
1)It is better to use the second option with "//" as the path seperator,as you will be accepting the path as a String argument,the compiler might say that a '/' is an illegal argument.Also you can give two command line arguments one for windows and one for non-windows...
2)There is no-need to give a URL formatted path(which includes the server name and port no) as the object can only be bound in the machine where it is created.
3)I am not too sure about this.I think both the names will work.First it will check the local machine name and if that doesn't match it might look up the local DNS server..(I could be wrong here...!!)
Just my 2 cents...
Hope this helps,
Manjunath
[ February 17, 2002: Message edited by: Manjunath Subramanian ]
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Manjunath!
I'll use "//" as the seperator. As for "DNS Name server", i'll try to find the answer.
stephen
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Stephen,
Is dynamic class loading required for
the assignment?.I will be starting the design part of the assignment shortly.I was wondering as to why we need to use dynamic class loading for this project.Your views will be really helpful.
Any tips for me in designing the application?
Thanks a lot
Manjunath
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Manjunath
First of all, the assignment doesn't mention the dynamic downloading.
I apply factory pattern to RMI. I try to use it but i still can't get the second stub.
Many people tell me that for assignment just copy the stubs to the client.
hope helpful!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic