You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ck...@onebox.com on 2005/04/04 18:06:25 UTC

taskdef-classpath fails to add jars to classpath

I have the following:
 - ant 1.6.2 
 - FOP 0.20.5
 - WinXP Pro 2002 Service Pack 2
 - FOP_HOME is defined as "C:\Program Files\Apache Software Foundation\fop-0.20.5"
 - CLASSPATH is defined as "C:/apache-ant-1.6.2\lib\ant.jar;C:/apache-ant-1.6.2\lib\optional.jar;C:/apache-a
nt-1.6.2\lib\xercesImpl.jar;C:/apache-ant-1.6.2\lib\xml-apis.jar;c:\saxon\saxon.
jar;c:\saxon\saxon-jdom.jar;C:\Xalan-J\bin\xalan.jar;C:\Program Files\Apache Sof
tware Foundation\fop-0.20.5/build/fop.jar;C:\junit3.8.1/junit.jar;C:\junit3.8.1"

In my build.xml file I have this taskdef:
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
    <classpath>
      <pathelement location="${env.FOP_HOME}/build/fop.jar"/>
      <pathelement location="${env.FOP_HOME}/lib/avalon-framework-cvs-20020806.jar"/>
      <pathelement location="${env.FOP_HOME}/lib/batik.jar"/>
    </classpath>
</taskdef>

Further along in build.xml is this target:
<target name="make-race-chart-pdf" description="converts the xsl-fo race chart to a .pdf document">
 <fop format="application/pdf" fofile="${output-dir}/${next-week}/race-chart.fo.xml" outfile="${output-dir}/${next-week}/race-chart.pdf" />
</target>

When I execute ant I get this error message:
"BUILD FAILED
C:\Data\Pool-14.1\build.xml:10: taskdef A class needed by class org.apache.fop.t
ools.anttasks.Fop cannot be found: org/apache/avalon/framework/logger/Logger"

If I manually place the .jar files named in the <taskdef> in the CLASSPATH and execute ant the build succeeds. Can anyone diagnose my problem?

Thanks.

-- 
Charles Knell
cknell@onebox.com - email

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: taskdef-classpath fails to add jars to classpath

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello,
the fact that the class

org/apache/avalon/framework/logger/Logger is not found might indicate that this class
is loaded directly or undirectly by another class, which is using your startup classloader.
this is documented under http://ant.apache.org/faq.html#delegating-classloader
This kind of problem happens often with classes which are loaded by factories, such as JDBC or JNDI drivers.
There is nothing much you can do about this.
[except that sometimes I dream of classloaders being made aware of their children, maybe with a stack or probably
even a graph structure ]
Cheers,
Antoine


cknell@onebox.com wrote:

>I have the following:
> - ant 1.6.2 
> - FOP 0.20.5
> - WinXP Pro 2002 Service Pack 2
> - FOP_HOME is defined as "C:\Program Files\Apache Software Foundation\fop-0.20.5"
> - CLASSPATH is defined as "C:/apache-ant-1.6.2\lib\ant.jar;C:/apache-ant-1.6.2\lib\optional.jar;C:/apache-a
>nt-1.6.2\lib\xercesImpl.jar;C:/apache-ant-1.6.2\lib\xml-apis.jar;c:\saxon\saxon.
>jar;c:\saxon\saxon-jdom.jar;C:\Xalan-J\bin\xalan.jar;C:\Program Files\Apache Sof
>tware Foundation\fop-0.20.5/build/fop.jar;C:\junit3.8.1/junit.jar;C:\junit3.8.1"
>
>In my build.xml file I have this taskdef:
><taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
>    <classpath>
>      <pathelement location="${env.FOP_HOME}/build/fop.jar"/>
>      <pathelement location="${env.FOP_HOME}/lib/avalon-framework-cvs-20020806.jar"/>
>      <pathelement location="${env.FOP_HOME}/lib/batik.jar"/>
>    </classpath>
></taskdef>
>
>Further along in build.xml is this target:
><target name="make-race-chart-pdf" description="converts the xsl-fo race chart to a .pdf document">
> <fop format="application/pdf" fofile="${output-dir}/${next-week}/race-chart.fo.xml" outfile="${output-dir}/${next-week}/race-chart.pdf" />
></target>
>
>When I execute ant I get this error message:
>"BUILD FAILED
>C:\Data\Pool-14.1\build.xml:10: taskdef A class needed by class org.apache.fop.t
>ools.anttasks.Fop cannot be found: org/apache/avalon/framework/logger/Logger"
>
>If I manually place the .jar files named in the <taskdef> in the CLASSPATH and execute ant the build succeeds. Can anyone diagnose my problem?
>
>Thanks.
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org