cancel
Showing results for 
Search instead for 
Did you mean: 

Errors in Running two Alfresco Tomcat instances

dorra87
Champ in-the-making
Champ in-the-making
Hi all,
I want to run 2 alfresco tomcat instances in my machine,so I copy the tomcat folder and modify the files server.xml :
<?xml version='1.0' encoding='utf-8'?>
<!–
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
–>
<!– Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
–>
<Server port="8006" shutdown="SHUTDOWN">

  <!–APR library loader. Documentation at /docs/apr.html –>
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!–Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html –>
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!– Prevent memory leaks due to use of particular java/javax APIs–>
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <!– JMX Support for the Tomcat server. Documentation at /docs/non-existent.html –>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!– Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  –>
  <GlobalNamingResources>
    <!– Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    –>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!– A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   –>
  <Service name="Catalina">
 
    <!–The connectors can use a shared executor, you can define one or more named thread pools–>
    <!–
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    –>
   
   
    <!– A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8081
    –>
    <Connector port="8081" URIEncoding="UTF-8" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!– A "Connector" using the shared thread pool–>
    <!–
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    –>          
    <!– Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation –>
    <!–
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    –>

    <!– Define an AJP 1.3 Connector on port 8010 –>
    <Connector port="80108010" protocol="AJP/1.3" redirectPort="8443" />

    <Connector port="8444" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
               maxThreads="150" scheme="https" keystoreFile="C:\Alfresco/alf_data/keystore/ssl.keystore" keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000" truststoreFile="C:\Alfresco/alf_data/keystore/ssl.truststore" truststorePass="kT9X6oe68t" truststoreType="JCEKS"
               clientAuth="false" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" /> 

    <!– An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html –>

    <!– You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">        
    –>
    <Engine name="Catalina" defaultHost="localhost">

      <!–For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) –>
      <!–
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      –>       

      <!– The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html –>
      <!–
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      –>

      <!– This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  –>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!– Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       –>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!– SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html –>
          <valve className="org.apache.catalina.valves.RemoteAddrValve" allow="192.168.1.16,127.0.0.1"/>
        <!–
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        –>

        <!– Access log processes all example.
             Documentation at: /docs/config/valve.html –>
        <!–
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        –>

      </Host>
    </Engine>
  </Service>
</Server>
and  the file alfresco-global.properties :

###############################
## Common Alfresco Properties #
###############################

dir.root=C:/Alfresco/alf_data

alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8081
alfresco.protocol=http

###########"############
##rsap instance#########
########################
share.context=shareTest
share.host=127.0.0.1
share.port=8080
share.protocol=http
### database connection properties ###
db.driver=org.postgresql.Driver
db.username=worker
db.password=worker2012
db.name=shareDB
db.url=jdbc:postgresql://localhost:5432/${db.name}

### FTP Server Configuration ###
ftp.enabled=true
ftp.port=21
ftp.ipv6.enabled=false

### RMI service ports ###
alfresco.rmi.services.port=50501
avm.rmi.service.port=0
avmsync.rmi.service.port=0
attribute.rmi.service.port=0
authentication.rmi.service.port=0
repo.rmi.service.port=0
action.rmi.service.port=0
deployment.rmi.service.port=0

### External executable locations ###
ooo.exe=C:/Alfresco/openoffice/App/openoffice/program/soffice.exe
ooo.enabled=true
ooo.port=8100
ooo.port=8100
img.root=C:/Alfresco/imagemagick
img.dyn=${img.root}/lib
img.exe=${img.root}/convert
swf.exe=C:/Alfresco/swftools/pdf2swf.exe
jodconverter.enabled=false
jodconverter.officeHome=C:/Alfresco/openoffice/App/openoffice
jodconverter.portNumbers=8100

### Initial admin password ###
alfresco_user_store.adminpassword=55950477c6b258c3d3d0ba87fe4980fb

### E-mail site invitation setting ###
notification.email.siteinvite=false

### File Protocol Root ###
protocols.rootPath=/${spaces.company_home.childname}/${spaces.sites.childname}

### License location ###
dir.license.external=C:/Alfresco

### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443

### BPM Engine ###
system.workflow.engine.jbpm.enabled=true
system.workflow.engine.activiti.enabled=true

system.workflow.engine.jbpm.definitions.visible=false
system.workflow.engine.activiti.definitions.visible=true
I did create the database which is a copy of alfresco database.
when I run the startup.bat,I get this:
27 avr. 2012 09:52:24 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
27 avr. 2012 09:52:24 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
27 avr. 2012 09:52:24 org.apache.tomcat.util.digester.Digester endElement
ATTENTION:   No rules found matching 'Server/Service/Engine/Host/valve'.
27 avr. 2012 09:52:24 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8081
27 avr. 2012 09:52:24 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-80108010
27 avr. 2012 09:52:25 org.apache.coyote.http11.Http11Protocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8444
27 avr. 2012 09:52:25 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1488 ms
27 avr. 2012 09:52:25 org.apache.catalina.core.StandardService start
INFO: DÚmarrage du service Catalina
27 avr. 2012 09:52:25 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
27 avr. 2012 09:52:25 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: DÚploiement du descripteur de configuration alfresco.xml
27 avr. 2012 09:52:27 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
2012-04-27 09:52:46,481  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
2012-04-27 09:52:46,610  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
2012-04-27 09:53:18,149  WARN  [alfresco.util.AbstractTriggerBean] [main] Job ehCacheTracerJob is not active/enabled
2012-04-27 09:53:34,406  INFO  [extensions.webscripts.TemplateProcessorRegistry] [main] Registered template processor Repository Template Processor for extension ftl
2012-04-27 09:53:34,412  INFO  [extensions.webscripts.ScriptProcessorRegistry] [main] Registered script processor Repository Script Processor for extension js
2012-04-27 09:53:47,616  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'transferReceiver' threw an exception
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:347)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
2012-04-27 09:53:49,419  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'DiscussionService' threw an exception
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
        at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:76)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
        at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.reflect.Method.declaredAnnotations(Method.java:693)
        at java.lang.reflect.Method.getAnnotation(Method.java:679)
        at org.apache.cxf.common.injection.ResourceInjector.addAnnotatedMethods(ResourceInjector.java:358)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:346)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
2012-04-27 09:53:50,277  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'emailNotificationProvider' threw an exception
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:347)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
2012-04-27 09:53:51,912  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'activitiWorkflowEngine' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-04-27 09:53:53,527  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'SiteService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-04-27 09:53:55,098  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'taggingService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-04-27 09:53:57,508  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'versionableAspect' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-04-27 09:53:59,454  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'AuditMethodInterceptor' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-04-27 09:54:01,165  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'avmServiceMT' threw an exception
java.lang.OutOfMemoryError: PermGen space
even when I added this to catalina.sh:
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XXSmiley TongueermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"
I get  after the same error log.
thanks for yr help
6 REPLIES 6

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
The maxPermSize of your tomcat instance seems a bit small to me. I would suggest increasing it to 512m at least for the alfresco tomcat instance. The share instance should be adequately equiped with 256m.

digihorse
Champ in-the-making
Champ in-the-making
Running 2 tomcat's is a little tricky.  Did you say what OS?  You should do this with 2 static IPs and then use  "address="192.168.1.2" " (without the outside quotes) blah to differentiate the different tomcats in separate configuration files.  Now, if you must run both on 1 IP, then you need to force one of the instances to use difference ports for EVERY entry.  If you leave even 1 the same you will get conflicts in the backend control communications structures.  Your error is about binding to ports already in use.

bisana
Champ on-the-rise
Champ on-the-rise
even you have to have two database, the  second instance "alfresco-global.properties", should contain second database details

dorra87
Champ in-the-making
Champ in-the-making
this is what I did in the copy of tomcat folder: I changed these files
-server.xml
<?xml version='1.0' encoding='utf-8'?>
<!–
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
–>
<!– Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
–>
<Server port="8006" shutdown="SHUTDOWN">

  <!–APR library loader. Documentation at /docs/apr.html –>
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!–Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html –>
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!– Prevent memory leaks due to use of particular java/javax APIs–>
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <!– JMX Support for the Tomcat server. Documentation at /docs/non-existent.html –>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!– Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  –>
  <GlobalNamingResources>
    <!– Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    –>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!– A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   –>
  <Service name="Catalina">
 
    <!–The connectors can use a shared executor, you can define one or more named thread pools–>
    <!–
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    –>
   
   
    <!– A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8081
    –>
    <Connector port="8081" URIEncoding="UTF-8" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8445" />
    <!– A "Connector" using the shared thread pool–>
    <!–
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    –>          
    <!– Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation –>
    <!–
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    –>

    <!– Define an AJP 1.3 Connector on port 8010 –>
    <Connector port="80108011" protocol="AJP/1.3" redirectPort="8445" />

    <Connector port="8446" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
               maxThreads="150" scheme="https" keystoreFile="C:\Alfresco/alf_data/keystore/ssl.keystore" keystorePass="kT9X6oe68t" keystoreType="JCEKS"
secure="true" connectionTimeout="240000" truststoreFile="C:\Alfresco/alf_data/keystore/ssl.truststore" truststorePass="kT9X6oe68t" truststoreType="JCEKS"
               clientAuth="false" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" /> 

    <!– An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html –>

    <!– You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">        
    –>
    <Engine name="Catalina" defaultHost="localhost">

      <!–For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) –>
      <!–
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      –>       

      <!– The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html –>
      <!–
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      –>

      <!– This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  –>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!– Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       –>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!– SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html –>
          <valve className="org.apache.catalina.valves.RemoteAddrValve" allow="192.168.1.16,127.0.0.1"/>
        <!–
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        –>

        <!– Access log processes all example.
             Documentation at: /docs/config/valve.html –>
        <!–
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        –>

      </Host>
    </Engine>
  </Service>
</Server>
alfresco-global.properties
###############################
## Common Alfresco Properties #
###############################

dir.root=C:/Alfresco/alf_data

alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8081
alfresco.protocol=http

###########"############
##rsap instance#########
########################
share.context=rsap
share.host=127.0.0.1
share.port=8081
share.protocol=http
### database connection properties ###
db.driver=org.postgresql.Driver
db.username=openUser
db.password=worker2012
db.name=rsap
db.url=jdbc:postgresql://localhost:5432/${db.name}

### FTP Server Configuration ###
ftp.enabled=true
ftp.port=21
ftp.ipv6.enabled=false

### RMI service ports ###
alfresco.rmi.services.port=50502
avm.rmi.service.port=0
avmsync.rmi.service.port=0
attribute.rmi.service.port=0
authentication.rmi.service.port=0
repo.rmi.service.port=0
action.rmi.service.port=0
deployment.rmi.service.port=0

### External executable locations ###
ooo.exe=C:/Alfresco/openoffice/App/openoffice/program/soffice.exe
ooo.enabled=true
ooo.port=8100
ooo.port=8100
img.root=C:/Alfresco/imagemagick
img.dyn=${img.root}/lib
img.exe=${img.root}/convert
swf.exe=C:/Alfresco/swftools/pdf2swf.exe
jodconverter.enabled=false
jodconverter.officeHome=C:/Alfresco/openoffice/App/openoffice
jodconverter.portNumbers=8100

### Initial admin password ###
alfresco_user_store.adminpassword=55950477c6b258c3d3d0ba87fe4980fb

### E-mail site invitation setting ###
notification.email.siteinvite=false

### File Protocol Root ###
protocols.rootPath=/${spaces.company_home.childname}/${spaces.sites.childname}

### License location ###
dir.license.external=C:/Alfresco

### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443

### BPM Engine ###
system.workflow.engine.jbpm.enabled=true
system.workflow.engine.activiti.enabled=true

system.workflow.engine.jbpm.definitions.visible=false
system.workflow.engine.activiti.definitions.visible=true
- in share-config-custom.xml I change the port 8080 and this is the part I did change
<config evaluator="string-compare" condition="Remote">
  <remote>
    <endpoint>
      <id>alfresco-noauth</id>
      <name>Alfresco - unauthenticated access</name>
      <description>Access to Alfresco Repository WebScripts that do not require authentication</description>
      <connector-id>alfresco</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <identity>none</identity>
    </endpoint>

    <endpoint>
      <id>alfresco</id>
      <name>Alfresco - user access</name>
      <description>Access to Alfresco Repository WebScripts that require user authentication</description>
      <connector-id>alfresco</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <identity>user</identity>
    </endpoint>

    <endpoint>
      <id>alfresco-feed</id>
      <name>Alfresco Feed</name>
      <description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
      <connector-id>http</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <basic-auth>true</basic-auth>
      <identity>user</identity>
    </endpoint>
  </remote>
</config>
 
<config evaluator="string-compare" condition="Remote">
  <remote>
    <endpoint>
      <id>alfresco-noauth</id>
      <name>Alfresco - unauthenticated access</name>
      <description>Access to Alfresco Repository WebScripts that do not require authentication</description>
      <connector-id>alfresco</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <identity>none</identity>
    </endpoint>

    <endpoint>
      <id>alfresco</id>
      <name>Alfresco - user access</name>
      <description>Access to Alfresco Repository WebScripts that require user authentication</description>
      <connector-id>alfresco</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <identity>user</identity>
    </endpoint>

    <endpoint>
      <id>alfresco-feed</id>
      <name>Alfresco Feed</name>
      <description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
      <connector-id>http</connector-id>
      <endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
      <basic-auth>true</basic-auth>
      <identity>user</identity>
    </endpoint>
  </remote>
</config>
http://dl.dropbox.com/u/60550216/pgAdmin%20III.jpg
-log :
2 mai 2012 19:29:59 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
2 mai 2012 19:29:59 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2 mai 2012 19:29:59 org.apache.tomcat.util.digester.Digester endElement
ATTENTION:   No rules found matching 'Server/Service/Engine/Host/valve'.
2 mai 2012 19:30:00 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8081
2 mai 2012 19:30:00 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-80108011
2 mai 2012 19:30:00 org.apache.coyote.http11.Http11Protocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8446
2 mai 2012 19:30:00 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1544 ms
2 mai 2012 19:30:00 org.apache.catalina.core.StandardService start
INFO: DÚmarrage du service Catalina
2 mai 2012 19:30:00 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
2 mai 2012 19:30:00 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: DÚploiement du descripteur de configuration alfresco.xml
2 mai 2012 19:30:02 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
2012-05-02 19:30:16,917  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
2012-05-02 19:30:16,984  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
2012-05-02 19:30:29,561  WARN  [alfresco.util.AbstractTriggerBean] [main] Job ehCacheTracerJob is not active/enabled
2012-05-02 19:30:35,480  INFO  [extensions.webscripts.TemplateProcessorRegistry] [main] Registered template processor Repository Template Processor for extension ftl
2012-05-02 19:30:35,484  INFO  [extensions.webscripts.ScriptProcessorRegistry] [main] Registered script processor Repository Script Processor for extension js
2012-05-02 19:30:45,152  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'webscripts.script.remote' threw an exception
java.lang.OutOfMemoryError: PermGen space
        at sun.misc.Unsafe.defineClass(Native Method)
        at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
        at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
        at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:76)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
        at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)
        at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
        at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
        at java.lang.reflect.Method.declaredAnnotations(Method.java:693)
        at java.lang.reflect.Method.getAnnotation(Method.java:679)
        at org.apache.cxf.common.injection.ResourceInjector.addAnnotatedMethods(ResourceInjector.java:358)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:347)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
2012-05-02 19:30:46,107  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'org.springframework.extensions.webscripts.json.JSONUtils#143753'
threw an exception
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:347)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
2012-05-02 19:30:47,945  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'listsServiceHandler' threw an exception
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at org.apache.cxf.common.injection.ResourceInjector.getAnnotatedMethods(ResourceInjector.java:347)
        at org.apache.cxf.common.injection.ResourceInjector.getPreDestroyMethods(ResourceInjector.java:340)
        at org.apache.cxf.common.injection.ResourceInjector.invokePreDestroy(ResourceInjector.java:317)
        at org.apache.cxf.common.injection.ResourceInjector.destroy(ResourceInjector.java:96)
        at org.apache.cxf.bus.spring.Jsr250BeanPostProcessor.postProcessBeforeDestruction(Jsr250BeanPostProcessor.java:99)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:166)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:433)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
2012-05-02 19:30:49,598  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'shareUtils' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:30:51,192  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'CMISAccessControlService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:30:52,765  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'wikiService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:30:59,208  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'renditionService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:01,376  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'bfsiDirectoryAnalyser' threw an exception
java.lang.OutOfMemoryError: PermGen space
Exception in thread "RMI RenewClean-[192.168.1.2:53721,org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory@0]" 2012-05-02 19:31:05,328  ERROR [factory.support.Defau
ltListableBeanFactory] [main] Destroy method on bean with name 'webdavService' threw an exception
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:07,975  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'assetService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:12,019  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'activitiWorkflowEngine' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:14,061  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'jbpm_engine' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:16,046  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'jgroupsChannelFactory' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:17,837  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'authenticationUtil' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:19,497  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'siteService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:21,018  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'newAvmNodeLinksDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:22,532  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'activitiesDataSource' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:27,914  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'deploymentService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:29,938  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'actionTrackingServiceScript' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:32,454  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'org.alfresco.repo.scheduler.AlfrescoJobFactory#156d7c8' threw an
exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:34,340  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'workflowPackageImpl' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:36,023  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'contentUsageImpl' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:37,560  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'queryRegisterComponent' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:39,075  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'viewParser' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:40,606  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'multilingualContentService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:42,732  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'versionMigrator' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:44,781  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'authorityDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:46,678  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'hiddenAspect' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:48,358  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'deploymentAsynchronousActionExecutionQueue' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:49,899  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'lockService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:52,132  WARN  [factory.support.DisposableBeanAdapter] [main] Invocation of destroy method 'shutdown' failed on bean with name 'jobLockService': java.lang.OutOfMemor
yError: PermGen space
2012-05-02 19:31:52,866  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'HomeFolderManager' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:54,351  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'contentTransformerRegistry' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:55,846  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'avmNodeACLDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:57,327  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'newAvmNodeDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:31:58,812  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'dbNodeService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:00,362  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'avmService' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:01,847  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'avmServiceBase' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:03,331  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'versionRootDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:04,826  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'nodeDAO.org.hibernate.dialect.Dialect' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:06,330  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'contentDataDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:07,832  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'admNodeACLDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:09,935  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'aclCrudDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:11,776  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'multiTNodeServiceInterceptor' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:25,434  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'dictionaryDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:27,276  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'exporter' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:28,942  WARN  [factory.support.DisposableBeanAdapter] [main] Invocation of destroy method failed on bean with name 'serverConnector': java.lang.OutOfMemoryError: Pe
rmGen space
2012-05-02 19:32:30,565  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'keyStore' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:32,084  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'propertyValueDAO' threw an exception
java.lang.OutOfMemoryError: PermGen space
Exception in thread "RMI RenewClean-[192.168.1.2:50508]" java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:34,461  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Stopping 'sysAdmin' subsystem, ID: [sysAdmin, default]
2012-05-02 19:32:34,461  INFO  [management.subsystems.ChildApplicationContextFactory] [main] Stopped 'sysAdmin' subsystem, ID: [sysAdmin, default]
2012-05-02 19:32:35,286  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'transactionManager' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:37,475  WARN  [factory.support.DisposableBeanAdapter] [main] Invocation of destroy method failed on bean with name 'sessionFactory': java.lang.OutOfMemoryError: Per
mGen space
2012-05-02 19:32:39,256  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'hibernateConfigProperties' threw an exception
java.lang.OutOfMemoryError: PermGen space
2012-05-02 19:32:40,883  ERROR [factory.support.DefaultListableBeanFactory] [main] Destroy method on bean with name 'applicationEventMulticaster' threw an exception
java.lang.OutOfMemoryError: PermGen space
java.lang.reflect.InvocationTargetException
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
I could not create the database with another port.
So this is all the changes that I did.If semeone know how to fix this problem.It'll be so helpful
thanks a lot for yr replies.
OSSmiley Frustratedeven

mrogers
Star Contributor
Star Contributor
You still have permgen problems.   That's nothing to do with trying to run two instances unless its something like not having enough memory on your box.

You don't need two separate database servers, just two different named databases.

dorra87
Champ in-the-making
Champ in-the-making
this is the catalina.sh file
#!/bin/sh

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# —————————————————————————–
# Start/Stop Script for the CATALINA Server
#
# Environment Variable Prequisites
#
#   CATALINA_HOME   May point at your Catalina "build" directory.
#
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.
#
#   CATALINA_OUT    (Optional) Full path to a file where stdout and stderr
#                   will be redirected.
#                   Default is $CATALINA_BASE/logs/catalina.out
#
#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
#                   or "run" command is executed.
#
#   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
#                   the JVM should use (java.io.tmpdir).  Defaults to
#                   $CATALINA_BASE/temp.
#
#   JAVA_HOME       Must point at your Java Development Kit installation.
#                   Required to run the with the "debug" argument.
#
#   JRE_HOME        Must point at your Java Development Kit installation.
#                   Defaults to JAVA_HOME if empty.
#
#   JAVA_OPTS       (Optional) Java runtime options used when the "start",
#                   "stop", or "run" command is executed.
#
#   JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories
#                   containing some jars in order to allow replacement of APIs
#                   created outside of the JCP (i.e. DOM and SAX from W3C).
#                   It can also be used to update the XML parser implementation.
#                   Defaults to $CATALINA_HOME/endorsed.
#
#   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
#                   command is executed. The default is "dt_socket".
#
#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. The default is 8000.
#
#   JPDA_SUSPEND    (Optional) Java runtime options used when the "jpda start"
#                   command is executed. Specifies whether JVM should suspend
#                   execution immediately after startup. Default is "n".
#
#   JPDA_OPTS       (Optional) Java runtime options used when the "jpda start"
#                   command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
#                   and JPDA_SUSPEND are ignored. Thus, all required jpda
#                   options MUST be specified. The default is:
#
#                   -agentlib:jdwp=transport=$JPDA_TRANSPORT,
#                       address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND
#
#   CATALINA_PID    (Optional) Path of the file which should contains the pid
#                   of catalina startup java process, when start (fork) is used
#
#   LOGGING_CONFIG  (Optional) Override Tomcat's logging config file
#                   Example (all one line)
#                   LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
#
#   LOGGING_MANAGER (Optional) Override Tomcat's logging manager
#                   Example (all one line)
#                   LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
#
# $Id: catalina.sh 947714 2010-05-24 16:57:18Z markt $
# —————————————————————————–
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=512m -XX:+DisableExplicitGC"
# OS specific support.  $var _must_ be set to either true or false.
cygwin=false
os400=false
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac

# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ]; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done

# Get standard environment variables
PRGDIR=`dirname "$PRG"`

# Only set CATALINA_HOME if not already set
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`

# Ensure that any user defined CLASSPATH variables are not used on startup,
# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=

if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
  . "$CATALINA_BASE"/bin/setenv.sh
elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
  . "$CATALINA_HOME"/bin/setenv.sh
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath –unix "$JAVA_HOME"`
  [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath –unix "$JRE_HOME"`
  [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath –unix "$CATALINA_HOME"`
  [ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath –unix "$CATALINA_BASE"`
  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath –path –unix "$CLASSPATH"`
fi

# For OS400
if $os400; then
  # Set job priority to standard for interactive (interactive - 6) by using
  # the interactive priority - 6, the helper threads that respond to requests
  # will be running at the same priority as interactive jobs.
  COMMAND='chgjob job('$JOBNAME') runpty(6)'
  system $COMMAND

  # Enable multi threading
  export QIBM_MULTI_THREADED=Y
fi

# Get standard Java environment variables
if $os400; then
  # -r will Only work on the os400 if the files are:
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  BASEDIR="$CATALINA_HOME"
  . "$CATALINA_HOME"/bin/setclasspath.sh
else
  if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
    BASEDIR="$CATALINA_HOME"
    . "$CATALINA_HOME"/bin/setclasspath.sh
  else
    echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
    echo "This file is needed to run this program"
    exit 1
  fi
fi

if [ -z "$CATALINA_BASE" ] ; then
  CATALINA_BASE="$CATALINA_HOME"
fi

# Add tomcat-juli.jar and bootstrap.jar to classpath
# tomcat-juli.jar can be over-ridden per instance
if [ ! -z "$CLASSPATH" ] ; then
  CLASSPATH="$CLASSPATH":
fi
if [ "$CATALINA_BASE" != "$CATALINA_HOME" ] && [ -r "$CATALINA_BASE/bin/tomcat-juli.jar" ] ; then
  CLASSPATH="$CLASSPATH""$CATALINA_BASE"/bin/tomcat-juli.jar:"$CATALINA_HOME"/bin/bootstrap.jar
else
  CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar
fi

if [ -z "$CATALINA_OUT" ] ; then
  CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
fi

if [ -z "$CATALINA_TMPDIR" ] ; then
  # Define the java.io.tmpdir to use for Catalina
  CATALINA_TMPDIR="$CATALINA_BASE"/temp
fi

# Bugzilla 37848: When no TTY is available, don't output to console
have_tty=0
if [ "`tty`" != "not a tty" ]; then
    have_tty=1
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
  JAVA_HOME=`cygpath –absolute –windows "$JAVA_HOME"`
  JRE_HOME=`cygpath –absolute –windows "$JRE_HOME"`
  CATALINA_HOME=`cygpath –absolute –windows "$CATALINA_HOME"`
  CATALINA_BASE=`cygpath –absolute –windows "$CATALINA_BASE"`
  CATALINA_TMPDIR=`cygpath –absolute –windows "$CATALINA_TMPDIR"`
  CLASSPATH=`cygpath –path –windows "$CLASSPATH"`
  JAVA_ENDORSED_DIRS=`cygpath –path –windows "$JAVA_ENDORSED_DIRS"`
fi

# Set juli LogManager config file if it is present and an override has not been issued
if [ -z "$LOGGING_CONFIG" ]; then
  if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
    LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
  else
    # Bugzilla 45585
    LOGGING_CONFIG="-Dnop"
  fi
fi

if [ -z "$LOGGING_MANAGER" ]; then
  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
else
  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
fi

# —– Execute The Requested Command —————————————–

# Bugzilla 37848: only output this if we have a TTY
if [ $have_tty -eq 1 ]; then
  echo "Using CATALINA_BASE:   $CATALINA_BASE"
  echo "Using CATALINA_HOME:   $CATALINA_HOME"
  echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
  if [ "$1" = "debug" ] ; then
    echo "Using JAVA_HOME:       $JAVA_HOME"
  else
    echo "Using JRE_HOME:        $JRE_HOME"
  fi
  echo "Using CLASSPATH:       $CLASSPATH"
fi

if [ "$1" = "jpda" ] ; then
  if [ -z "$JPDA_TRANSPORT" ]; then
    JPDA_TRANSPORT="dt_socket"
  fi
  if [ -z "$JPDA_ADDRESS" ]; then
    JPDA_ADDRESS="8000"
  fi
  if [ -z "$JPDA_SUSPEND" ]; then
    JPDA_SUSPEND="n"
  fi
  if [ -z "$JPDA_OPTS" ]; then
    JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
  fi
  CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
  shift
fi

if [ "$1" = "debug" ] ; then
  if $os400; then
    echo "Debug command not available on OS400"
    exit 1
  else
    shift
    if [ "$1" = "-security" ] ; then
      if [ $have_tty -eq 1 ]; then
        echo "Using Security Manager"
      fi
      shift
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
        -sourcepath "$CATALINA_HOME"/../../java \
        -Djava.security.manager \
        -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
        -Dcatalina.base="$CATALINA_BASE" \
        -Dcatalina.home="$CATALINA_HOME" \
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
        org.apache.catalina.startup.Bootstrap "$@" start
    else
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
        -sourcepath "$CATALINA_HOME"/../../java \
        -Dcatalina.base="$CATALINA_BASE" \
        -Dcatalina.home="$CATALINA_HOME" \
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
        org.apache.catalina.startup.Bootstrap "$@" start
    fi
  fi

elif [ "$1" = "run" ]; then

  shift
  if [ "$1" = "-security" ] ; then
    if [ $have_tty -eq 1 ]; then
      echo "Using Security Manager"
    fi
    shift
    exec "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Djava.security.manager \
      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start
  else
    exec "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start
  fi

elif [ "$1" = "start" ] ; then

  if [ ! -z "$CATALINA_PID" ]; then
    if [ -f "$CATALINA_PID" ]; then
      echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start aborted."
      exit 1
    fi
  fi

  shift
  touch "$CATALINA_OUT"
  if [ "$1" = "-security" ] ; then
    if [ $have_tty -eq 1 ]; then
      echo "Using Security Manager"
    fi
    shift
    "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Djava.security.manager \
      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start \
      >> "$CATALINA_OUT" 2>&1 &

  else
    "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start \
      >> "$CATALINA_OUT" 2>&1 &

  fi

  if [ ! -z "$CATALINA_PID" ]; then
    echo $! > $CATALINA_PID
  fi

elif [ "$1" = "stop" ] ; then

  shift

  SLEEP=5
  if [ ! -z "$1" ]; then
    echo $1 | grep "[^0-9]" > /dev/null 2>&1
    if [ $? -gt 0 ]; then
      SLEEP=$1
      shift
    fi
  fi

  FORCE=0
  if [ "$1" = "-force" ]; then
    shift
    FORCE=1
  fi

  if [ ! -z "$CATALINA_PID" ]; then
    if [ -f "$CATALINA_PID" ]; then
      kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
      if [ $? -gt 0 ]; then
        echo "PID file ($CATALINA_PID) found but no matching process was found. Stop aborted."
        exit 1
      fi
    else
      echo "\$CATALINA_PID was set ($CATALINA_PID) but the specified file does not exist. Is Tomcat running? Stop aborted."
      exit 1
    fi
  fi
 
  "$_RUNJAVA" $JAVA_OPTS \
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
    -Dcatalina.base="$CATALINA_BASE" \
    -Dcatalina.home="$CATALINA_HOME" \
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
    org.apache.catalina.startup.Bootstrap "$@" stop

  if [ ! -z "$CATALINA_PID" ]; then
    if [ -f "$CATALINA_PID" ]; then
      while [ $SLEEP -ge 0 ]; do
        kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
        if [ $? -gt 0 ]; then
          rm $CATALINA_PID
          break
        fi
        if [ $SLEEP -gt 0 ]; then
          sleep 1
        fi
        if [ $SLEEP -eq 0 ]; then
          if [ $FORCE -eq 0 ]; then
            echo "Tomcat did not stop in time. PID file was not removed."
          fi
        fi
        SLEEP=`expr $SLEEP - 1 `
      done
    fi
  fi

  if [ $FORCE -eq 1 ]; then
    if [ -z "$CATALINA_PID" ]; then
      echo "Kill failed: \$CATALINA_PID not set"
    else
      if [ -f "$CATALINA_PID" ]; then
        echo "Killing: `cat $CATALINA_PID`"
        kill -9 `cat $CATALINA_PID`
        rm $CATALINA_PID
      fi
    fi
  fi

elif [ "$1" = "version" ] ; then

    "$_RUNJAVA"   \
      -classpath "$CATALINA_HOME/lib/catalina.jar" \
      org.apache.catalina.util.ServerInfo

else

  echo "Usage: catalina.sh ( commands … )"
  echo "commands:"
  if $os400; then
    echo "  debug             Start Catalina in a debugger (not available on OS400)"
    echo "  debug -security   Debug Catalina with a security manager (not available on OS400)"
  else
    echo "  debug             Start Catalina in a debugger"
    echo "  debug -security   Debug Catalina with a security manager"
  fi
  echo "  jpda start        Start Catalina under JPDA debugger"
  echo "  run               Start Catalina in the current window"
  echo "  run -security     Start in the current window with security manager"
  echo "  start             Start Catalina in a separate window"
  echo "  start -security   Start in a separate window with security manager"
  echo "  stop              Stop Catalina, waiting up to 5 seconds for the process to end"
  echo "  stop n            Stop Catalina, waiting up to n seconds for the process to end"
  echo "  stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running"
  echo "  stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running"
  echo "  version           What version of tomcat are you running?"
  echo "Note: Waiting for the process to end and use of the -force option require that \$CATALINA_PID is defined"
  exit 1

fi
Setting JAVA_OPTS value didn't solve the problem of permGen. Smiley Sad