ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Putting Classpath Into My Own Ant Task
Date Wed, 09 Jun 2004 19:51:38 GMT
> From: Dave Westerman []
> Using the embedded classpath in the taskdef sounded like the best option
> for me, so I tried the following:
>   <taskdef name="WaaderXtractor"
> classname="" >
>     <classpath >
>       <pathelement location="${Waader.jar}" />
>       <pathelement location="C:/WebSphere/AppServer/lib/wjmxapp.jar" />
>       <pathelement location="C:/WebSphere/AppServer/lib/admin.jar" />
>     </classpath>
>   </taskdef>
>   <target name="extract" description="WaaderXtractor" >
>     <WaaderXtractor earFile="${Waader.ear.file}"
>                     xmlOutput="${Waader.xml.output}"
>                     propOutput="${Waader.prop.output}" >
>     </WaaderXtractor>
>   </target>

Looks good to me so far.

> My Ant task, and my utility which it calls, are both in the $(Waader.jar}
> file, and they are found just fine. But my 3rd party jars are still not
> found. I have checked and double-checked (and even triple-checked!) that
> the locations are correct, that the jars exist, and that they have the
> classes I need. But it doesn't seem to know the jars are in the classpath.
> i even changed the order of the pathelements to put the 3rd party ones
> first, but it still doesn't work. I'm probably doing something really
> stupid, but I can't figure out what is going on.
> Finding class
> Class loaded from parent loader
> Class loaded from
> ant loader
>  +User task: WaaderXtractor
>  +Target: extract
>    +Task: WaaderXtractor
> extract:
> Class java.lang.String loaded from parent loader
> Finding class
> Class loaded from ant
> loader
> Class
> loaded from parent loader
> BUILD FAILED: java.lang.NoClassDefFoundError:

Which JAR is the in? Do you
find it. Looks like some classes are loaded from the explicitly specified
JARs, but that others are missing (you might not depend directly on those).

The fact that your code compiles doesn't necessarily mean you don't need
other runtime JARs, and I suspect that's what happening here. --DD

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message