ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Westerman <DLWes...@pobox.com>
Subject RE: Putting Classpath Into My Own Ant Task
Date Wed, 09 Jun 2004 19:43:28 GMT
Dominique, thanks for the quick reply!

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>


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

DLW

At 01:10 PM 6/9/2004, you wrote:

>No, no, no. If your task depend on 3rd party classes, then it will never be
>loaded unless these classes are available, so your task having a <classpath>
>nested element does no good.
>
>The 3rd party classes you require either must be in the system CLASSPATH, or
>in ant/lib (as JARs), or specified explicitly at <taskdef> time in a nested
><classpath>. --DD

DLW
DLWester@pobox.com
<><


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


Mime
View raw message