ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Alexander <malexan...@mobliss.com>
Subject taskdef with classpathref not working
Date Wed, 11 Jan 2006 00:06:44 GMT
I want to be able to define task's that use either the axis-1_1
or the axis-1_2_1 jars depending upon the value of a property.
The intent is to avoid having users explicitly set their CLASSPATH
before invoking the build. I have found examples such as the following
that appear to be exactly what I want but I have not been able to get
this (or a large number of other variants) to work.

I'm running java 1.4.2 with ant 1.6.0 on linux.

    <target name="init_axis-1_2_1" unless="axis.version.1_1">
        <echo message="Setting axis.classpath to **/*.jar in 
${axis.home}/lib"/>
        <path id="axis.classpath">
            <fileset dir="${axis.home}/lib">
                <include name="**/*.jar" />
            </fileset>
        </path>
        <property name="axis.classpath.string" refid="axis.classpath"/>
        <echo message="axis.classpath=${axis.classpath.string}"/>
        <taskdef name="axis-wsdl2java"
                 classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
                 classpathref="axis.classpath">
        </taskdef>
    </target>
 

This runs great, the conditional is triggered correctly, the axis 
classpath is
set correctly, but I get the following error upon build.

init_axis-1_2_1:
     [echo] Setting axis.classpath to **/*.jar in /opt/jlib/axis-1_2_1/lib
     [echo] 
axis.classpath=/opt/jlib/axis-1_2_1/lib/activation.jar:/opt/jlib/axis-1_2_1/lib/axis-ant.jar:/opt/jlib/axis-1_2_1/lib/axis.jar:/opt/jlib/axis-1_2_1/lib/commons-discovery-0.2.jar:/opt/jlib/axis-1_2_1/lib/commons-httpclient-3.0-rc2.jar:/opt/jlib/axis-1_2_1/lib/commons-logging-1.0.4.jar:/opt/jlib/axis-1_2_1/lib/jaxrpc.jar:/opt/jlib/axis-1_2_1/lib/log4j-1.2.8.jar:/opt/jlib/axis-1_2_1/lib/mailapi_1_3_1.jar:/opt/jlib/axis-1_2_1/lib/saaj.jar:/opt/jlib/axis-1_2_1/lib/servlet.jar:/opt/jlib/axis-1_2_1/lib/wsdl4j-1.5.1.jar:/opt/jlib/axis-1_2_1/lib/xercesImpl.jar:/opt/jlib/axis-1_2_1/lib/xmlParserAPIs.jar
 
BUILD FAILED
/u01/opt/apps/share/lib/moSoap/moSoap-2.0.3X.xml:111: taskdef A class
needed by class org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask cannot be
found: org/apache/axis/utils/DefaultAuthenticator
        at 
org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:501)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:214)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
        at org.apache.tools.ant.Task.perform(Task.java:401)
        at org.apache.tools.ant.Target.execute(Target.java:338)
        at org.apache.tools.ant.Target.performTasks(Target.java:365)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
        at org.apache.tools.ant.Main.runBuild(Main.java:669)
        at org.apache.tools.ant.Main.startAnt(Main.java:220)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
Caused by: java.lang.NoClassDefFoundError: 
org/apache/axis/utils/DefaultAuthenticator

The class is definitely on the classpath.

Anyone know what gives?

Thanks!

Mike A.
Mobliss

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


Mime
View raw message