This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Please help Exception in thread "main"" Watch "Please help Exception in thread "main"" New topic

Please help Exception in thread "main"

Robo Fazak

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

<taskdef name="apt" classname="">
<pathelement location="${lib.home}/jaxws-tools.jar"/>

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

<target name="build-server-java" depends="setup">
<path refid="jaxws.classpath"/>
<pathelement location="${basedir}/src"/>
<option key="r" value="${build.home}"/>
<source dir="${basedir}/src">
<include name="**/server/*.java"/>
<include name="**/common/*.java"/>


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

<target name="deploy">
<copy file="${build.war.home}/jaxws-${}.war"

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


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"


SCJP 1.6
I agree. Here's the link:
subject: Please help Exception in thread "main"