You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by joncaulfield <da...@yahoo.com> on 2004/07/28 21:04:30 UTC

NoClassDefFound when using Axis and Ant

The following build script fails when I run the
wsdl2java
target from my DOS prompt. The exact exception I'm
getting is:
java.lang.NoClassDefFoundError:
org/apache/axis/wsdl/toJava/JavaClassWriter
This occurs after axis generates 50 or so source
files.

An obvious work-around is to add all the axis jars to
my system
classpath, but I still want to understand why the
classpath
as specified in my wsdl2java target is not working,
since I was 
expecting the AntClassLoader to use the classpath
specified
in the target.

Any hints or suggestions will be appreciated. 

Thanks.


My build script is:

<project default="wsdl2java" name="ors">
	<property name="axis.lib"
value="c:/axis-1_2beta/lib"/>

	<path id="axis.classpath">
		<pathelement location="${axis.lib}/axis.jar"/>
		<pathelement location="${axis.lib}/axis-ant.jar"/>
		<pathelement
location="${axis.lib}/commons-discovery.jar"/>
		<pathelement
location="${axis.lib}/commons-logging.jar"/>
		<pathelement location="${axis.lib}/jaxrpc.jar"/>
		<pathelement
location="${axis.lib}/log4j-1.2.8.jar"/>
		<pathelement location="${axis.lib}/saaj.jar"/>
		<pathelement location="${axis.lib}/wsdl4j.jar"/>
	</path>	
	
      <taskdef name="axis-wsdl2java"
	
classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"

    	      classpathref="axis.classpath"/>
	
	<target name="wsdl2java">
        <axis-wsdl2java  output="../src/" 
testcase="true"
			verbose="true"  
	
url="http://webservices.micros.com/wbr/nameservice.asmx?WSDL"
>
		  <mapping
namespace="http://axis.apache.org/ns/interop"
package="interop" />
			<classpath>
				<pathelement
location="${axis.lib}/axis.jar"/>
				<pathelement
location="${axis.lib}/axis-ant.jar"/>
				<pathelement
location="${axis.lib}/commons-discovery.jar"/>
				<pathelement
location="${axis.lib}/commons-logging.jar"/>
				<pathelement
location="${axis.lib}/jaxrpc.jar"/>
				<pathelement
location="${axis.lib}/log4j-1.2.8.jar"/>
				<pathelement
location="${axis.lib}/saaj.jar"/>
				<pathelement
location="${axis.lib}/wsdl4j.jar"/>
			</classpath>        	
		</axis-wsdl2java>
    </target>
</project>