Changeset 3916

Show
Ignore:
Timestamp:
10/10/08 18:37:36 (4 years ago)
Author:
mtld
Message:

added webapp build mode, webapp reloading support, Spring-ApplicationContext? reloading support, Tomcat startup-configuration

Location:
trunk/pfixcore
Files:
13 added
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/pfixcore/ChangeLog

    r3915 r3916  
     12008-10-08  Martin Leidig <mleidig@schlund.de> 
     2 
     3        Added support for Webapp reloading and Spring application context 
     4        refreshing. Reloading/refreshing can be done via JMX. You can either 
     5        use a JMX client of your choice, like jconsole, or you can use the 
     6        reload.sh and refresh.sh scripts.  
     7 
     8        Added new build mode, which doesn't configure the classes and libraries  
     9        to be loaded with Tomcat's shared classloader, but with the respective 
     10        WebappClassLoader. This is simply done by making symbolic links from the  
     11        WEB-INF directories. Building in this mode also activates Tomcat's session 
     12        serialization mechanism, i.e. if data stored in the session (like 
     13        ContextResources or session beans) is serializable, you can reload 
     14        your application without losing state (limited by the known boundaries 
     15        of the Java serialization mechanism). This build mode can be enabled by  
     16        adding 'webappmode=true' to the build.properties file. 
     17 
     18        Added support for configuring Tomcat at startup time. Thus you can 
     19        determine which projects/hosts should be started without having to 
     20        call ant. Therefor you have to create the property file 
     21        "startup.properties" in the Pustefix root directory and add the  
     22        property "projects". The property expects a space-separated list of  
     23        projectnames as value.  
     24 
     25        Added: 
     26        * src/org/pustefixframework/admin/mbeans/WebappAdmin.java: implements 
     27        webapp reloading using Tomcat's WebModule JMX bean and Spring- 
     28        ApplicationContext reloading using the injected PustefixWebApplicationContext 
     29        * src/org/pustefixframework/admin/mbeans/WebappAdminMBean.java: 
     30        exposes reload and refresh method for JMX usage 
     31        * src/org/pustefixframework/config/project/parser/WebappAdminParsingHandler.java: 
     32        register WebappAdmin bean 
     33        * src/org/pustefixframework/admin/WebappAdminClient.java: commandline 
     34        client for reloading/refreshing, which uses local JMX 
     35        * src/org/pustefixframework/tools/TomcatStartupConfigurator.java: 
     36        creates server-runtime.xml from server.xml and removes inactive hosts 
     37        * reload.sh: script that triggers webapp reloading 
     38        * skel/reload.sh 
     39        * refresh.sh: script that triggers ApplicationContext refreshing 
     40        * skel/refresh.sh 
     41        * startup.properties: example TomcatStartupConfigurator properties 
     42        file 
     43        * skel/startup.properties 
     44        * src/de/schlund/pfixcore/example/TestData.java: added bean for 
     45        testing DI and reloading/refreshing in the sample application 
     46 
     47        Modified: 
     48        * src/org/pustefixframework/http/AbstractPustefixRequestHandler.java: 
     49        add property for injected WebappAdmin bean and call ApplicationContext refreshing 
     50        * src/org/pustefixframework/config/project/parser/PustefixContextXMLRequestHandlerParsingHandler.java: 
     51        inject WebappAdmin bean into PustefixContextXmlRequestHandler 
     52        * src/de/schlund/pfixcore/example/ContextAdultInfo.java: made class 
     53        Serializable to test webapp reloading 
     54        * res/META-INF/org/pustefixframework/config/project/parser/project-config.xml: 
     55        added ParsingHandler for WebappAdmin, added customization support for 
     56        further elements 
     57        * projects/core/build/create_serverxml.xsl: added webappmode and 
     58        webapps parameters. If webapps is set, only Hosts for these webapps 
     59        are created. If webappmode is true, session management and symbolic 
     60        linking support is enabled. 
     61        * projects/core/schema/context-xml-service-config.xsd: added 
     62        definition for optional bean-ref attribute (at output resources) 
     63        * skel/build-skel.xml: create links to shared classes/lib in webapp 
     64        mode to webapp-classes/webapp-lib instead of classes/lib and link 
     65        from WEB-INF/classes WEB-INF/lib of every webapp 
     66        * projects/sample1/conf/spring.xml: added test beans 
     67        * projects/sample1/conf/config.conf.xml: added test bean to output 
     68        * startTomcat.sh: increase -mx and MaxPermSize 
     69 
    1702008-10-06  Tobias Fehrenbach <tobias.fehrenbach@1und1.de> 
    271 
  • trunk/pfixcore/projects/core/build/create_serverxml.xsl

    r3900 r3916  
    1313  <xsl:param name="commonprojectsfile"/> 
    1414  <xsl:param name="customizationinfo"/> 
     15  <xsl:param name="webappmode">false</xsl:param> 
     16  <xsl:param name="webapps"/> 
    1517   
    1618  <xsl:include href="create_lib.xsl"/> 
     
    139141      </xsl:choose> 
    140142    </xsl:variable> 
    141     <xsl:if test="$active = 'true'"> 
    142       <Host xmlValidation="false" unpackWARs="false" autoDeploy="false"> 
     143    <xsl:variable name="applist" select="concat(' ',translate($webapps,',',' '),' ')"/> 
     144    <xsl:if test="$active = 'true' and ( $webapps = '' or contains($applist,p:project/p:name/text()) )"> 
     145      <Host xmlValidation="false" unpackWARs="false" deployOnStartup="false" autoDeploy="false"> 
    143146        <xsl:attribute name="debug"><xsl:value-of select="$debug"/></xsl:attribute> 
    144147        <xsl:attribute name="name"> 
     
    226229      <xsl:attribute name="docBase"><xsl:if test="$hostbased='true'">../</xsl:if><xsl:value-of select="$docBase"/></xsl:attribute> 
    227230      <xsl:attribute name="debug"><xsl:value-of select="$debug"/></xsl:attribute> 
     231      <xsl:if test="$webappmode='true'"> 
     232        <xsl:attribute name="allowLinking">true</xsl:attribute> 
     233      </xsl:if> 
    228234      <!-- switch off session serialization --> 
    229       <Manager  pathname=""/> 
     235      <xsl:choose> 
     236        <xsl:when test="$webappmode='true'"> 
     237          <Manager/> 
     238        </xsl:when> 
     239        <xsl:otherwise> 
     240          <Manager  pathname=""/> 
     241        </xsl:otherwise> 
     242      </xsl:choose> 
    230243      <xsl:if test="$staticDocBase and not($staticDocBase = '')"> 
    231244        <Parameter name="staticDocBase" value="{$staticDocBase}"/> 
  • trunk/pfixcore/projects/core/schema/context-xml-service-config.xsd

    r3876 r3916  
    616616                <xs:element name="resource" minOccurs="0" maxOccurs="unbounded"> 
    617617                  <xs:complexType> 
    618                     <xs:attribute name="class" use="required"/> 
     618                    <xs:attribute name="class" use="optional"/> 
    619619                    <xs:attribute name="node" use="required"/> 
     620                    <xs:attribute name="bean-ref" use="optional"/> 
    620621                  </xs:complexType> 
    621622                </xs:element> 
  • trunk/pfixcore/projects/sample1/conf/config.conf.xml

    r3873 r3916  
    115115        <wrapper prefix="prefix" class="de.schlund.pfixcore.example.iwrapper.IndexedTest" /> 
    116116      </input> 
     117      <output> 
     118        <resource node="adultinfo" class="de.schlund.pfixcore.example.ContextAdultInfo" /> 
     119        <resource node="testdata" bean-ref="testdata"/> 
     120      </output> 
    117121    </default> 
    118122    <variant name="foo:bar:baz"> 
  • trunk/pfixcore/projects/sample1/conf/spring.xml

    r3868 r3916  
    44       xmlns:aop="http://www.springframework.org/schema/aop" 
    55       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> 
     6 
     7  <bean id="testdata" class="de.schlund.pfixcore.example.TestData" scope="session"> 
     8    <property name="text" value="foo"/> 
     9    <aop:scoped-proxy/> 
     10    <property name="data" ref="global_testdata"/> 
     11  </bean> 
     12   
     13  <bean id="global_testdata" class="de.schlund.pfixcore.example.TestData"> 
     14    <property name="text" value="bar"/> 
     15    <!-- <property name="foo" value="xxx"/>--> 
     16  </bean> 
    617 
    718<!--    
  • trunk/pfixcore/res/META-INF/org/pustefixframework/config/project/parser/project-config.xml

    r3901 r3916  
    2020  </handler> 
    2121   
    22    <!-- Adds handler mapping bean --> 
     22  <!-- Adds SessionAdmin bean --> 
    2323  <handler class="org.pustefixframework.config.project.parser.SessionAdminParsingHandler"> 
    2424    <match>/p:project-config/p:application</match> 
    2525  </handler> 
    2626   
     27  <!-- Adds WebappAdmin bean --> 
     28  <handler class="org.pustefixframework.config.project.parser.WebappAdminParsingHandler"> 
     29    <match>/p:project-config//p:application</match> 
     30  </handler> 
     31   
    2732  <!-- Creates PerfLogging bean --> 
    2833  <handler class="org.pustefixframework.config.project.parser.PerfLoggingParsingHandler"> 
    29     <match>/p:project-config/p:perflogging</match> 
     34    <match>/p:project-config//p:perflogging</match> 
    3035  </handler> 
    3136   
    3237  <!-- Creates AuthAdmin bean --> 
    3338  <handler class="org.pustefixframework.config.project.parser.AuthAdminParsingHandler"> 
    34     <match>/p:project-config/p:authadmin</match> 
     39    <match>/p:project-config//p:authadmin</match> 
    3540  </handler> 
    3641   
    3742  <!-- Creates TestRecording bean --> 
    3843  <handler class="org.pustefixframework.config.project.parser.TestRecordingParsingHandler"> 
    39     <match>/p:project-config/p:testrecording</match> 
     44    <match>/p:project-config//p:testrecording</match> 
    4045  </handler> 
    4146   
     
    5762   
    5863  <handler id="org.pustefixframework.config.customization.WhenParsingHandler" class="org.pustefixframework.config.customization.CustomizationWhenParsingHandler"> 
     64    <match>/p:project-config/p:choose/p:when</match> 
    5965    <match>/p:project-config/p:application/p:choose/p:when</match> 
    6066    <match>/p:project-config/p:xml-generator/p:choose/p:when</match> 
     
    6268   
    6369  <handler id="org.pustefixframework.config.customization.OtherwiseParsingHandler" class="org.pustefixframework.config.customization.CustomizationOtherwiseParsingHandler"> 
     70    <match>/p:project-config/p:choose/p:otherwise</match> 
    6471    <match>/p:project-config/p:application/p:choose/p:otherwise</match> 
    6572    <match>/p:project-config/p:xml-generator/p:choose/p:otherwise</match> 
  • trunk/pfixcore/skel/build-skel.xml

    r3915 r3916  
    4040  <property name="standalone.tomcat"        value="false"/> 
    4141  <property name="portbase.tomcat"          value="8000"/> 
     42  <property name="webappmode"               value="false"/> 
     43  <property name="webapps"                  value=""/>  
    4244 
    4345  <property name="pat.pfixcore_jar"         value="pfixcore-*.jar"/> 
     
    105107    <condition property="fqdn"     value="${machine}"> 
    106108      <not><isset property="dnsdomainname"/></not> 
     109    </condition> 
     110    <condition property="in.webapp.mode"> 
     111      <equals arg1="${webappmode}" arg2="true"/> 
    107112    </condition> 
    108113  </target> 
     
    228233 
    229234  <target name="compile-xml" 
    230           depends="buildtime-props, scgenerate, web_xml, autodeploy, pfixlog_xml, apache_conf, jk_conf, ajp_conf, workers_prop, server_xml, webservice" 
     235          depends="buildtime-props, scgenerate, web_xml, webapp-setup, autodeploy, pfixlog_xml, apache_conf, jk_conf, ajp_conf, workers_prop, server_xml, webservice" 
    231236          description="performs xslt transformations in dir.projects" 
    232237          /> 
     
    289294 
    290295  <target name="installjars" depends="tomcat.dir.opt"> 
     296    <condition property="shared_lib_dirname" value="webapp-lib" else="lib"> 
     297        <isset property="in.webapp.mode"/> 
     298    </condition> 
     299    <condition property="shared_classes_dirname" value="webapp-classes" else="classes"> 
     300        <isset property="in.webapp.mode"/> 
     301    </condition> 
     302    <condition property="old_shared_lib_dirname" value="lib" else="webapp-lib"> 
     303        <isset property="in.webapp.mode"/> 
     304    </condition> 
     305    <condition property="old_shared_classes_dirname" value="classes" else="webapp-classes"> 
     306        <isset property="in.webapp.mode"/> 
     307    </condition> 
     308    <exec executable="sh"> 
     309      <arg line="-c &quot;[ -L ${dir.tomcat}/shared/${old_shared_classes_dirname} ] &amp;&amp; rm -rf ${dir.tomcat}/shared/${old_shared_classes_dirname}; [ -e ${dir.tomcat}/shared/${old_shared_lib_dirname} ] &amp;&amp; rm -rf ${dir.tomcat}/shared/${old_shared_lib_dirname}&quot;"/> 
     310    </exec> 
    291311    <!-- Setting absolute links instead of relative to avoid extra property for dir.build 
    292312         as ${dir.build} is specified as location it always resolves to an absolute path; 
    293313         does not work for filenames containing spaces --> 
    294     <echo level="verbose" message="Setting symlink to ${dir.build} as ${dir.projects}/servletconf/tomcat/shared/classes"/> 
     314    <echo level="verbose" message="Setting symlink to ${dir.build} as ${dir.projects}/servletconf/tomcat/shared/${shared_classes_dirname}"/> 
    295315    <exec executable="sh"> 
    296       <arg line="-c &quot;[ -e ${dir.projects}/servletconf/tomcat/shared/classes ] &amp;&amp; rm -fr ${dir.projects}/servletconf/tomcat/shared/classes ; ln -s  ${dir.build} ${dir.projects}/servletconf/tomcat/shared/classes&quot;"/> 
     316      <arg line="-c &quot;[ -e ${dir.projects}/servletconf/tomcat/shared/${shared_classes_dirname} ] &amp;&amp; rm -fr ${dir.projects}/servletconf/tomcat/shared/${shared_classes_dirname} ; ln -s  ${dir.build} ${dir.projects}/servletconf/tomcat/shared/${shared_classes_dirname}&quot;"/> 
    297317    </exec> 
    298318    <!-- As task delete does not delete symbolic links, deleting symlinks using native tools. --> 
    299319    <!-- Deleting symlinks pointing to non existent files, assuming jar files --> 
    300320    <!-- replaced by new versions (with new filenames) do not exist anymore --> 
     321    <mkdir dir="${dir.projects}/servletconf/tomcat/shared/${shared_lib_dirname}"/> 
    301322    <exec executable="find" os="Linux, Mac OS X"> 
    302       <arg file="${dir.projects}/servletconf/tomcat/shared/lib"/> 
     323      <arg file="${dir.projects}/servletconf/tomcat/shared/${shared_lib_dirname}"/> 
    303324      <arg line="-iname *.jar -a -type l -exec rm -v {} ;"/> 
    304325    </exec> 
    305326    <echo level="verbose">Creating symlinks in tomcat's lib directory</echo> 
    306327    <pathconvert property="cp.property" refid="cp.libs" pathsep=","/> 
    307     <apply executable="ln" dir="${dir.projects}/servletconf/tomcat/shared/lib" failonerror="true" verbose="true" 
     328    <apply executable="ln" dir="${dir.projects}/servletconf/tomcat/shared/${shared_lib_dirname}" failonerror="true" verbose="true" 
    308329      type="file">  <!-- type file: to make sure that directories that might be added to cp.libs by accident are not passed to ln --> 
    309330      <arg value="-s"/> 
     
    538559    <antcall target="scmerge-modules"/> 
    539560  </target> 
    540   
     561 
     562  <target name="webapp-setup" depends="webapp-removelinks, webapp-createlinks"/> 
     563 
     564  <target name="webapp-createlinks" depends="ant-tasks" if="in.webapp.mode"> 
     565    <exec executable="sh"> 
     566      <arg line="-c &quot;for f in `find ${dir.projects}/servletconf/tomcat/webapps -maxdepth 2 -type d -name 'WEB-INF'`; do [ ! -e $f/classes ] &amp;&amp; ln -s ${dir.projects}/servletconf/tomcat/shared/webapp-classes $f/classes; [ ! -e $f/lib ] &amp;&amp; ln -s ${dir.projects}/servletconf/tomcat/shared/webapp-lib $f/lib; done&quot;"/> 
     567    </exec> 
     568  </target> 
     569 
     570  <target name="webapp-removelinks" depends="ant-tasks" unless="in.webapp.mode"> 
     571    <exec executable="sh"> 
     572      <arg line="-c &quot;for f in `find ${dir.projects}/servletconf/tomcat/webapps -maxdepth 2 -type d -name 'WEB-INF'`; do [ -L $f/classes ] &amp;&amp; rm $f/classes; [ -L $f/lib ] &amp;&amp; rm $f/lib; done&quot;"/> 
     573    </exec> 
     574  </target> 
     575 
    541576  <target name="-extract-jar-modules" depends="ant-tasks" description="Extracts resource data from JAR libraries"> 
    542577    <!-- This target should only be called by extract-modules -->   
     
    829864  </target> 
    830865 
    831   <target name="server_xml" depends="ant-tasks" description="creates servletconf/tomcat/conf/server.xml from servletconf/projects.xml with core/build/create_serverxml.xsl"> 
     866  <target name="server_xml-check"> 
     867    <condition property="server_xml.outdated"> 
     868      <and> 
     869        <available file="build.properties"/> 
     870        <available file="${dir.tomcat}/conf/server.xml"/> 
     871        <uptodate targetfile="build.properties" srcfile="${dir.tomcat}/conf/server.xml"/> 
     872      </and> 
     873    </condition> 
     874  </target> 
     875 
     876  <target name="server_xml-force" if="server_xml.outdated"> 
     877    <delete file="${dir.tomcat}/conf/server.xml"/> 
     878  </target> 
     879 
     880  <target name="server_xml" depends="ant-tasks,server_xml-check,server_xml-force" description="creates servletconf/tomcat/conf/server.xml from servletconf/projects.xml with core/build/create_serverxml.xsl"> 
    832881    <pfx-server-config 
    833882      basedir="${dir.projects}" 
     
    840889      <param name="standalone" expression="${standalone.tomcat}"/> 
    841890      <param name="portbase"   expression="${portbase.tomcat}"/> 
     891      <param name="webappmode" expression="${webappmode}"/> 
     892      <param name="webapps"    expression="${webapps}"/> 
    842893    </pfx-server-config> 
    843894  </target> 
  • trunk/pfixcore/skel/startTomcat.sh

    r1405 r3916  
    11#!/bin/sh 
    22 
    3 if [ "$1" == "-d" ] ; then  
     3if [ "x$1" = "x-d" ] ; then  
    44   cmd="jpda run" 
    55else 
     
    77fi 
    88 
    9 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib/jni/build 
    10 export JAVA_OPTS="-mx200M" 
     9export JAVA_OPTS="-Dcom.sun.management.jmxremote -mx300M -XX:MaxPermSize=128m" 
    1110echo "---------------------------" 
    1211echo "catalina.sh $cmd" 
     
    1716echo "---------------------------" 
    1817 
     18if [ -e startup.properties ]; then 
     19  java -cp build:`find lib -name "*pfixcore*.jar" -printf "%p:"` org.pustefixframework.tools.TomcatStartupConfigurator startup.properties projects/servletconf/tomcat/conf/server.xml projects/servletconf/tomcat/conf/server-runtime.xml 
     20fi 
     21if [ -e projects/servletconf/tomcat/conf/server-runtime.xml ]; then 
     22  echo "Use configuration created at startup from 'projects/servletconf/tomcat/conf/server-runtime.xml'" 
     23  cmd="$cmd -config conf/server-runtime.xml" 
     24fi 
    1925cd ./projects/servletconf/tomcat/ 
    20 LANG=C ./bin/catalina.sh $cmd 
    21  
    22  
    23  
     26LANG=C ./bin/catalina.sh $cmd  
  • trunk/pfixcore/src/de/schlund/pfixcore/example/ContextAdultInfo.java

    r3738 r3916  
    2020package de.schlund.pfixcore.example; 
    2121 
     22import java.io.Serializable; 
    2223import java.util.Date; 
    2324import java.util.HashMap; 
     
    3839 */ 
    3940 
    40 public class ContextAdultInfo { 
     41public class ContextAdultInfo implements Serializable { 
     42     
     43    private static final long serialVersionUID = -7113285838799932518L; 
     44     
     45    private transient Logger LOG = Logger.getLogger(ContextAdultInfo.class); 
     46     
    4147    private Boolean adult = null; 
    4248    private Date date = null; 
    4349    private HashMap<String, String> test  = new HashMap<String, String>(); 
    44     private final static Logger LOG = Logger.getLogger(ContextAdultInfo.class); 
    4550     
    4651    public void setIndexedTest(HashMap<String, String> inmap) { 
  • trunk/pfixcore/src/org/pustefixframework/config/project/parser/PustefixContextXMLRequestHandlerParsingHandler.java

    r3908 r3916  
    2525import java.util.Properties; 
    2626 
     27import org.pustefixframework.admin.mbeans.WebappAdmin; 
    2728import org.pustefixframework.config.Constants; 
    2829import org.pustefixframework.config.contextxmlservice.ContextXMLServletConfig; 
     
    126127            beanBuilder.addPropertyValue("testRecording", new RuntimeBeanReference(TestRecording.class.getName())); 
    127128        } 
     129        beanBuilder.addPropertyValue("webappAdmin", new RuntimeBeanReference(WebappAdmin.class.getName())); 
    128130        BeanDefinition beanDefinition = beanBuilder.getBeanDefinition(); 
    129131        BeanDefinitionHolder beanHolder = new BeanDefinitionHolder(beanDefinition, PustefixContextXMLRequestHandler.class.getName() + "#" + path); 
  • trunk/pfixcore/src/org/pustefixframework/http/AbstractPustefixRequestHandler.java

    r3899 r3916  
    4141 
    4242import org.apache.log4j.Logger; 
     43import org.pustefixframework.admin.mbeans.WebappAdmin; 
    4344import org.pustefixframework.config.contextxmlservice.ServletManagerConfig; 
    4445import org.pustefixframework.container.spring.http.UriProvidingHttpRequestHandler; 
     
    103104    private String handlerURI; 
    104105    private SessionAdmin sessionAdmin; 
     106    private WebappAdmin webappAdmin; 
    105107 
    106108    protected abstract ServletManagerConfig getServletManagerConfig(); 
     
    145147 
    146148    public void handleRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { 
     149         
     150        if(webappAdmin!=null) webappAdmin.refreshIfTriggered(); 
     151         
    147152        req.setCharacterEncoding(servletEncoding); 
    148153        res.setCharacterEncoding(servletEncoding); 
     
    11271132    } 
    11281133     
     1134    public void setWebappAdmin(WebappAdmin webappAdmin) { 
     1135        this.webappAdmin = webappAdmin; 
     1136    } 
     1137     
    11291138} 
  • trunk/pfixcore/startTomcat.sh

    r3469 r3916  
    77fi 
    88 
    9 export JAVA_OPTS="-mx200M" 
     9export JAVA_OPTS="-Dcom.sun.management.jmxremote -mx300M -XX:MaxPermSize=128m" 
    1010echo "---------------------------" 
    1111echo "catalina.sh $cmd" 
     
    1616echo "---------------------------" 
    1717 
     18if [ -e startup.properties ]; then 
     19  java -cp build:`find lib -name "*pfixcore*.jar" -printf "%p:"` org.pustefixframework.tools.TomcatStartupConfigurator startup.properties projects/servletconf/tomcat/conf/server.xml projects/servletconf/tomcat/conf/server-runtime.xml 
     20fi 
     21if [ -e projects/servletconf/tomcat/conf/server-runtime.xml ]; then 
     22  echo "Use configuration created at startup from 'projects/servletconf/tomcat/conf/server-runtime.xml'" 
     23  cmd="$cmd -config conf/server-runtime.xml" 
     24fi 
    1825cd ./projects/servletconf/tomcat/ 
    19 LANG=C ./bin/catalina.sh $cmd 
     26LANG=C ./bin/catalina.sh $cmd