ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From info.da...@virgilio.it
Subject java task in linux, fork problems
Date Fri, 28 Feb 2003 11:19:36 GMT
Hi all,
i've some problems using the tast Java in linux RH 7.2.
There're some difference when I set the fork on true or on false.
For example, i get several different errors runnning this java task: 
<project name="Importer" default="FINALLY" basedir=".">
<property name="LIB_PATH" value="./lib"/>
<path id="project.class.path">
<pathelement location="${LIB_PATH}/xerces.jar"/>
<pathelement location="${LIB_PATH}/xalan.jar"/>
<pathelement location="${LIB_PATH}/db2java.zip"/>
<pathelement location="${LIB_PATH}/log4j-1.2.8.jar"/>
<pathelement location="${LIB_PATH}/importer.jar"/>
<pathelement path="${java.class.path}"/>
</path>
<target name="IMPORT DOSSIER">
<java classname="importer.Importer" fork="true" failonerror="false">
<classpath refid="project.class.path"/>
</java>
</target>
</project>

CASE FORK = TRUE
setting fork on true, it runs in Windows, while in linux the execution stalls.
(I have to type ctrl+z to stop it ;-).
Before stalling  the output is:
[java] Executing '/opt/WebSphere/AppServer/java/jre/bin/java' with arguments:
[java] '-classpath'
[java] '/SIPS/importer/lib/xerces.jar:/SIPS/importer/lib/xalan.jar:/SIPS/importer/lib/db2java.zip:/SIPS/importer/lib/log4j-1.2.8.jar:/SIPS/importer/lib/importer.jar:/etc/jakarta-ant-1.5.1/lib/xml-apis.jar:/etc/jakarta-ant-1.5.1/lib/xercesImpl.jar:/etc/
akarta-ant-1.5.1/lib/optional.jar:/etc/jakarta-ant-1.5.1/lib/log4j-1.2.8.jar:/etc/jakarta-ant-1.5.1/lib/ant.jar:/home/db2inst1/sqllib/java/sqlj.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/runtime
zip:/SIPS/importer'
[java] 'importer.Importer'
[java] '-D'
[java] '/SIPS/importer/data/dossier/descrittoridossier/'
[java] '/SIPS/importer/data/dossier/bk/'
[java]
[java] The ' characters around the executable and arguments are
[java] not part of the command.
But, if i do all the same commands by hand in the shell it works.

CASE FORK = FALSE:
setting fork = false, I get some errors both in windows and in linux.
This is the "win error": 
[org.apache.tools.ant.taskdefs.Java:186] - java.lang.NoClassDefFoundError

and this is the linux one:
Task "java" finished with error.
file:/SIPS/importer/importer_ant.xml:40: java.lang.NoClassDefFoundError:
importer/Importer
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:190)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
--- Nested Exception ---
java.lang.NoClassDefFoundError: importer/Importer
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)

I think it's a classpath problem, but i have no idea how to solve it.

Finally I notice that in linux  the java processes are "alive" in memory
after starting ant, even if I stopped them.

Thanks in advance!


Dario.


Mime
View raw message