Edd Grant (EdD) :: Code, Compose, Bike, Brew etc ... though not necessarily in that order
 

Sep 02, 2008

 

When you create an SJSAS Instance debugging is disabled by default, if like me you are often rebuilding your appserver and use appserver debugging a lot then this can become a real pain since an instance restart is required after every rebuild in order to switch debugging on. I recently discovered that you can programatically enable/ disable debugging which means that it is possible to switch debugging on in your appserver build script so that it is ready for you to connect as soon as you have built your appserver.

The ASADMIN command for this is as follows, you'll need to replace the bits in triangular braces with your own values e.g. <eddsBox> might become localhost. Note that this command doesn't alter the default port (9009) since I have encountered issues with SJSAS 8.1 when altering the port.

asadmin set --echo=true --host <eddsBox> --port <MydomainAdminPort> --passwordfile <path to pwd file>  --user <admin user> <instance-name>-config.java-config.debug-enabled=true

In my case this can be translated to the following Ant target:

<target name="enable-debug-on-instance" depends="-init"
    description="Enables debugging on the SJSAS instance - used for development purposes only.">
    <exec dir="${basedir}" executable="${asadmin-executable}" failonerror="true"
      failifexecutionfails="true">
      <arg value="set"/>
      <arg value="--echo=true"/>
      <arg value="--host"/>
      <arg value="${appserver-host}"/>
      <arg value="--port"/>
      <arg value="${appserver-domain-admin-port}"/>
      <arg value="--passwordfile"/>
      <arg value="${appserver-passwordfile}"/>
      <arg value="--user"/>
      <arg value="${appserver-admin-user}"/>
      <arg value="${appserver-instance}-config.java-config.debug-enabled=true"/>
    </exec>
  </target>

EdD


Posted at 10:56AM Sep 02, 2008 by EdD in Java
Comments[0]
Link to this post: Add this to delicious etc.
Trackback URL for this entry
Comments:

Post a Comment:
  • HTML Syntax: Allowed