• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Error using java2wsdl ant task

Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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="service.name" value="SampleStudentService" />
<property name="dest.dir" value="build" />
<property name="dest.dir.classes" value="${dest.dir}/${service.name}" />
<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="axis-tasks.properties"
classpathref="build.class.path" />

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

<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}/${service.name}.aar" />

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


Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have included axis-ant.jar,axis.jar in the axis2/lib folder.

Have you included the JAX-RPC API (jaxrpc.jar)?
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic