• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant, windows xp, and a funky infinite loop

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
howdy,
i've got a pesky ant script that runs fine on my colleague's XP box but not on mine. (It runs fine on rh linux too.)
We check out the same source base & scripts from CVS. He can run the main build target, but when I attempt to run the main build target, it seems as if Ant can't find the classpath elements (which it should be able to- echoing the library path and copy/pasting that into a cd prompt yields a successful change to that directory). At that point ant goes into some infinite loop which looks like:
count = 0, total = 477
count = 0, total = 139
count = 0, total = 101
count = 0, total = 477
count = 0, total = 139
count = 0, total = 101
count = 0, total = 477
count = 0, total = 139
count = 0, total = 101
count = 0, total = 477
count = 0, total = 139
count = 0, total = 101
count = 0, total = 477
count = 0, total = 139
count = 0, total = 101
<etc - this goes on for 100s of times>
Interspersed with this is evidence of the compilation failing due to inability to find the JARs in the lib path. I'm ready to tear my hair out because it just makes no sense. We've double checked the environment variable settings and cannot figure out the difference. The only difference between his machine and mine is that I have cygwin installed - but the cygwin binaries are not declared in the WINDOWS $PATH.
Is this an ant/windows thing? I haven't found anything on the 'net (and don't have a JGuru membership!)
Thanks so much!
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to post the build file you are using.
 
Alexx Stehman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<?xml version="1.0" encoding="UTF-8" ?>
<!-- main build script -->
<project name="rpm" default="help" basedir=".">
<!-- setup all variables required for build -->
<!-- environment -->

<property environment="env"/>
<property name="java.home" value="${env.JAVA_HOME}"/>
<property name="work.dir" value="${env.WORK_DIR}"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="build.dir" value="${env.OUT_DIR}"/>
<!-- local variables -->
<property name="lib.path" value="${work.dir}/Lib"/>
<property name="rpm.properties.path" value="${work.dir}/Lib/rpm/props"/>
<property name="dir.prefix" value="com/cadmus/rpm"/>
<property name="server.dir" value="${work.dir}/Server"/>
<property name="domain.dir" value="${work.dir}/Domain"/>
<property name="client.dir" value="${work.dir}/Client"/>
<property name="model.dir" value="${domain.dir}/${dir.prefix}/domain/model"/>
<property name="server.jar" value="rpm_server.jar"/>
<property name="domain.jar" value="rpm_domain.jar"/>
<property name="server.rel.jar" value="rpm_server.jar"/>
<property name="PollerStartup.jar" value="PollerService.jar"/>
<!-- added for deploying into JBoss -->
<property name="deploy.dir" value="${jboss.home}/server/default/deploy"/>
<!-- Added to pickup the files from Server and Domain dirs in rpmjars folder -->
<property name="server.dest" value="${build.dir}/Server"/>
<property name="domain.dest" value="${build.dir}/Domain"/>
<!-- ProcessManager File's Path -->
<!--
Please add the Process Manager Deployment Descriptors in the Server DD
-->
<property name="processMgr.path" value="${work.dir}/Lib/processmanager/src"/>
<!-- Property Added by Saroj for the no. of jar -->
<property name="X" value="1"/>
<!--************************************
build targets
****************************************-->
<!-- target to generate code -->
<target name="gen.code">
<ant antfile="codegen.xml" target="gen.code"/>
</target>
<!-- target to build server code -->
<target name="build.server">
<ant antfile="server.xml" target="compile.server"/>
<ant antfile="server.xml" target="package.server"/>
</target>
<!-- target to build domain code -->
<target name="build.domain">
<ant antfile="domain.xml" target="compile.domain"/>
<ant antfile="domain.xml" target="compile.processMgr"/>
<ant antfile="domain.xml" target="package.domain"/>
</target>
<!-- target to deploy all source code modules -->
<!-- CURRENTLY UNSUPPORTED - NEED TO ENHANCE -->
<target name="deploy.jars" description="deploys all jars.">
<echo message="*******************************"/>
<echo message="Deployment to be done manually."/>
<echo message="*******************************"/>
<!--
<ant antfile="server.xml" target="deploy.server"/>
<ant antfile="domain.xml" target="deploy.domain"/>
-->
</target>
<!-- target to undeploy all source code modules -->
<!-- CURRENTLY UNSUPPORTED - NEED TO ENHANCE -->
<target name="undeploy.jars" description="undeploys all jars.">
<echo message="Undeploying..."/>
<ant antfile="server.xml" target="undeploy.server"/>
<ant antfile="domain.xml" target="undeploy.domain"/>
</target>
<!--************************************
Batch Targets
****************************************-->
<!-- targets to clean up -->
<target name="clean">
<echo message="cleaning up previous build..."/>
<ant antfile="codegen.xml" target="clean.codegen"/>
<ant antfile="server.xml" target="clean.server"/>
<ant antfile="domain.xml" target="clean.domain"/>
<delete file="${build.dir}/${server.rel.jar}"/>
</target>
<!-- target to generate code -->
<target name="generate" description="generates code.">
<antcall target="gen.code"/>
</target>
<!-- target to build all source code modules -->
<target name="build.code" description="compiles all sources.">
<echo message="Building code..."/>
<antcall target="build.server"/>
<antcall target="build.domain"/>
</target>
<!-- target to build the jar for Poller Service Startup -->
<target name="build.pollerstartup" description="compiles poller startup sources.">
<echo message="Building poller startup code..."/>
<jar jarfile ="${build.dir}/PollerService.jar"
basedir="${build.dir}/Server"
includes="com/cadmus/rpm/domain/poller/PollerServiceStartup*.class"/>
</target>
<!-- target to recompile all source code modules -->
<target name="recompile" depends="clean">
<antcall target="compile"/>
</target>
<!-- target to help in releasing server jars -->
<target name="release.jar">
<tstamp>
<format property="time.stamp" pattern="yyyy_MM_dd" locale="en"/>
</tstamp>
<!--
CHANGE NOTE: Now all files are being compiled in OUT_DIR\Server.
Jar is being made using this directory.
This directory should contain the latest deployment
descriptors.
Domain directory has become USELESS.
<jar jarfile="${build.dir}/${server.rel.jar}_${time.stamp}_${X}.jar">
-->
<jar jarfile="${build.dir}/${server.rel.jar}">
<fileset dir="${server.dest}"
includes="com/**,META-INF/**,**"/>
<!-- Commented for testing
<fileset dir="${rpm.properties.path}"
includes="*.*"/>
-->
<fileset dir="${rpm.properties.path}" >
<patternset>
<include name="*.*"/>
<exclude name="rpmserver.properties"/>
<exclude name="AdminEventConfig*.*"/>
<exclude name="oracle-service.xml"/>
<exclude name="properties-service.xml"/>
<exclude name="log4j.xml"/>
</patternset>
</fileset>
</jar>
<echo message="*********************************"/>
<echo message="Jars ready for release procedure."/>
<echo message="*********************************"/>
</target>
<!--************************************
Target to do it all!
****************************************-->
<!-- target to build -->
<target name="build" description="builds everything.">
<echo message="Building RPM..."/>
<antcall target="clean"/>
<antcall target="generate"/>
<antcall target="build.code"/>
</target>
<!-- target to build and release -->
<target name="build.rel" description="builds and prepares for
releasing jars">
<antcall target="build"/>
<antcall target="release.jar"/>
<antcall target="build.pollerstartup"/>
</target>
<!-- target to build Only Entity Beans -->
<target name="build.EB" description="builds Entity Bean Only">
<echo message="Building Only Entity Beans ..."/>
<ant antfile="domain.xml" target="build.EB"/>
</target>
<!-- target to build Only Models -->
<target name="build.models" description="builds Models Only">
<echo message="Building Only Models..."/>
<ant antfile="domain.xml" target="build.models"/>
</target>
<!-- target to build Domain except Models -->
<target name="build.others" description="builds Domain Others Only">
<echo message="Building Only Models..."/>
<ant antfile="domain.xml" target="build.others"/>
<ant antfile="domain.xml" target="compile.processMgr"/>
</target>
<!-- target to build System Integration -->
<target name="build.si" description="builds System Integration Only">
<echo message="Building System Integration ..."/>
<ant antfile="domain.xml" target="build.si"/>
</target>
<!-- target to build Actions package -->
<target name="build.actions" description="builds Actions Package Only">
<echo message="Building Actions Package ..."/>
<ant antfile="domain.xml" target="build.actions"/>
</target>
<!-- target to build Common package -->
<target name="build.common" description="builds Common Package Only">
<echo message="Building Common Package ..."/>
<ant antfile="domain.xml" target="build.common"/>
</target>
<!-- target to build Comparators package -->
<target name="build.comp" description="builds Comparators Package Only">
<echo message="Building Comparators Package ..."/>
<ant antfile="domain.xml" target="build.comp"/>
</target>
<!-- target to build Custom package -->
<target name="build.custom" description="builds Custom Package Only">
<echo message="Building Custom Package ..."/>
<ant antfile="domain.xml" target="build.custom"/>
</target>
<!-- target to build Exception package -->
<target name="build.excep" description="builds exception Package Only">
<echo message="Building Exception Package ..."/>
<ant antfile="domain.xml" target="build.excep"/>
</target>
<!-- target to build QueryParams package -->
<target name="build.query" description="builds QueryParams Package Only">
<echo message="Building QueryParams Package ..."/>
<ant antfile="domain.xml" target="build.query"/>
</target>
<!-- target to build Reports package -->
<target name="build.report" description="builds Reports Package Only">
<echo message="Building Reports Package ..."/>
<ant antfile="domain.xml" target="build.report"/>
</target>
<!-- target to build Session package -->
<target name="build.session" description="builds Session Package Only">
<echo message="Building Session Package ..."/>
<ant antfile="domain.xml" target="build.session"/>
</target>
<!-- target to build workflow package -->
<target name="build.workflow" description="builds Workflow Package Only">
<echo message="Building workflow Package ..."/>
<ant antfile="domain.xml" target="build.workflow"/>
</target>
<!-- target to build ProcessManager package -->
<target name="build.process" description="builds ProcessManager Package Only">
<echo message="Building ProcessManager Package ..."/>
<ant antfile="domain.xml" target="compile.processMgr"/>
</target>
<!-- target to deploy rpm_server.jar in Jboss -->
<target name="deploy.server" description="Deploys rpm_server.jar.">
<echo message="deploying rpm_server.jar"/>
<copy file="${build.dir}/${server.jar}"
todir="${jboss.home}/server/default/deploy"/>
</target>
<target name="build.war">
<echo message="Creating war ..........."/>
<ant antfile="releasebuild.xml" target="client.build"/>
</target>
<target name="build.protocol">
<echo message="Builing the protocol"/>
<ant antfile="protocol.xml" target="build.protocol"/>
</target>
<target name="build.rpm" description="builds and prepares for
releasing jars and war file">
<echo message="${jboss.home}
" />
<echo message="${work.dir}
" />
<echo message="${build.dir}
" />
<antcall target="build.protocol"/>
<antcall target="build"/>
<antcall target="release.jar"/>
<antcall target="build.pollerstartup"/>
<antcall target="copy.protocol"/>
<antcall target="build.war"/>
<antcall target="copy.server.properties"/>
<antcall target="copy.ui.properties"/>
<antcall target="build.307"/>
</target>
<target name="deploy" description="Deploys the rpm_server.jar to the JBOSS deploy directory and Places the rpm.war file
in the tomcat webapps directory.">
<antcall target="deploy.server"/>
<antcall target="deploy.client"/>
</target>
<target name="deploy.client">
<echo message="Updating the rpm war to your tomcat webapps folder ..... "/>
<echo message="Cleaning rpm folder and rpm war .... "/>
<delete dir="${env.CATALINA_HOME}/webapps/rpm"/>
<delete>
<fileset dir="${env.CATALINA_HOME}/webapps">
<include name="rpm.war"/>
</fileset>
</delete>
<echo message="Copying the latest war to webapps directory ..."/>
<copy todir="${env.CATALINA_HOME}/webapps">
<fileset dir="${env.OUT_DIR}">
<include name="rpm.war"/>
</fileset>
</copy>
</target>
<target name="help">
<echo message="build.rpm Creates the rpm server and client code ready to be deployed. "/>
<echo message="build.domain Compiles the Domain packages for RPM server module."/>
<echo message="build.server Compiles the Server packages for RPM server module."/>
<echo message="release.jar Packages the Domain and Server Modules and creates a composite package for deployment."/>
<echo message="build.war Compiles and creates the Web interface modules for the RPM "/>
<echo message="deploy Deploys the RPM application"/>
</target>
<target name="copy.protocol">
<copy todir="${build.dir}">
<fileset dir="${lib.path}">
<include name="protocol.jar"/>
</fileset>
</copy>
</target>
<target name="copy.server.properties">
<copy todir="${build.dir}">
<fileset dir="${lib.path}/rpm/props">
<include name="rpmserver.properties"/>
</fileset>
</copy>
</target>
<target name="copy.ui.properties">
<copy todir="${build.dir}">
<fileset dir="${work.dir}/Client/config">
<include name="rpmui.properties"/>
</fileset>
</copy>
</target>
<!-- target to deploy rpm_server.jar in Jboss -->
<target name="build.307" description="Build RPM for integrated version">
<ant antfile="deploy.xml" target="build.307"/>
</target>
<target name="deploy.307" description="Deploy RPM in integrated version">
<ant antfile="deploy.xml" target="deploy.307"/>
</target>
<!-- target to deploy the JAVADOC file -->
<target name="javadoc" description="Generate Javadocs">
<ant antfile="build_javadocs.xml" target="javadocs"/>
</target>
</project>
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try running the script using the -verbose or -debug option. Perhaps that gives you some hints on what is going wrong.
 
Alexx Stehman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the verbose tip - that helped a bit. The script dies in a child script within this target:

<target name="compile.domain">
<echo message="Compiling ${work.dir}\Domain..."/>
<javac classpathref="classpath.compilation.domain"
srcdir="${work.dir}/Domain"
destdir="${build.dir}/Server"
DIES HERE>>> debug="on"/>
</target>
Looks fine as far as I can tell. Ant doesn't care about "/" vs/ "\", correct?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there
I've had this and it turned out to be corrupt jars.
Are you using Eclipse? Or used Eclipse to get the jars?
http://dev.eclipse.org/viewcvs/index.cgi/platform-vcm-home/docs/online/cvs_features2.0/cvs-faq.html?rev=1.33#commandLine_5
Try to expand your jars manually to check.
Hope that helps
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This one is so annoying - the error message should win a prize for being the least informative ever. We've come a cropper on it more than once and it always seems to be caused by jar files checked into CVS without the -kb flag to mark them as binary.

If you see anything like

count = 0, total = 81
count = 0, total = 81
count = 0, total = 47

especially if it works on your linux box but not your windows machine, have a look at all the jar files in cvs and make sure they are in as "binary".
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the above post - it is exactly what the problem was in my case.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic