echo the classpath "classpath-jboss" during runtime,
so that it can be seen whether all reqd jar files
are in classpath or not.
Srinivas
-----Original Message-----
From: trebor iksrazal [mailto:iksrazal_at_yahoo.com]
Sent: 08 March 2006 03:34
To: users_at_jax-rpc.dev.java.net
Subject: Re: Using ant task wscompile
--- burngreg <burngreg_at_yahoo.com> wrote:
> Hi,
> I am trying to generate stubs from the WSDL using
> the ant task
> wscompile. However it just throws a ClassDefNotFound
> exception
> saying that it cannot find JAXRPCException which
> when I check
> jars is in jaxrpc-api.jar which I have in my
> classpath. Any
> suggestions would be appreciated.
>
> Regards
> Greg
>
This is a low traffic list - been a while since I
replied ;-) .
Here's the build.xml I use when programming with jwsdp
- last tested with jwsdp 1.6:
<!DOCTYPE project>
<project name="jaxrpc-test" default="build-jboss"
basedir=".">
<property file="build.properties"/>
<property file="deploy_env.properties"/>
<property name="build" value="build"/>
<property name="src" value="src"/>
<property name="dist" value="dist"/>
<path id="classpath-jboss">
<fileset dir="${jboss.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<!-- load jars for the wscompile ant task
These can be removed if not desired
-->
<fileset dir="${jwsdp.home}/jwsdp-shared/lib/">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jwsdp.home}/jaxrpc/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jwsdp.home}/jaxp/lib/endorsed">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jwsdp.home}/jaxp/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.home}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.tools}">
<include name="tools.jar"/>
</fileset>
</path>
<target name="clean" >
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="prepare"
description="Creates the build directory" >
<echo message="Creating the required
directories...." />
<mkdir dir="${build}" />
<mkdir dir="${build}/META-INF" />
<mkdir dir="${build}/META-INF/wsdl" />
</target>
<taskdef name="wscompile"
classname="com.sun.xml.rpc.tools.ant.Wscompile">
<classpath refid="classpath-jboss"/>
</taskdef>
<!--
Note that this task
is poorly documented/implemented by Sun and only
works if you specifically tell it where tools.jar
is.
Its convienant for IDE's, however.
Alternatively, run:
wscompile.sh -import -mapping
resources/CallCentreWeb_Mapping.xml
resources/config-wsdl.xml
Then its up to you to get those classes into the
jsr, see the base command
-->
<target name="ws" description="Generate compiled
complex interfaces and classes from wsdl as a jar for
an IDE" depends="clean,prepare">
<echo message="Creating the custom complex
objects...." />
<delete dir="resources/com" />
<wscompile
fork="true"
base="resources"
import="true"
mapping="resources/CallCentreWeb_Mapping.xml"
verbose="true"
debug="true"
config="resources/config-wsdl.xml">
<classpath refid="classpath-jboss"/>
</wscompile>
<echo message="Creating the IDE custom complex
objects JAR" />
<copy todir="${build}">
<fileset dir="resources">
<include name="**/*.class"/>
</fileset>
</copy>
<jar jarfile="lib/soap-ide_only.jar" >
<fileset dir="${build}" />
</jar>
<delete dir="${build}" />
</target>
<target name="compile-jboss" depends="prepare"
description="Compile source code" >
<javac srcdir="src" destdir="${build}"
debug="true">
<include name="**/*.java" />
<classpath refid="classpath-jboss"/>
</javac>
</target>
<target name="build-jboss" depends="clean"
description="when you don't have sun for class
generation from wsdl/interface and for packaging">
<copy todir="${build}/META-INF/wsdl">
<fileset dir="resources">
<include name="**/*.wsdl"/>
</fileset>
</copy>
<copy todir="${build}/META-INF">
<fileset dir="resources">
<include name="**/*Mapping.xml"/>
<include name="**/jboss*.xml"/>
<include name="**/webservices.xml"/>
<include name="**/ejb-jar.xml"/>
</fileset>
</copy>
<copy todir="${build}">
<!-- get complex object classes -->
<fileset dir="resources">
<include name="**/*.class"/>
</fileset>
<fileset dir="src">
<include name="**/*.prop*"/>
</fileset>
</copy>
<antcall target="compile-jboss" />
</target>
<target name="dist-jboss" depends="build-jboss"
description="Preparing the distribution...">
<delete dir="${dist}" />
<mkdir dir="${dist}" />
<copy todir="${dist}">
<fileset dir="resources">
<include name="mysql-connector-java-*.jar"/>
</fileset>
</copy>
<filter token="MySQL.host" value="${MySQL.host}"
/>
<filter token="MySQL.port" value="${MySQL.port}"
/>
<filter token="MySQL.user_name"
value="${MySQL.user_name}" />
<filter token="MySQL.user_password"
value="${MySQL.user_password}" />
<copy todir="${dist}" filtering="true">
<fileset dir="resources">
<include name="mysql-connector-java-*.jar"/>
<include name="*-service.xml"/>
<include name="*-ds.xml"/>
<include name="*-instructions.txt"/>
</fileset>
</copy>
<jar
jarfile="${dist}/CallCentreWebServiceJAR.jar" >
<fileset dir="${build}" />
</jar>
<delete dir="${build}" />
</target>
<target name="deploy"
description="Put jar into JBoss"
depends="ws,build-jboss,dist-jboss">
<echo message="Building JAR and putting it into
${deploy.home} ..."/>
<copy todir="${deploy.home}">
<fileset dir="${dist}">
<include name="**/*.jar"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
</project>
HTH,
iksrazal
http://www.braziloutsource.com/
Sufficiently advanced incompetence is indistinguishable from malice.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________