This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Services and the fly likes Error  using java2wsdl ant task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Error  using java2wsdl ant task" Watch "Error  using java2wsdl ant task" New topic

Error using java2wsdl ant task

Deepti Guduru

Joined: May 22, 2008
Posts: 12
Hi All,
Iam running a simple webservice using axis2-1.4 and apachetomcat .iam trying to run a java2wsdl from the ANT Build.xml file. Iam unable to do it. Iam geting the below exception
[axis-java2wsdl] java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMappingRegistry

I have included axis-ant.jar,axis.jar in the axis2/lib folder.
Iam posting my build.xml below, can someone clarify my doubt please

<project name="StudentService" basedir="." default="generate.service">

<property name="" value="SampleStudentService" />
<property name="dest.dir" value="build" />
<property name="dest.dir.classes" value="${dest.dir}/${}" />
<property name="dest.dir.lib" value="${dest.dir}/lib" />
<property name="tomcat.home" value="C:/Program Files/Apache Software Foundation/Apache Tomcat 6.0.14/webapps" />
<property name="repository.path" value="${tomcat.home}/axis2/WEB-INF" />
<property name ="wsdl.dir" value="resources"/>

<path id="build.class.path">
<fileset dir="${repository.path}/lib">
<include name="*.jar" />

<taskdef resource=""
classpathref="build.class.path" />

<target name="java2wsdl">
<axis-java2wsdl classname=""
namespace="" style="RPC">
<pathelement location="./bin/org/apache/axis2/training/*.class"/>
<mapping namespace="" package=""/>

<target name="compile">
<javac srcdir="src" destdir="./bin" includes="org/apache/axis2/training/**">
<classpath refid="build.class.path" />


<target name="clean">
<delete dir="${dest.dir}" />


<target name="prepare">
<mkdir dir="${dest.dir}" />
<mkdir dir="${dest.dir}/lib" />
<mkdir dir="${dest.dir.classes}" />
<mkdir dir="${dest.dir.classes}/META-INF" />

<target name="generate.service" depends="clean,prepare,compile">

<copy file="src/META-INF/services.xml" tofile="${dest.dir.classes}/META-INF/services.xml" overwrite="true" />
<copy file="./bin/org/apache/axis2/training/*.class" tofile="${dest.dir.classes}/org/apache/axis2/training/*.class" overwrite="true"/>
<copy file="./resources/StudentWebService.wsdl" tofile="${dest.dir.classes}/resources/StudentWebService.wsdl" overwrite="true"/>

<jar basedir="${dest.dir.classes}" destfile="${dest.dir}/${}.aar" />

<copy file="${dest.dir}/${}.aar" tofile="${repository.path}/services/${}.aar" overwrite="true" />


Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
I have included axis-ant.jar,axis.jar in the axis2/lib folder.

Have you included the JAX-RPC API (jaxrpc.jar)?
I agree. Here's the link:
subject: Error using java2wsdl ant task
jQuery in Action, 3rd edition