Re: JBoss WAR deployment

From: Sako (wolip..atos.de)
Date: Wed Mar 22 2006 - 09:06:20 EST

  • Next message: Pierre Bernard: "Re: JBoss WAR deployment"

    Hello Pierre,

    First of all to be honest, i have smart knowledge about ant framework and scripts.

    I tried your changes as the following
    1. replaced the <woapplication in build.xml as you added
    2. created the Web.xml file // changed the value in build.properties file webXML = true
    3. replaced the SSDD task in build.xml as you added.
    4. I didnt understand the point with the following part: // but cos i use windows, i thought this could work for me.
    75c75,77
    < WEBINFROOT/Resources/Java/

    ---
    > 
    > WEBINFROOT/HelloWorld.woa/Contents/Resources/Java/helloworld.jar
    > 
    84d85
    < WEBINFROOT/Resources/Java/helloworld.jar
    

    5.Then changed the WAR task in build.xml also as you added // Copy data from SSDD.

    I got the following error ----------------------------------------------------

    Buildfile: H:\workspace\WOWar\build.xml setProps: init.build: build.woapp: [woapplication] Installing WOWar in dist [woapplication] Copying 1395 files to H:\workspace\WOWar\dist\WOWar.woa\Contents\Frameworks [woapplication] Copied 138 empty directories to 3 empty directories under H:\workspace\WOWar\dist\WOWar.woa\Contents\Frameworks [copy bootstrap] Copying 1 file to H:\workspace\WOWar\dist\WOWar.woa [woapplication] 'Windows 2000' is some kind of windows, skipping chmod.

    ssdd: [mkdir] Created dir: H:\workspace\WOWar\dist\WOWar\WEB-INF\tlds [copy] Warning: web.xml modified in the future. [copy] Copying 1 file to H:\workspace\WOWar\dist\WOWar\WEB-INF [copy] Copying 1413 files to H:\workspace\WOWar\dist\WOWar\WEB-INF [copy] Copied 157 empty directories to 4 empty directories under H:\workspace\WOWar\dist\WOWar\WEB-INF [copy] Copying 1401 files to H:\workspace\WOWar\dist\WOWar\WEB-INF [copy] Copied 151 empty directories to 3 empty directories under H:\workspace\WOWar\dist\WOWar\WEB-INF [copy] Copying 16 files to H:\workspace\WOWar\dist\WOWar\WEB-INF\lib BUILD FAILED H:\workspace\WOWar\build.xml:151: H:\Library\WebObjects\Extensions not found. Total time: 4 minutes 34 seconds ----------------------------------------------------

    could you help here please?

    Regards.

    peaSakoe

    ----- Original Message ----- From: Pierre Bernard To: woproject-de..bjectstyle.org Sent: Tuesday, March 21, 2006 10:09 AM Subject: JBoss WAR deployment

    Hi!

    I just slaved days over getting Eclipse/WOLips to generate a WAR to JBoss' liking.

    Somehow the out-of-the-box WAR support in WOLips seems very broken. I ended up rewriting much of the involved Ant targets. Furthermore I had to patch the generated web.xml to get a classpath that NSBundle can work with.

    First, I had to add additional arguments to the WOApplication task:

    <woapplication name="${project.name}" stdFrameworks="false" destDir="${dest.dir}" customInfoPListContent="${customInfoPListContent}" principalClass="${principalClass}" webXML="${webXML}" webXML_CustomContent="${webXML_CustomContent}" webXML_WOAINSTALLROOT="/tmp/${project.name}.dst/Library/WebObjects/Applications/" webXML_WOtaglib="WOtaglib_1_0.tld" webXML_WOAppMode="Development">

    ...

    <frameworks root="${wo.wosystemroot}" embed="true"> <patternset> <includesfile name="woproject/ant.frameworks.wo.wosystemroot"/> </patternset> </frameworks> <frameworks root="${wo.wolocalroot}" embed="true"> <patternset> <includesfile name="woproject/ant.frameworks.wo.wolocalroot"/> </patternset> </frameworks> <frameworks root="${user.home}" embed="true"> <patternset> <includesfile name="woproject/ant.frameworks.user.home"/> </patternset> </frameworks>

    ...

    </woapplication>

    I modified the ssdd target as follows:

    <target name="ssdd"> <mkdir dir="${dest.dir}/${project.name}/WEB-INF/tlds"/> <copy todir="${dest.dir}/${project.name}/WEB-INF/"> <fileset dir="${dest.dir}/${project.name}.woa/Contents/"> <include name="web.xml"/> </fileset> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF/"> <fileset dir="."> <include name="LICENSE"/> </fileset> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF/"> <fileset dir="${dest.dir}"> <include name="${project.name}.woa/**"/> </fileset> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF"> <fileset dir="${dest.dir}/${project.name}.woa/Contents"> <include name="Frameworks/**"/> <include name="Resources/**"/> </fileset> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF/lib"> <fileset dir="${dest.dir}/${project.name}/WEB-INF"> <include name="**/Resources/**/*.jar"/> </fileset> <flattenmapper /> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF/lib"> <fileset dir="/Library/WebObjects/Extensions"> <include name="*.jar"/> <exclude name="servlet.jar"/> </fileset> <flattenmapper /> </copy> <copy todir="${dest.dir}/${project.name}/WEB-INF/tlds"> <fileset dir="${wo.wosystemroot}/Library/Frameworks/JavaWOJSPServlet.framework/Resources/"> <include name="WOtaglib_1_0.tld"/> </fileset> </copy> <fixcrlf srcdir="${dest.dir}/${project.name}/WEB-INF/" eol="unix" includes="web.xml" /> <patch originalfile="${dest.dir}/${project.name}/WEB-INF/web.xml" patchfile="web.diff" ignorewhitespace="true"/> </target>

    The last two steps patch the classpath. First we neet to strip Mac line endings for the patch task to work. The patch file looks like this:

    75c75,77 < WEBINFROOT/Resources/Java/ --- > > WEBINFROOT/HelloWorld.woa/Contents/Resources/Java/helloworld.jar > 84d85 < WEBINFROOT/Resources/Java/helloworld.jar

    BTW, having to work with a patch file is UGLY. I guess WOLips should be updated to generate a valid classpath.

    This changes the way we refer to the main JAR in a way that allows NSBundle to recognize it as a bundle.

    The WAR target could be greatly simplified by basing the WAR off the SSDD:

    <target name="war" depends="ssdd"> <war destfile="${dest.dir}/${project.name}.war" webxml="${dest.dir}/${project.name}/WEB-INF/web.xml" basedir="${dest.dir}/${project.name}"> <lib dir="${wo.wosystemroot}/Library/Frameworks/JavaWOJSPServlet.framework/WebServerResources/Java/"> <include name="JavaWOJSPServlet_client.jar"/> </lib> </war> <copy todir="/tmp/${project.name}.dst/Library/WebObjects/Applications/"> <fileset dir="${dest.dir}"> <include name="${project.name}.woa/**"/> </fileset> </copy> </target>

    All this buys me a self-contained WAR file with all frameworks embedded. This WAR works fine on JBoss 4.

    Pierre.



    This archive was generated by hypermail 2.0.0 : Wed Mar 22 2006 - 09:07:22 EST