Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Please help Exception in thread "main"

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<?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
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic