Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: RMI & Lock Questions

 
Laura Pecoraro
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all and good day

I'm testing my solution for release , but, I have some question...

RMI
If I start my Server on localhost, and then, I start the Client on localhost, all works correctly...
BUT...If I start Server on others PC (some lan), and then, I start the Client on localhost (points on Server) I receive a SecurityException
The Sun specification say don't use ANY Security Manager...
What does this mean?

Lock
I can bring in available ONLY one instance to my database... I specific...
If I start a Server and 2 Client, the lock work correctly... BUT, I start a standalone Client (when Saver is up), and point same database, the previous lock (managed by Server), can't accessible...
The Lock management must be persists between same application runs???
Is possible run more Clients in standalone mode and access to same database???

Thanks, Laura





 
Roel De Nijs
Sheriff
Posts: 10386
132
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Laura,

Regarding your question about running a standalone client while the server is also running. I have the following in my assignment:

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.


So that's a scenario that should not happen!

Regards,
Roel
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Laura!!!

I'm testing my solution for release


Awesome!

Let me just see if I understood correctly... are you able to start your server and connect to it from another machine, providing the server's IP address? Are you able to start your server and connect to it from the same machine, providing the IP 127.0.0.1?

For the lock question, you may assume that if you start the application in standalone mode in a machine where the server is already running, one thing should not interfere with the other... so, the locking mechanism of the standalone mode is one thing, and the locking mechanism of the server is another thing.
 
Laura Pecoraro
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roberto,

Ok, about RMI...
If I start Server & Client on same machine (127.0.0.1) all work correctly...
When start Server on 192.168.xxx.yyy and the Client on 127.0.0.1 (but hook the server on 192.168.xxx.yyy) I gets a SecurityException

For Lock... I solve with locking the database file... I assume the only one instance on database is available (Server or Client)

Hi... Laura
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, Laura.

It's kindda' hard to tell what can be wrong with your server, but please take a look here and see if it helps. If it isn't of much help, then please take a look here. I advised many people to follow this tutorial during the server development. I know this works because I followed it when I created my server
 
Laura Pecoraro
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all (especially Roberto Perillo)

For RMI I solve the problem... make an error during the declaration (lookup) the server

Hi, Laura
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic