Skip to Content.
Sympa Menu

perfsonar-dev - Re: [pS-dev] r1682 - in trunk/perfsonar/ant: . tcmp

Subject: perfsonar development work

List archive

Re: [pS-dev] r1682 - in trunk/perfsonar/ant: . tcmp


Chronological Thread 
  • From: Roman Lapacz <>
  • To: Uros Juvan <>, "" <>
  • Subject: Re: [pS-dev] r1682 - in trunk/perfsonar/ant: . tcmp
  • Date: Tue, 17 Oct 2006 10:38:40 +0200


Hi Uros,

very good idea to use XSLT in Ant script to add/remove an entry to/from web.xml file!

I had to make one small change in add-context-listener.xsl file. I had to commented xsl:text element

<!--<xsl:text>-->
<listener>
<listener-class>org.perfsonar.commons.container.listeners.StartupInitializer</listener-class>
</listener>
<!--</xsl:text>-->

because I was receiving the following problem:

add-context-listener:
[copy] Copying 1 file to /root/Download/dev/sonar-trunk-20061013/apache-tomcat-5.5.17/webapps/axis/WEB-INF
[style] Processing /root/Download/dev/sonar-trunk-20061013/apache-tomcat-5.5.17/webapps/axis/WEB-INF/web.xml to /root/Download/dev/sonar-trunk-20061013/apache-tomcat-5.5.17/webapps/axis/WEB-INF/web.xml.out
[style] Loading stylesheet /root/Download/dev/sonar-trunk-20061013/perfsonar-20061013/ant/add-context-listener.xsl
[style] root/Download/dev/sonar-trunk-20061013/perfsonar-20061013/ant/add-context-listener.xsl:16:19: Error! listener is not allowed in this position in the stylesheet!
[style] : Fatal Error! javax.xml.transform.TransformerException: ElemTemplateElement error: nodesAttrsDefault Cause: javax.xml.transform.TransformerException: ElemTemplateElement error: nodesAttrsDefault
[style] Failed to process /root/Download/dev/sonar-trunk-20061013/apache-tomcat-5.5.17/webapps/axis/WEB-INF/web.xml

BUILD FAILED
/root/Download/dev/sonar-trunk-20061013/perfsonar-20061013/ant/axis-deploy-targets.xml:89: Fatal error during transformation


After the change adding the listener entry works fine. I commited my changes in SVN. Please, check it. If you OK with this you could remove these two commented things.


Roman





wrote:
Author: uros
Date: 2006-10-16 11:26:50 -0400 (Mon, 16 Oct 2006)
New Revision: 1682

Added:
trunk/perfsonar/ant/add-context-listener.xsl
trunk/perfsonar/ant/rem-context-listener.xsl
Modified:
trunk/perfsonar/ant/axis-deploy-targets.xml
trunk/perfsonar/ant/tcmp/tcmp-axis-deploy-targets.xml
Log:
Two XSL rules added used for adding/removing <listener> rules to/from
AXIS web.xml file located in WEB-INF of axis deployment dir.

Added rules to axis-deploy-targets.xml for calling add/rem <listener>
transformation.



Added: trunk/perfsonar/ant/add-context-listener.xsl

Modified: trunk/perfsonar/ant/axis-deploy-targets.xml
===================================================================
--- trunk/perfsonar/ant/axis-deploy-targets.xml 2006-10-13 08:18:03 UTC (rev
1681)
+++ trunk/perfsonar/ant/axis-deploy-targets.xml 2006-10-16 15:26:50 UTC (rev
1682)
@@ -20,6 +20,7 @@
<property name="adminService"
value="http://${target.server}:${target.port}/axis/services/AdminService"; />
<property name="deployFile"
value="../${build}/${wsdd.path}/${wsdd.file.deploy}" />
<property name="undeployFile"
value="../${build}/${wsdd.path}/${wsdd.file.undeploy}" />
+ <property name="axisWebXml" value="${axis.home}/WEB-INF/web.xml" />
@@ -79,7 +80,29 @@
<copy file="${build}/perfSONAR-generic.jar"
todir="${axis.home}/WEB-INF/lib"/>
</target>
+ + <!-- Add service (un)initialization context listener class to AXIS web.xml -->
+ <target name="add-context-listener">
+ + <copy file="${axisWebXml}" tofile="${axisWebXml}.bak" overwrite="yes" />
+ + <style in="${axisWebXml}" out="${axisWebXml}.out" style="ant/add-context-listener.xsl" />
+ + <copy file="${axisWebXml}.out" tofile="${axisWebXml}" overwrite="yes" />
+ + + </target>
+ <!-- Remove service (un)initialization context listener class from AXIS web.xml -->
+ <target name="rem-context-listener">
+ + <copy file="${axisWebXml}" tofile="${axisWebXml}.bak" overwrite="yes" />
+ + <style in="${axisWebXml}" out="${axisWebXml}.out" style="ant/rem-context-listener.xsl" />
+ + <copy file="${axisWebXml}.out" tofile="${axisWebXml}" overwrite="yes" />
+ + </target>
+ -
</project>
\ No newline at end of file

Added: trunk/perfsonar/ant/rem-context-listener.xsl

Modified: trunk/perfsonar/ant/tcmp/tcmp-axis-deploy-targets.xml
===================================================================
--- trunk/perfsonar/ant/tcmp/tcmp-axis-deploy-targets.xml 2006-10-13
08:18:03 UTC (rev 1681)
+++ trunk/perfsonar/ant/tcmp/tcmp-axis-deploy-targets.xml 2006-10-16
15:26:50 UTC (rev 1682)
@@ -75,7 +75,7 @@
</target>
- <target name="deploy-tcmp" depends="copy-tcmp-jar"
+ <target name="deploy-tcmp" depends="copy-tcmp-jar, add-context-listener"
description="Deploys TC MP service">
<java classname="org.apache.axis.client.AdminClient">
<arg line="-l ${adminService} &quot;${deployFile}&quot;"/>
@@ -92,6 +92,7 @@
<classpath refid="classpath"/>
</java>
+ <antcall target="rem-context-listener" />
<antcall target="delete-jars-for-tcmp"/>
<delete file="${axis.home}/WEB-INF/lib/perfSONAR-generic.jar"/>



--

// PSNC, Poland
// phone: (+48 61) 858 20 24
// http://www.man.poznan.pl




Archive powered by MHonArc 2.6.16.

Top of Page