permaculture playing cards*
The moose likes Servlets and the fly likes servlet communication between two JVMs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet communication between two JVMs" Watch "servlet communication between two JVMs" New topic
Author

servlet communication between two JVMs

Javed Sardar
Ranch Hand

Joined: Sep 10, 2002
Posts: 33
I have a scenario where I have a servlet running in app servers context and another servlet running in web servers context. I am using iPlanet 6.5 app server and iPLanet 4.1 web server.
The problem comes when the servlet in app server invokes the servlet in web server. It works fine but there is no way for user authentication . Any user can directly acces the servlet on web server whith out loggin in which is done through the servlet in app server.
Dose any body have idea how to make two serlets communicate if they are running on diif JVMs ?
Regards,
Javed.
I am using two servlets as I have to call CSP(Crystal Server pages and )and these are accessible through web server only.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Have you looked into ServletContext.getContext()?


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
You have described a situation with two separate ServletContexts - Sun explicitly prevents sharing of information between "web applications' - its a security thing.
The two JVMs can talk to each other with sockets, Java Message Service, URLConnections, whatever, but you will have to go outside the Servlet API to do it.
If the web server servlet only talks to the app server, you could simply have it reject all connections that don't come from the right source.
Bill
Vasudha Deepak
Ranch Hand

Joined: Mar 15, 2002
Posts: 86
You may wish to try making the application distributable in your deployment descriptor:
<web-app>
...
<distributable/>
..
</web-app>

Vasudha


IBM Certified Developer -XML and Related Technologies(141)<br />SCJP2 SCWCD
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: servlet communication between two JVMs
 
Similar Threads
sharing session/cookies between applications
session time out for EJB's..
Strange Session Time Outs
request handling mechanism in a distributable web application
****ServletContext and WebApplication confusion****