Changeset 26495 for main


Ignore:
Timestamp:
2012-11-21T18:57:45+13:00 (11 years ago)
Author:
ak19
Message:

Added target to allow tomcat to be started up in debug mode which will allow it to be debugged in Eclipse. Still need to add the instructions for setting Eclipse up to the wiki. But these instructions are based on http://www.wikijava.org/wiki/Debugging_a_servlet_with_tomcat_and_Eclipse_tutorial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r26433 r26495  
    10831083    <!-- need to edit the config file, or do we get the user to do this???-->
    10841084  </target>
     1085
    10851086 
     1087  <!-- This target runs tomcat's "bin/catalina.bat(.sh) jpda start"
     1088       to allow debugging the running GS3 server in Eclipse. See the instructions at
     1089       http://www.wikijava.org/wiki/Debugging_a_servlet_with_tomcat_and_Eclipse_tutorial
     1090       on how to use this with eclipse
     1091    -->
     1092  <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="init" if="tomcat.islocal">
     1093    <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
     1094    <property name="tomcat.path" refid="local.tomcat.path"/>
     1095
     1096    <if><bool>
     1097    <isset property="fedora.maxpermsize"/></bool>
     1098      <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M ${fedora.maxpermsize}"/>
     1099      <else>
     1100    <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
     1101      </else>
     1102    </if>
     1103
     1104    <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
     1105    <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
     1106   
     1107    <exec executable="${catalina.home}/bin/catalina.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
     1108      <arg value="jpda" />
     1109      <arg value="start" />
     1110      <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
     1111      <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
     1112      <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
     1113      <env key="PATH" path="${tomcat.path}"/>
     1114      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
     1115      <env key="CATALINA_HOME" value="${catalina.home}"/>
     1116      <env key="CLASSPATH" path="${tomcat.classpath}"/>
     1117      <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
     1118      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
     1119      <env key="WNHOME" path="${wn.home}"/>
     1120      <env key="FEDORA_HOME" path="${fedora.home}"/>
     1121    </exec>
     1122    <exec executable="${catalina.home}/bin/catalina.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
     1123      <arg value="jpda" />
     1124      <arg value="start" />
     1125      <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
     1126      <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
     1127      <env key="GSDLOS" value="windows"/>
     1128      <env key="GSDL3HOME" value="${basedir}"/>
     1129      <env key="Path" path="${tomcat.path}"/>
     1130      <env key="PATH" path="${tomcat.path}"/>
     1131      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
     1132      <env key="CATALINA_HOME" value="${catalina.home}"/>
     1133      <env key="CLASSPATH" path="${tomcat.classpath}"/>
     1134      <env key="FEDORA_HOME" path="${fedora.home}"/>
     1135    </exec>
     1136    <!-- wait for the server to startup in case other targets need it running -->
     1137    <waitfor maxwait="5" maxwaitunit="second">
     1138      <and>
     1139        <socket server="${tomcat.server}" port="${tomcat.port}"/>
     1140        <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
     1141      </and>
     1142    </waitfor>
     1143  </target> 
    10861144 
    10871145
Note: See TracChangeset for help on using the changeset viewer.