File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Web Services
Bookmark "Error  using java2wsdl ant task" Watch "Error  using java2wsdl ant task" New topic
Author

Error using java2wsdl ant task

Deepti Guduru
Greenhorn

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="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" />
</fileset>
</path>

<taskdef resource="axis-tasks.properties"
classpathref="build.class.path" />

<target name="java2wsdl">
<axis-java2wsdl classname="org.apache.axis2.training.StudentWebService"
output="${wsdl.dir}/StudentWebService.wsdl"
location="http://localhost:8081/axis2/services/StudentWebService"
namespace="training.axis2.apache.org" style="RPC">
<classpath>
<pathelement location="./bin/org/apache/axis2/training/*.class"/>
</classpath>
<mapping namespace="training.axis2.apache.org" package="org.apache.axis2.training"/>
</axis-java2wsdl>
</target>

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

</target>


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

</target>

<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>



<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" />

</target>

</project>
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: http://aspose.com/file-tools
 
subject: Error using java2wsdl ant task