How about the idea that the servlet engine is free to take down the servlet
instance any time it feels like it, which means your RMI client can't know
for certain that the servlet is there? Granted, you could do a web-hit to
ensure the servlet is there before making the RMI-connect, but the servlet
engine is still free to bring the servlet instance back down right away, if
it feels like it needs to for load-balancing or clustering purposes....
That's why RMI servers, as a *general* rule, shouldn't be tied to servlets'
lifecycles--you can't know when the servlet is there or not. Is this a
problem *in practice*? Probably not, and having an RMI server object for
displaying debugging/tracing messages to any attached RMI clients can be a
very useful trick.
In some respects, though, for sophisticated object communication, you may be
better off having the servlet communicate as a client to an external RMI
server, which also communicates with another RMI client (i.e., the one you
want to run). This way, the RMI server is always there, and the servlet,
while it's up, can connect to it and both sides are guaranteed the entire
communication path is good.
Just a thought.
Ted Neward
Java Instructor, DevelopMentor ( http://www.develop.com )
http://www.javageeks.com/~tneward
-----Original Message-----
From: George Ludwig <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, January 24, 2000 2:27 PM
Subject: Re: RMI Connections to Servlets
>Ingo Schuster wrote:
>
>> Hello
>>
>> In his book "Enterprise Java Computing" Govind Seshadri writes:
>> "I would not recommend accessing an RMIlet using RMI clients due to
>> servlet lifecycle issues." (By RMIlet he means a servlet implementing the
>> Remote interface).
>> Does anybody have an idea why you shouldn't access an servlet via RMI?
>> What exactly does he mean by "lifecycle issues"?
>
>Did you ever get an asnwer on this? I've done some RMI, and Ica't think of
any
>reason NOT to connect to a servlet via RMI.
>
>I was considering doing exactly that to implement a servlet console.
>
>George
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html