Torsten:
I already add all the dependent jar files as you mentioned. However,
the same error. I am wonder how to add the dependencies to customized
ant task.
still , i got this exception java.lang.NoClassDefFoundError:
org/objectweb/asm/ClassVisitor.
I am wonder if JavaFlow can rewriting class file including Exception
and dynamic class loading?
here is the xml file:
<project name='JPPF Application' basedir="." default="run">
<!--
=========================================================================
-->
<!-- Property definitions
-->
<!--
=========================================================================
-->
<property name="build.properties.file"
value="${basedir}/build.properties"/>
<property file="${build.properties.file}"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="config.dir" value="${basedir}/config"/>
<property name="classes.dir" value="${basedir}/classes"/>
<property name="src.dir" value="${basedir}/src"/>
<!--
=========================================================================
-->
<!-- Classpath definitions
-->
<!--
=========================================================================
-->
<path id="project.classpath">
<pathelement location="${config.dir}"/>
<pathelement location="${classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<!--
=========================================================================
-->
<!-- Clean
-->
<!--
=========================================================================
-->
<target name="clean">
<delete dir="${classes.dir}" quiet="true"/>
<delete dir="inclass" quiet="true"/>
</target>
<!--
=========================================================================
-->
<!-- Init
-->
<!--
=========================================================================
-->
<target name="init" description="Initialize ressources">
<mkdir dir="${classes.dir}"/>
<mkdir dir="inclass"/>
</target>
<!--
=========================================================================
-->
<!-- Compile
-->
<!--
=========================================================================
-->
<target name="compile" depends="clean, init">
<javac srcdir="" destdir="${classes.dir}"
debug="on" deprecation="off" optimize="on"
includes="**/*.java">
<classpath refid="project.classpath"/>
<compilerarg line="-Xlint:unchecked"/>
<src path="${src.dir}"/>
</javac>
</target>
<!--
=========================================================================
-->
<!-- instrument
-->
<!--
=========================================================================
-->
<taskdef name="javaflow"
classname="org.apache.commons.javaflow.ant.AntRewriteTask">
<classpath id = "project.class.path">
<fileset dir = "lib">
<include name =
"**/ant-1.7.1.jar"/>
<include name =
"**/asm-3.2.jar"/>
<include name =
"**/asm-analysis-3.2.jar"/>
<include name =
"**/asm-commons-3.2.jar"/>
<include name =
"**/asm-tree-3.2.jar"/>
<include name =
"**/asm-util-3.2.jar"/>
<include name =
"**/bcel-5.2.jar"/>
<include name =
"**/commons-io-1.4.jar"/>
<include name =
"**/commons-jci-core-1.0.jar"/>
<include name =
"**/commons-logging-1.1.jar"/>
<include name =
"**/junit-3.8.2.jar"/>
<include name =
"**/junit-addons-1.4.jar"/>
<include name =
"**/commons-javaflow-1.0-SNAPSHOT.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="javaflow" depends="compile">
<javaflow srcdir="classes" Destdir="inclass">
<include name="**/*.class" />
</javaflow>
</target>
<!--
=========================================================================
-->
<!-- Run the application
-->
<!--
=========================================================================
-->
<target name="run" description="run the application" depends="javaflow">
<java fork="yes" classname="${main.class}"
classpathref="project.classpath">
<jvmarg value="-Djppf.config=jppf.properties"/>
<jvmarg
value="-Djava.util.logging.config.file=config/logging.properties"/>
<jvmarg value="-Xmx64m"/>
</java>
</target>
</project>
From Wayne
2011/6/9 Torsten Curdt <[email protected]>:
> Jars usually don't include dependencies - they have dependencies.
> Unless you package them in a special way (see the maven shade plugin)
>
> So look at the pom. Copy all jars referenced in there into your you
> lib dir where you have the javaflow jar and then add those to your
> fileset
>
>>>> <classpath id = "project.class.path">
>>>> <fileset dir = "lib">
>>>> <include name =
>>>> "**/commons-javaflow-1.0-SNAPSHOT.jar"/>
>
> Here!
>
>>>> </fileset>
>>>> </classpath>
>
> ...or add the maven shade plugin to your pom.
>
> cheers,
> Torsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
..............................................
Graduate School of Global Information
and Telecommunication Studies
Waseda University
1-6-1 Nishi Waseda, Shinjuku-ku,
Tokyo169-8050, JAPAN.
..............................................
************************************************
早�R田大学大学院 国�H情�笸�科信研究科
中里研究室 博士�n程
王�Z(John Wayne)
E-mail:[email protected]
************************************************