aspose file tools*
The moose likes Web Services and the fly likes Please help Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Please help Exception in thread "main"" Watch "Please help Exception in thread "main"" New topic
Author

Please help Exception in thread "main"

Robo Fazak
Greenhorn

Joined: Mar 25, 2010
Posts: 8
<?xml version="1.0" encoding="UTF-8"?>

<project basedir="." default="server" name="WebServiceServer">

<property environment="env"/>
<property name="as.home" value="${env.AS_HOME}"/>
<property name="lib.home" value="${env.JAXWS_HOME}/lib"/>
<property name="lib.sample.home" value="${basedir}/../lib"/>
<property name="build.home" value="${basedir}/build"/>
<property name="build.war.home" value="${build.home}/war"/>
<property name="build.classes.home" value="${build.home}/classes"/>


<path id="jaxws.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${lib.home}">
<include name="*.jar"/>
<exclude name="j2ee.jar"/>
</fileset>
</path>

<taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
<classpath>
<pathelement location="${lib.home}/jaxws-tools.jar"/>
</classpath>
</taskdef>

<target name="clean">
<delete dir="${build.home}" includeEmptyDirs="true"/>
</target>
<target name="setup">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.classes.home}"/>
<mkdir dir="${build.war.home}"/>
</target>

<target name="build-server-java" depends="setup">
<apt
fork="true"
debug="true"
verbose="${verbose}"
destdir="${build.classes.home}"
sourcedestdir="${build.classes.home}"
sourcepath="${basedir}/src">
<classpath>
<path refid="jaxws.classpath"/>
<pathelement location="${basedir}/src"/>
</classpath>
<option key="r" value="${build.home}"/>
<source dir="${basedir}/src">
<include name="**/server/*.java"/>
<include name="**/common/*.java"/>
</source>
</apt>

</target>

<target name="create-war">
<war warfile="${build.war.home}/jaxws-${ant.project.name}.war" webxml="etc/web.xml">
<webinf dir="${basedir}/etc" includes="sun-jaxws.xml"/>
<zipfileset
dir="${basedir}/etc"
includes="*.wsdl, *.xsd"
prefix="WEB-INF/wsdl"/>
<classes dir="${build.classes.home}"/>
</war>
</target>

<target name="deploy">
<copy file="${build.war.home}/jaxws-${ant.project.name}.war"
todir="${env.CATALINA_HOME}/webapps"/>
</target>

<target name="server">
<echo message="server:Builds and deploy the service endpoint WAR"/>
<antcall target="clean"/>
<antcall target="build-server-java"/>
<antcall target="create-war"/>
<antcall target="deploy"/>
</target>

</project>

This my build file for deploying my JAX-WS RI server in Tomcat and when I run this build file from eclipse I am getting the following error. Can anybody suggest a solution. I am new to this technology so if I made any mistake here please let me know that.

[apt] java.lang.NoClassDefFoundError: com/sun/tools/apt/Main
[apt] Exception in thread "main"

Thanks


SCJP 1.6
 
jQuery in Action, 2nd edition
 
subject: Please help Exception in thread "main"