ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Putting Classpath Into My Own Ant Task
Date Wed, 09 Jun 2004 19:51:38 GMT
> From: Dave Westerman [mailto:DLWester@pobox.com]
> Using the embedded classpath in the taskdef sounded like the best option
> for me, so I tried the following:
> 
>   <taskdef name="WaaderXtractor"
> 
> classname="com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractorAnt" >
>     <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 com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractorAnt
> Class org.apache.tools.ant.Task loaded from parent loader
> Class com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractorAnt loaded from
> ant loader
>  +User task: WaaderXtractor
> com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractorAnt
>  +Target: extract
>    +Task: WaaderXtractor
> extract:
> Class java.lang.String loaded from parent loader
> Finding class com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractor
> Class com.ibm.aim.bpts.wcc.wasutils.waader.WaaderXtractor loaded from ant
> loader
> Class
> com.ibm.websphere.management.application.client.AppDeploymentController
> loaded from parent loader
> BUILD FAILED: java.lang.NoClassDefFoundError:
> com.ibm.websphere.management.application.AppManagementBaseFactory

Which JAR is the
com.ibm.websphere.management.application.AppManagementBaseFactory 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message