Results 1 to 4 of 4
- 03-12-2010, 06:10 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
tomcat + inter-process communication?
Hi all,
I have a web application running on a tomcat server and I wanted to write beans that would communicate with another java application that runs on the server. I'd like for the bean code in the jsp server to be able to call methods from the running java application. Is there some sort of inter-process communication (IPC) that would allow me to do this? Is there some easier way of doing it? The back-end application needs to run all the time (has a 'main' method), and is multithreaded. I am kind of new to these sort of things and would appreciate any kind of feedback.
Thanks in advance,
-Justin
- 03-13-2010, 03:45 AM #2
Tomcat uses multiple ClassLoader instances to separate each application it is running. This allows applications to use different versions of the same classes and for the server to reload individual applications without having to shut down the entire JVM. This makes communication between applications more complicated.
If you create classes and put them only in the /common/ directory tree, then all processes will share these class definitions. You can then use static methods to access these classes.
Note that if you put these classes in /common/ and also in your /WEB-INF/ directories, you will end up with two separate classes with two separate sets of static methods.
- 03-13-2010, 03:42 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
I'm sorry, I should have been more clear in my first post: the second application that I am running is not a tomcat application. It is entirely separate from tomcat. The first application is the tomcat application, and I want this application to be able to get information from the second application's memory space. I am thinking about using sockets for this, though I don't know if there might be an easier solution.
- 03-15-2010, 08:57 PM #4
Yes, you can use raw sockets to communicate between two JVM's, even if they are on separate servers. Another approach is to run the server application inside a Web application server and to use Web services to allow clients to access the application.
You might also consider moving the "other" application into the Tomcat container. You would need a means to start the application when Tomcat starts, which shouldn't be too hard. This is the idea used in JEE servers.
Similar Threads
-
A place to post beginner/inter exercises/scenarios
By helpisontheway in forum New To JavaReplies: 0Last Post: 01-27-2010, 09:03 AM -
tomcat can not process request
By sclsch in forum Web FrameworksReplies: 0Last Post: 04-17-2009, 08:26 AM -
inter process communication
By ibtehal in forum NetworkingReplies: 5Last Post: 06-23-2008, 01:35 AM -
How to use pipes for inter-thread I/O
By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:37 PM -
Tomcat In Eclipse - Sysdeo Tomcat Plug-in
By JavaForums in forum EclipseReplies: 1Last Post: 02-13-2008, 10:33 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks