Yes, I've encountered that error in the past, too. Simply commenting out the following line in WEB-INF/lps/server/build.xml fixes this issue, at least this was the case for me (that's in the "compile" <target>):
<!-- <exclude name="${pkg.flash}/context/**" /> -->

Comparing my local build.xml to svn-base reveals I also needed to include the EDU/oswego/* package manually for the "compile" <target>, maybe that's related to each other, maybe not.


Anyone else seeing this?  Sometimes randomly my builds fail with this message.  
If I `ant clean` I can build again, but I have no idea what it is telling me:

>/  lzl:
/>/       [echo] Compiling 
/Users/ptw/OpenLaszlo/trunk-devo/lps/includes/lfc/lzpreloader.lzl
/>/       [java] Exception in thread "main" java.lang.NoClassDefFoundError: 
org/openlaszlo/iv/flash/context/Context
/>/       [java]     at org.openlaszlo.sc.lzsc.compile(lzsc.java:140)
/>/       [java]     at org.openlaszlo.sc.lzsc.compile(lzsc.java:357)
/>/       [java]     at org.openlaszlo.sc.Main.main(Main.java:22)
/>/       [java] Caused by: java.lang.ClassNotFoundException: 
org.openlaszlo.iv.flash.context.Context
/>/       [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
/>/       [java]     at java.security.AccessController.doPrivileged(Native 
Method)
/>/       [java]     at 
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
/>/       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
/>/       [java]     at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
/>/       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
/>/       [java]     ... 3 more
/>/
/>/  BUILD FAILED
/>/  /Users/ptw/OpenLaszlo/trunk-devo/build.xml:618: The following error 
occurred while executing this line:
/>/  /Users/ptw/OpenLaszlo/trunk-devo/WEB-INF/lps/lfc/build.xml:92: The 
following error occurred while executing this line:
/>/  /Users/ptw/OpenLaszlo/trunk-devo/WEB-INF/lps/lfc/build.xml:79: Java 
returned: 1
/
<?xml version="1.0"?>

<project name="server" default="build" basedir=".">
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2010 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

  <description>
      This is the build file for the LPS server subproject.
  </description>

  <import file="../../../build-tools/build-opt.xml" />

  <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>

  <property name="packages" value="org.openlaszlo.*.*" />

<!--
This comment summarizes the path and package property usage and the 
compilation pipeline for each ant target and each major file transformation. 

The items in curly braces show properties and/or 
pathnames before and after the change that untangled the 1.3 and 1.4
sources and removed the secondary sources from the build file.

Transform; input-path ==to== output-path
{Old Package Path Property and Path ==to== New Package Path Property and Path}

Target [css-parser]
javacc; ./src/org/openlaszlo/css/CSSParser.jj
                ==to== 
                ./build.1.4/src/org/openlaszlo/css/*.java
                {build.java ==changed to== build.java.1.4}

Target [sc-parser]
jjtree; ./sc/src/org/openlaszlo/sc/Parser.jjt 
               ==to== 
               ./build.1.4/src/org/openlaszlo/sc/parser/Parser.jj

javacc; ./buildJJ/src/org/openlaszlo/sc/parser/Parser.jj
                ==to== 
                (Java 1.4 jjt sources)
                ./build.1.4/src/org/openlaszlo/sc/parser/*.java

copy;   ./sc/src/org/openlaszlo/sc/parser/*.java
                ==to== 
                ./build.1.4/src/org/openlaszlo/sc/parser
                {sc.build.java = build/src/org/openlaszlo/sc 
                ==changed to==
                sc.build.java.1.4 = build.1.4/src/org/openlaszlo/sc}

javac (1.4);     
      ${java.1.4.srcs} = 
      ${buildsrc.1.4} : ${src}:${jgen.src}:${jjt.src} =
      ./build.1.4/src : ./src : ./jgenerator-2.2/src : ./build.1.4/src/org/openlaszlo/sc/parser
      ==to== 
      ./build 
-->
  <!-- Package Path Properties: properties that define 
       all the package-path strings in the build. -->
  <property name="pkg.all" value="org/openlaszlo/*" />
  <property name="pkg.css" value="org/openlaszlo/css" />
  <property name="pkg.css.parser" value="org/openlaszlo/css/parser" />
  <property name="pkg.flash" value="org/openlaszlo/iv/flash" />
  <property name="pkg.i18n" value="org/openlaszlo/i18n" />
  <property name="pkg.js2doc" value="org/openlaszlo/js2doc" />
  <property name="pkg.sc" value="org/openlaszlo/sc" />
  <property name="pkg.sc.parser" value="org/openlaszlo/sc/parser" />
  <property name="pkg.server" value="org/openlaszlo/server" />
  <property name="pkg.test" value="org/openlaszlo/test" />
  <property name="pkg.xml" value="org/openlaszlo/xml" />

  <!-- -->
  <property name="edu.oswego" value="EDU/oswego/*" />

  <!-- Source Directories -->
  <property name="src" value="./src" />
  <property name="build" value="./build" />
  <property name="build.1.4" value="./build.1.4" />

  <!-- Use JGenerator 2.2 now -->
  <property name="jgen" value="./jgenerator-2.2" />
  <property name="jgen.src" value="${jgen}/src" />

  <!-- Programmatically generated Java files -->
  <property name="buildsrc.1.4" value="${build.1.4}/src" />
  <property name="build.test.dir" value="${build}/test" />
  <property name="jjt.src" value="${buildsrc.1.4}/${pkg.sc.parser}" />

  <!-- Build file directories -->
  <property name="buildsrc.sc.1.4"  value="${buildsrc.1.4}/${pkg.sc}" />

  <!-- All Java files that should be compiled: both hand-generated
       sources and programatically generated files. -->
  <property name="java.1.4.srcs" value="${buildsrc.1.4}:${src}:${jgen.src}:${jjt.src}" />

  <property name="javasrcs" value="${java.1.4.srcs}" />
    
  <!-- More directories and files -->
  <property name="lib" value="./lib" />
  <property name="jgendoc" value="./jgendoc" />
  <property name="python.exec"    value="python" />

  <!-- Source file directories -->
  <property name="sc.src.java" value="./sc/src/${pkg.sc}"/>
  <property name="sc.src.py"   value="./sc" />
  <property name="js2doc.src.java" value="./src/${pkg.js2doc}"/>

  <!--===============  Target [copyjgen]  ==================-->
  <target name="copyjgen" unless="copyjgen.uptodate"
    description="Copy jgen files into misc directory">
    <property name="lpsmisc" value="${LPS_HOME}/WEB-INF/lps/misc" />
    <mkdir dir="${lpsmisc}" />
    <copy file="${jgen}/bin/error.swt" todir="${lpsmisc}" />
    <copy file="${jgen}/bin/DefaultSymbolFile.swt" todir="${lpsmisc}"  />
    <copy file="${jgen}/bin/fop-config.xml" todir="${lpsmisc}"  />
    <property name="copyjgen.uptodate" value="true"/>
  </target>
  
  <!--===============  Target [clean]  ==================-->
  <target name="clean" depends="init"
     description="Deletes all output files and directories generated by the build process.">

    <delete failonerror="false" includeemptydirs="true">
       <fileset dir="${build}" >
           <exclude name=".project" />
           <exclude name=".settings" />
           <exclude name=".classpath" />
           <!-- TODO: [2007-01-24 ptw] How could there be a .svn in a build dir? -->
           <exclude name=".svn" />
       </fileset>
    </delete>
    <delete failonerror="false" includeemptydirs="true">
       <fileset dir="${build.1.4}" >
           <exclude name=".project" />
           <exclude name=".settings" />
           <exclude name=".classpath" />
           <!-- TODO: [2007-01-24 ptw] How could there be a .svn in a build dir? -->
           <exclude name=".svn" />
       </fileset>
    </delete>
    <delete dir="${lib}" failonerror="false" />
    <delete dir="${debug}" failonerror="false" />
    <delete dir="misc" failonerror="false" />
    <delete dir="cache" failonerror="false" />
    <delete file="repository-info.xml" failonerror="false" />
    <delete failonerror="false">
      <fileset dir="." defaultexcludes="no" includes="**/*~"/>
    </delete>
    <delete failonerror="false">
      <fileset dir="sc" includes="*.class"/>
    </delete>
  </target>
  
  <target name="clean-classes" depends="init"
          description="Delete just the .class files.">
    <delete dir="${build}/org" includeemptydirs="true" />
  </target>
  
  <!--===============  Target [init]  ===================-->
  <!-- Initialize property values for other targets to use. -->
  <target name="init" depends="build-opt">
    <tstamp/>

  <!-- Ignore the system classpath -->
  <property name="build.sysclasspath" value="ignore" />

  <property name="build.debug" value="true"/>

  <property name="JAVA_HOME"      value="${env.JAVA_HOME}"/>
  <property name="JAVACC_HOME"    value="${env.JAVACC_HOME}"/>
  <property name="JAVACC5_HOME"   value="D:/Entwicklung/OpenLaszlo/cygwin/home/anba/lib/javacc-5.0"/>
  <property name="JYTHON_HOME"    value="${env.JYTHON_HOME}"/>
  <property name="ANT_HOME"       value="${env.ANT_HOME}"/>
  <property name="LZ_VENDOR_ROOT" value="${env.LZ_VENDOR_ROOT}" />

  <property name="ANT_JAR"        value="${ANT_HOME}/lib/ant.jar"/>
  <property name="JUNIT_JAR"      value="${LZ_VENDOR_ROOT}/junit.jar"/>
  <property name="XMLUNIT_JAR"    value="${LZ_VENDOR_ROOT}/xmlunit1.0.jar"/>
  <property name="TRANG_JAR"      value="${LZ_VENDOR_ROOT}/trang.jar"/>

  <property name="properties.file" value="${LPS_HOME}/build.properties" />
  <property file="${properties.file}" />

  <property name="LPS_JAR" value="${lib}/${lps.jar}" />

  <condition property="hasdom3">
	<not>
      <equals arg1="${ant.java.version}" arg2="1.4"/>
	</not>
  </condition>

  <property name="rng2dtd.py" value="${LPS_HOME}/WEB-INF/lps/schema/rng2dtd.py" />

    <!-- Script compiler build properties -->
    <condition property="jython" value="${JYTHON_HOME}/jython">
      <os family="unix"/> 
    </condition>
    <condition property="jython" value="${JYTHON_HOME}/jython">
      <os family="mac"/> 
    </condition>
    <condition property="jython" value="${JYTHON_HOME}/jython.bat">
      <os family="windows"/> 
    </condition>

   <path id="3rd.party.classpath" >
       <pathelement path="${ANT_JAR}" />
       <pathelement path="${JUNIT_JAR}" />
       <pathelement path="${XMLUNIT_JAR}" />
       <fileset dir="${LPS_HOME}/WEB-INF/lib/" >
           <exclude name="${lps.jar}" />
       </fileset>
       <fileset dir="${LPS_HOME}/3rd-party/jars/dev" />
   </path>
   
   <!-- Determine whether the css parser needs to be updated --> 
   <uptodate property="css-parser.uptodate"
       targetfile="${buildsrc.1.4}/${pkg.css.parser}/CSSParser.java"
       srcfile="${src}/${pkg.css}/CSSParser.jj"/>
   
   <condition property="sc-parser.uptodate">
      <and>
          <uptodate targetfile="${buildsrc.sc.1.4}/parser/Parser.java">
              <srcfiles dir="${sc.src.java}" includes="Parser.jjt"/>
              <srcfiles dir="${sc.src.java}/parser" includes="*.java"/>
          </uptodate>
      </and>
  </condition>
  <echo message="sc-parser.uptodate is ${sc-parser.uptodate}"/>
  
  <condition property="server.uptodate">
    <and>
        <istrue value="${sc-parser.uptodate}"/>
    </and>
  </condition>

  </target>

  <!--==============  Target [css-parser]  ===================-->
  <target name="css-parser" depends="init"
        unless="css-parser.uptodate"
        description="Run JavaCC to create the css-parser *.java files.">
    <mkdir dir="${buildsrc.1.4}/${pkg.css.parser}"/>
    <javacc target="${src}/${pkg.css}/CSSParser.jj"
                outputdirectory="${buildsrc.1.4}/${pkg.css.parser}"
                javacchome="${JAVACC5_HOME}" />
  </target>


  <!--==============  Target [sc-parser]  ===================-->
  <target name="sc-parser" depends="init"
          unless="sc-parser.uptodate"
          description="Run JavaCC to create the parser *.java files."
          >
    <!-- If we rebuild the parser, the compiler has to be rebuilt to pick up the correct constant definitions -->
    <delete failonerror="false">
      <fileset dir="${build}" includes="**/*.class"/>
    </delete>
    <mkdir dir="${buildsrc.sc.1.4}"/>
    <mkdir dir="${buildsrc.sc.1.4}/parser"/>

    <jjtree target="${sc.src.java}/Parser.jjt"
            outputdirectory="${buildsrc.sc.1.4}/parser"
            javacchome="${JAVACC5_HOME}"
            />
    <javacc target="${buildsrc.sc.1.4}/parser/Parser.jj"
            outputdirectory="${buildsrc.sc.1.4}/parser"
            javacchome="${JAVACC5_HOME}"
            />
    <!-- replace generated classes with our custom -->
    <copy flatten="true" todir="${buildsrc.sc.1.4}/parser" overwrite="true">
      <fileset dir="${sc.src.java}/parser" includes="*.java"/>
    </copy>
  </target>

  <!--==============  Target [lps-xml]  ===================-->
  <target name="lps-xml" depends="init" unless="done-lps-xml"
          description="Create the lps.xml file" >
    <echo message="LPS_HOME is ${LPS_HOME}." />
    <copy overwrite="true" tofile="build/${pkg.server}/lps.xml"
            file="src/${pkg.server}/lps.xml.proto">
        <filterset>
            <filter token="BUILDDATE" value="${build.date}" />
            <filter token="BUILDID"   value="${build.id}" />
            <filter token="RELEASE"   value="${release}" />
            <filter token="VERSIONID" value="${version.id}" />
            <filter token="RELEASEID" value="${release.id}" />
            <filter token="EDITING_COMMENT" value="${EDITING-COMMENT}" />
        </filterset>
    </copy>
    <property name="done-lps-xml" value="true"/>
  </target>

  <!--==============  Target [compile]  ===================-->
  <target name="compile" 
      depends="init,lps-xml,css-parser,sc-parser"
      description="Compile java code and jar classes into ${build}">

    <javac classpathref="3rd.party.classpath"
           srcdir="${java.1.4.srcs}"
           destdir="${build}" debug="${build.debug}"
           source="1.5"
           nowarn="true"
           >

      <include name="${pkg.all}*" />
      <include name="${edu.oswego}*" />
      <!-- yes the jjt sources -->
      <include name="${pkg.sc.parser}/**" />
      <!-- Parts of JGenerator 1.4 that we don't yet need -->
      <!-- and don't compile easily without more external jars -->
      <exclude name="${pkg.flash}/commands/FOPCommand" />
      <exclude name="${pkg.flash}/xml/**" />
      <exclude name="${pkg.flash}/js/**" />
      <exclude name="${pkg.flash}/url/JSUrl.*" />
      <exclude name="${pkg.flash}/**/*Test.*" />
      <!-- <exclude name="${pkg.flash}/context/**" /> -->
      <exclude name="${pkg.flash}/fop/SWFRenderer.*" />

      <!-- js2doc currently only builds with 1.5, 
           so build in optional task below -->
      <exclude name="${pkg.js2doc}/**" />
    </javac>

  </target>

  <!--==============  Target [js2doc.compile]  ===================-->
  <target name="js2doc.compile" 
          depends="compile" 
          if="hasdom3">
    <javac classpathref="3rd.party.classpath"
           srcdir="${javasrcs}"
           destdir="${build}" debug="${build.debug}"
           source="1.5"
           nowarn="true"
           >
        <include name="${pkg.js2doc}/**" />
        
        <exclude name="${pkg.js2doc}/*.rnc" />
        <exclude name="${pkg.js2doc}/tests/**" />
    </javac>
  </target>

  <!--===============  Target [js2doc]    =================-->
  <!-- extract documentation from .js file(s) given -->
  <!-- Note that we don't depend on "build" here, which means you need to manually
     - build if server sources change. The reason to skip this check is to avoid
     - repeatedly touching the lps-*.jar file, which causes the java task to always
     - re-run js2doc in this task. -->
  <target name="js2doc" depends="init" if="hasdom3"
        description="extract documentation from .js file(s) given">
    <!-- fork=true is necessary, otherwise we get a FNF error trying to create the .xml file -->
    <java classname="org.openlaszlo.js2doc.Main"
          fork="yes"
          failonerror="true">
        <classpath>
            <path refid="3rd.party.classpath"/>
            <pathelement path="${LPS_JAR}"/>
        </classpath> 
        <sysproperty key="LPS_HOME" value="${LPS_HOME}"/>
        <sysproperty key="JS2DOC_LIBROOT" value="${LPS_HOME}"/>
        <arg line="${js2doc.args}"/>
    </java>
  </target>
  
  <!--===============  Target [js2doc.schema]    =================-->
  <!-- extract documentation from .js file(s) given -->
  <!-- Note that we don't depend on "build" here, which means you need to manually
     - build if server sources change. The reason to skip this check is to avoid
     - repeatedly touching the lps-*.jar file, which causes the java task to always
     - re-run js2doc in this task. -->
  <target name="js2doc.schema" depends="init" if="hasdom3"
        description="extract schema from the .js file(s) given">
    <!-- fork=true is necessary, otherwise we get a FNF error trying to create the .xml file -->
    <java classname="org.openlaszlo.js2doc.Main"
          fork="yes"
          failonerror="true">
        <classpath>
            <path refid="3rd.party.classpath"/>
            <pathelement path="${LPS_JAR}"/>
        </classpath> 
        <sysproperty key="LPS_HOME" value="${LPS_HOME}"/>
        <sysproperty key="JS2DOC_LIBROOT" value="${LPS_HOME}"/>
        <arg line="${js2doc.args}"/>
    </java>
  </target>
  
  <!--===============  Target [js2doc.rng]    =================-->
  <target name="js2doc.rng" 
          depends="js2doc.rng.dep"
          unless="js2doc.rng.uptodate"
          description="Generate js2doc RNG schema file">  
      <mkdir dir="${lib}" />
	  <copy todir="${lib}" file="${js2doc.src.java}/js2doc.rnc"/>
      <!-- fork=true is required when running from a jar -->
      <java classname="com.thaiopensource.relaxng.translate.Driver"
            fork="true"
            failonerror="true">
        <classpath>
          <pathelement path="${TRANG_JAR}" />
        </classpath>
        <arg value="${lib}/js2doc.rnc"/>
        <arg value="${lib}/js2doc.rng"/>
      </java>
  </target>

  <target name="js2doc.rng.dep" depends="init">
      <uptodate property="js2doc.rng.uptodate"
            srcfile="${js2doc.src.java}/js2doc.rnc"
            targetfile="${lib}/js2doc.rnc" />
  </target>
  
  <!--=============  Target [js2doc.validate]    ===============-->
  <target name="js2doc.validate" depends="init">
      <jing rngfile="${js2doc.src.java}/js2doc.rnc" compactsyntax="true">
        <fileset dir="${js2doc.validate.arg.filedir}" includes="*.xml" />
      </jing>
  </target>

  <!--===============  Target [js2doc.test]    =================-->
  <target name="js2doc.test" depends="build,js2doc.rng" if="hasdom3">
      <!-- first unit/integration tests -->
      
      <junit haltonfailure="true" printsummary="withOutAndErr" showoutput="true" fork="yes">
          <formatter type="plain" usefile="false"/>
          <sysproperty key="LPS_HOME" value="${LPS_HOME}"/>
          <sysproperty key="JS2DOC_LIBROOT" value="${LPS_HOME}"/>
          <sysproperty key="JS2DOC_RNG" file="${lib}/js2doc.rng" />
          <sysproperty key="JS2DOC_TESTCASES" file="${js2doc.src.java}/tests"/>
          <classpath>
              <path refid="3rd.party.classpath"/>
              <pathelement location="build"/>
          </classpath> 
          <test name="org.openlaszlo.js2doc.Comment_Test"/>
          <test name="org.openlaszlo.js2doc.Schema_Test"/>
          <!-- 
          <test name="org.openlaszlo.js2doc.JS2Doc_Test"/> [2007.12.03 bshine bug LPP-5184] 
          -->
          <test name="org.openlaszlo.js2doc.WholeFile_Test"/>
      </junit>

      <!-- now test the command-line tool itself -->
      <mkdir dir="${build.test.dir}"/>
      <antcall target="js2doc">
          <param name="js2doc.args" value="-v --libraryid test --test ${lib}/js2doc.rng ${js2doc.src.java}/tests/shortest.js"/>
      </antcall>
      <antcall target="js2doc">
          <param name="js2doc.args" value="-v --libraryid test --test ${lib}/js2doc.rng ${js2doc.src.java}/tests/LaszloEvents.js"/>
      </antcall>
      <antcall target="js2doc.validate">
          <param name="js2doc.validate.arg.filedir" value="${build.test.dir}"/>
      </antcall>
  </target>
  
  <!--===============  Target [test]  ====================-->
  <!-- build and run the tests                            -->
  <!-- XXX For now, we only have minimal things here      -->
  <target name="test" depends="build,js2doc.test"
          description="Run tests" if="megatest.do">
      <junit haltonfailure="true" printsummary="withOutAndErr" showoutput="true" fork="yes">
          <formatter type="plain" usefile="false"/>
          <sysproperty key="LPS_HOME" value="${LPS_HOME}"/>
          <classpath>
              <path refid="3rd.party.classpath"/>
              <pathelement location="build"/>
          </classpath> 
          <!-- currently failing - LPP-2054 
                <test name="org.openlaszlo.utils.FileUtils_Test"/>
          -->
          <test name="org.openlaszlo.xml.internal.XMLUtils_Test"/>
          <test name="org.openlaszlo.compiler.Compiler_Test"/>
          <test name="org.openlaszlo.compiler.TextCompiler_Test"/>
          <test name="org.openlaszlo.compiler.ViewSchema_Test"/>
          <test name="org.openlaszlo.sc.CompileTimeEvaluator_Test"/>
      </junit>
  </target>

  <!--===============  Target [copy-i18n-catalogs]  ===================-->
  <target name="copy-i18n-catalogs" unless="copy-i18n-catalogs.uptodate">
    <!-- copy the i18n message catalogs -->
    <copy todir="${LPS_HOME}/WEB-INF/classes}">
      <fileset dir=".">
          <include name="${src}/${pkg.i18n}/*.properties" />
      </fileset>
    </copy>
    <property name="copy-i18n-catalogs.uptodate" value="true"/>
  </target>
  
  <!--===============  Target [build]  ===================-->
  <!-- Compile the source, doc, and test framrk           -->
  <target name="build" depends="compile,js2doc.compile,copy-i18n-catalogs,js2doc.rng" description="Build the source">
    <!-- Build jar files  -->
    <mkdir dir="${lib}" />
    <jar jarfile="${LPS_JAR}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <section name="org/openlaszlo/server/">
            <attribute name="Specification-Title" value="LPS Server Package"/>
            <attribute name="Specification-Version" value="${version.id}"/>
            <attribute name="Specification-Vendor" value="laszlosystems.com"/>
            <attribute name="Implementation-Title" value="org.openlaszlo.server"/>
            <attribute name="Implementation-Version" value="${release} ${build.id} ${build.date}"/>
            <attribute name="Implementation-Vendor" value="org.openlaszlo"/>
          </section>
        </manifest>
        <fileset dir="${build}" includes="org/**,EDU/**"
                 excludes="${pkg.all}/internal/*_Test.class,
                           ${pkg.all}/*_Test*.class,
                           ${pkg.test}/*" />
        <fileset dir="${src}" includes="${pkg.i18n}/*.properties" />
    </jar>
  </target>

  <!--================  Target [all]  ===================-->
  <!-- Build the whole shebang.  -->
  <target name="all" description="Clean and rebuild"
     depends="clean, build, test">
  </target>

</project>

Reply via email to