Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with starting server

 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When starting the server, if I specify the codebase with an absolute path, it works fine. But if I specify the codebase with relative path, I got such an exception:

Can someone tell me why?
Thanks!
--Cathy
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The consensus in this group is that you don't need to implement the dynamic downloading of stubs and therefore you do not need codebase. To accomplish dynamic downloading of code, you need to either assume that the grader has a web server running and serving the stubs, or to write your own web server. Both propositions are very risky.
Eugene.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, just remove the codebase and any SecurityManagers that you have, and you will be fine.
Mark
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
I agree with you and Eugene, and have recently removed the codebase parameter in favor of just directly including the _stub files in the client.jar. This is meant to reduce risk.
You also mention removing security managers. Does doing so remove the need for policy files? How can the removal of security managers and policy files be justified in the design choices?
[ March 25, 2003: Message edited by: Erick Reid ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, you won't need a policy file.
Justification, no dynamic downloading, so no need for rogue clients. If the client is going to access the server and doesn't have the stub already then it won't work. So therefore the client has to have the stubs, and therefore is not a rogue client.
In theory you could have a good hacker take the jar file, extract the stubs, create their own nasty classes, and jar them with the stubs and run amok, but this is just the SCJD Assignment.
Mark
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys!
I did not have codebase, nor security manager at first until my friend's assignment was automatically failed because cannot find the stub!
Now, I just want you to help me confirm a couple of things:
I do not have to have codebase or security manager, but HAVE TO MANNUALLY copy the stub to the directory with all client classes and make the jar file.
Thanks a lot!
--Cathy
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I did not have codebase, nor security manager at first until my friend's assignment was automatically failed because cannot find the stub!

Your friend forgot to consult with us in this forum before the submission. Just package your stub in your client.jar, and you will be fine.
Eugene.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cathy,
Mark et al can correct if I misstate this, but yes, you are correct. The codebase, security managers and policy files are meant to facilitate dynamic downloading of _stub files from server to client. There is no need for dynamic downloading if the _stubs are already available to the client because you explicitly included them in the client jar.
Mark's previous post gives sound justification. I like the approach because it really cuts down on the number of moving parts (possible points of failure)
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Erick Reid:
Cathy,
Mark et al can correct if I misstate this, but yes, you are correct. The codebase, security managers and policy files are meant to facilitate dynamic downloading of _stub files from server to client. There is no need for dynamic downloading if the _stubs are already available to the client because you explicitly included them in the client jar.
Mark's previous post gives sound justification. I like the approach because it really cuts down on the number of moving parts (possible points of failure)

Thanks, Erick! I was actually trying it just now, but failed (somewhere):
I have 3 packages: db, server, client. I have a class called DataAgent.java under db which is the servant class, and thus DataAgent_Skel.class adn DataAgent_Stub.class are under db directory. I made two JAR files: server.jar and client.jar. The former includes the classes under "server" and "db" directory and the latter includes the classes under "client" and "db" directory. To start the server, I used

and got

Help, please? Thanks!
--Cathy
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My head is not inside your design, so it is harder to comment, but some things came to mind when reading your post:
- why does the server need a stub for something? the client is the guy who needs to stream requests to/from the server.
- you probably don't need skel files.
- is your dataagent stub indeed physically included in the server jar? dump the contents and see if it is indeed present in the jar.
[ March 25, 2003: Message edited by: Erick Reid ]
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Erick Reid:
My head is not inside your design, so it is harder to comment, but some things came to mind when reading your post:

I am sorry, but it is really hard to describe the design in a couple of sentences.

- why does the server need a stub for something? the client is the guy who needs to stream requests to/from the server.

I do not understand this either, but it just gives me this exception, and it is running ok if I start with something like this:



- you probably don't need skel files.
- is your dataagent stub indeed physically included in the server jar? dump the contents and see if it is indeed present in the jar.

Yes, it is physically included in server.jar.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cathy,
I'm speculating, but the difference in your working commandline items and the items that do not work seems to revolve around the classpath.
A good classpath would let the server find its desired stub (leaving the question of why the server wants a stub unanswered).
In a nutshell, your classpath is suspect. Try a commandline with no codebase specified, and an absolute classpath.
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Erick Reid:
Cathy,
Try a commandline with no codebase specified, and an absolute classpath.

It does not work.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dunno what else to offer. Not knowing your design and wondering about why your server wants a stub makes it difficult to suggest alternatives. Check other threads in the SCJD forum for "codebase". It's a popular topic. Hopefully one will come to light that applies to your setup.
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Erick Reid:
Dunno what else to offer. Not knowing your design and wondering about why your server wants a stub makes it difficult to suggest alternatives. Check other threads in the SCJD forum for "codebase". It's a popular topic. Hopefully one will come to light that applies to your setup.

Thanks, Erick! I will continue searching for it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic