• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

multiple jvm for tomcat

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello there , can anybody tell me that:
how can i have two instance of tomcat running on a single machine and each instance is using separate java virtual machine(running multiple jvm).
thanks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you had each instance listen on a different port. I've used JBuilder 5 to test and run JSP pages. Each time I click the green arrow, I can set JBuilder to start a new instance... so I have tomcat:8080, tomcat:8082, tomcat:8084

Absolute proof that they are different JVM's is that the servlet error I fixed on my third try (which runs properly in 8084) is still broken in the first window (8080).

If you meant something like two jvm's that round-robin on a single port for load balancing.. I'm not sure if Tomcat supports this? anyone else?
[This message has been edited by Mike Curwen (edited October 16, 2001).]
 
ray bond
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created two directory for tomcat
1. c:\jakarta-tomcat , 2.c:\jakarta-tomcatone .
each instance have different port, but the second
instance I start is giving error "JVM bind error......"
it means both instances are running in same
JVM , how can I get each instace running in different
JVM (two JVM for two instace).
thanks
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you are still running two JVM's, but the BIND error means you are trying to get your second instance of Tomcat to bind to a port the first one is using.

If you look in server.xml there are many ports that Tomcat binds (off hand, I can remember 8080, 8081, 8082, 8008 and 8443)

What I did was make two directories like you, and in my second server.xml file, I changed all of the 8*** ports to 9***, and two instances started up (from two different DOS windows). I should say that perhaps changing *all* of these numbers is not necessary, I really don't know. But for safety, I changed them all.

I made a simple change to the numguess servlet in the examples directory of my first instance, and using two browser windows, one at localhost:8080 and one at localhost:9080, I can get two separate behaviours in my modified numguess servlet. This is also reflected in the DOS window for that instance. (I modified it to System.out.println the number of guesses... only my modified instance produces this number in the DOS window. Proof, I'm pretty sure, that they represent two JVM's.

You might also consider a 'new' feature of Tomcat 4.0... I haven't read very much on it, and perhaps it's not really what you're trying to accomplish, but check out the document here: %CATALINA_HOME%\webapps\tomcat-docs\RUNNING.txt
and starting at line 104 --> the (4)th point.

This makes reference to CATALINA_BASE for running multiple instances of Tomcat 4.0

[This message has been edited by Mike Curwen (edited October 17, 2001).]
 
ray bond
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks mike , i changed the ports 8*** to 9*** in second tomcat directory and now there is no "jvm bind err" in console , but how can we be sure that each instace is using separate jvm , i mean my system's default jvm is c:\programfiles\javasoft\jre....,so there is one jvm . do you mean that both tomcat instances are using this jvm but different process space or one instance is using "c:\programfiles\javasoft..." and other "c:\jdk1.3\jre\...", can you please make this jvm issue clear for me.
thanks
 
Saloon Keeper
Posts: 28392
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each Tomcat should be running under its own JVM. Please note the difference between the JVM "class" - c:\programfiles\javasoft\jre and instances of that class. A new JVM instance is created in each Windows process group.
Tomcat actually supports running itself in multiple JVMs under a single startup if you get down and dirty with its runtime parameters. By default, however, everything within a single startup runs in the startup's initial JVM, however, since this is both more efficient and more convenient - it's a lot simpler to toss objects around inside a JVM than to bounce them between JVMs/
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic