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

Multiple webapps in the same container ?

 
Mikael Howell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is it necessary to deploy each webapp in a different tomcat instance.
If NO, how do I deploy all the webapps to the same instance. I face errors related to Perm, memory, scoket,etc.

If Yes, Then how do have multiple instances of Tomcat. I've been struggling to get through this.

Thanks in advance.
 
Kathleen Angeles
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can install multiple web applications (e.g. multiple war files) in 1 tomcat instance.

They must have different context root.

E.g. you can have localhost:8080/myapp1/index.jsp, and localhost:8080/myapp2/index.jsp

where myapp1 and myapp2 are the context roots.
 
Mikael Howell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I have deployed webapps in the similar fashion.
However, restarting tomcat leaves me with this



Here is the process output
[root@centos logs]# ps aux | grep java
user1 9458 3.2 17.7 630864 186056 ? Sl 22:44 0:24 /usr/java/latest/bin/java -Djava.util.logging.config.file=/usr/share/apache-tomcat/conf/logging.properties -Xms128m -Xmx256m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/apache-tomcat/endorsed -classpath /usr/share/apache-tomcat/bin/bootstrap.jar:/usr/share/apache-tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/share/apache-tomcat -Dcatalina.home=/usr/share/apache-tomcat -Djava.io.tmpdir=/usr/share/apache-tomcat/temp org.apache.catalina.startup.Bootstrap start
root 11147 0.0 0.0 3112 740 pts/3 S+ 22:56 0:00 grep java

What am I missing ?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your memory parameters are on the small side. About half of what you allow is going to be used up by Tomcat itself before any webapps even get deployed. Try bumping up mx to 512M or at least 384M.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic