• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stupid deployment question - Again!

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I've run my RMI server inside my ide, I've had to set a path which told it where to look for my stubs. From the command line, how do I tell the registry where to look for the stubs when my stub is inside a jar file? I can't find any documentation for rmiregistry which indicates it can take any argument except port number.
Thanks,
Kirk Maze
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Security manager needed?
RMI tutorial
[ October 19, 2002: Message edited by: Thomas Fly ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thomas has the right links there.
Basically you will include the stubs in both the server and client jars. Dynamic Downloading of Stubs and skeletons makes it a requirement to set a codebase.
Mark
 
Kirk Maze
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't articulated my problem well again. There's nothing wrong with my server - if an instance of RMI server is running that knows about the DbEngine stub location, is running, then the server-side I wrote runs fine. Similarly, if the server-side is running fine, the client can hit it fine - all of this works from jarred up solutions from the command line.
What doesn't work from the command line, is the RMI server itself. I can run the RMI server from my IDE, and I can pass it a location of the stub as a classpath, then it runs, and I can run my server side. But from the command line, when I call , I can't pass it the location of the stub, which is now in the jar file, (or if I can, I don't know how). As a consequence, when I run the server-side that I wrote, it throws a huge nested exception. In pertinent part it says:

I hope I'm clear that the only difference between success and failure here is that, when I'm successful, the call to rmiregistry.exe knows about the classpath to the stub (because I'm making that call from inside the ide where it has that classpath). In the failed case, the call to rmiregistry has no path to the stub, so, when the server tries to bootstrap to it, it fails. In both the sucessful and unsuccessful case, the code I wrote is in the same 2 jar files. So this isn't a failure of the client to see the server. Its a failure of the registry to honor the call from the server, apparently only because the registry doesn't know where the stub is located.
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rmiregistry doesn't take any parameters that I'm aware of- it's just a naming service that (in a production environment) would already be running when you start your server. In my implementation, I try to register my ConnectionFactory, and if that fails (presumably because rmiregistry isn't running), I then start the registry programmatically.
My ConnectionFactory has only one method, getDatabase, which returns a Database remote object (unique to each client):A .jar file is just a compact representation of an "exploded" directory structure, with some limitations (e.g., db.db won't work from within the .jar; it has to be extracted). Use WinZip to look at your .jar file (which is just a .zip file) and make sure that your directory structure is correctly represented
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kirk,
in my assignment I tried to avoid all uncertainties with the registry and simply started it programmatically. In other words, my server started its own registry. If the user did not specify a port, the registry started on the default port 1099. And it worked fine.
Hope this helps.
Mag (SCJP/SCJD)
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The rmiregisty is of course a system-wide service, but no harm is done (to my knowledge) by "starting" it when it's already running.
 
Kirk Maze
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked. I did some final testing on multiple machines last night and this morning, and submitted the darn thing! It was past time - I've had my next project designed in my mind for weeks, and I'm tired of FBN! Thanks to all.
Kirk Maze
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great Kirk!
Probably the best criterion for deciding when to submit your project is when you realize that you're sick of working on it
 
Squanch that. And squanch this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic