I want to deploy three Grails web applications in a Tomcat container. I am using Grails 1.3.7 and Tomcat 7.0.23. I want to put all commons jars in a tomcat/shared/lib directory. Why? I want to have smaller war files and reduce the amount of memory required in PermGen.
I configure the next line in conf/catalina.properites
shared.loader=${catalina.base}/shared/lib,${catalina.base}/shared/lib/*.jar
For all three applications, I execute
grails war
I copy all the *.jars under WEB-INF/lib into $CATALINA_HOME/shared/lib
Later I generate the war files without jars for every application
grails war --nojars
I put all three wars in the tomcat/webapps directory. The production dataSource in conf/DataSource.groovy looks as follows for every app.
App A)
production {
dataSource {
dbCreate = "update"
username = "userA"
password="password"
url = "jdbc:mysql://localhost:3306/applicationA"
driverClassName = "org.gjt.mm.mysql.Driver"
}
}
App B)
production {
dataSource {
dbCreate = "update"
username = "userB"
password="password"
url = "jdbc:mysql://localhost:3306/applicationB"
driverClassName = "org.gjt.mm.mysql.Driver"
}
}
App C)
production {
dataSource {
dbCreate = "update"
username = "userC"
password="password"
url = "jdbc:mysql://localhost:3306/applicationC"
driverClassName = "org.gjt.mm.mysql.Driver"
}
}
When I start up Tomcat the logs look like this:
Dec 11, 2011 11:28:15 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Dec 11, 2011 11:28:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
Dec 11, 2011 11:28:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
Dec 11, 2011 11:28:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
Dec 11, 2011 11:28:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 11, 2011 11:28:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 11, 2011 11:28:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 652 ms
Dec 11, 2011 11:28:15 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 11, 2011 11:28:15 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Dec 11, 2011 11:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:22 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationB-0.1war
Dec 11, 2011 11:28:22 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:23 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationA-0.1war
Dec 11, 2011 11:28:23 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:24 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationC-0.1war
Dec 11, 2011 11:28:24 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/docs
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/examples
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Dec 11, 2011 11:28:25 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 11, 2011 11:28:25 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 11, 2011 11:28:25 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5f24aa56')
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/host-manager
Dec 11, 2011 11:28:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/manager
Dec 11, 2011 11:28:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:26 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationB-0.1war
Dec 11, 2011 11:28:26 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:26 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationA-0.1war
Dec 11, 2011 11:28:26 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:27 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /Applications/apache-tomcat-7.0.23/webapps/ApplicationC-0.1war
Dec 11, 2011 11:28:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 11, 2011 11:28:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/docs
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Applications/apache-tomcat-7.0.23/webapps/examples
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Dec 11, 2011 11:28:28 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 11, 2011 11:28:28 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 11, 2011 11:28:28 PM org.apache.catalina.core.ApplicationContext log
IN