users@jax-rpc.java.net

Re: Can't find com.sun.xml.rpc.tools.ant.Wscompile

From: Venkatasiva KONDAPALLI <vpk_at_bodc.ac.uk>
Date: Wed, 19 Nov 2003 17:25:09 +0000

Hi Bobby,
             Sorry for the late response,I setup all the commands and
they are working fine.The Ant version Iam using is 1.5.4 which comes
with JWSDP1.3 package for Windows.
I still got the same problem.It couldn't find the Class "class
com.sun.xml.rpc.tools.ant.Wscompile"
Iam just trying to write a simple Hello program,taking the Build.XML
from /jaxrpc/samples/HelloWorld" application and made small changes to
my Build.XML file and got that Error.
IAm just including my Build.XML file below.Build.properties is same as
in the "HelloWorld" example.
—--------------------------BUILD.XML--------------------
<?xml version="1.0"?>
<!--
 Copyright 2003 Sun Microsystems, Inc. All rights reserved.
 SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<project name="HelloService" default="build-war" basedir=".">
        <property file="build.properties"/>
        <property name="endpoint"
value="http://localhost:8080/jaxrpc-HelloService/hello"/>
        <property name="server.port.url"
value="http://localhost:8080/jaxrpc-HelloService/hello"/>
        <property name="appname" value="${ant.project.name}"/>
        <property name="source.home"
value="${sampleshome}/${appname}/src"/>
        <property name="compile.debug" value="true"/>
        <property name="compile.optimize" value="false"/>
        <property name="sampleshome"
location="C:/jwsdp-1.3/jaxrpc/samples" />
        <property name="build" location="${sampleshome}/build" />
        <property name="dist" location="${sampleshome}/dist" />
        <property name="config.rpcenc.file"
value="${sampleshome}/${appname}/config.xml"/>
         <property name="model.rpcenc.file"
value="${sampleshome}/${appname}/build/model.gz"/>
        <property name="webapp.webxml"
value="${sampleshome}/${appname}/web.xml"/>
        <path id="compile.classpath">
                <pathelement location="${javamail.jar}"/>
                <pathelement location="${jaf.jar}"/>
                <pathelement location="${jaxp-api.jar}"/>
                <pathelement location="${dom.jar}"/>
                <pathelement location="${sax.jar}"/>
                <pathelement location="${xalan.jar}"/>
                <pathelement location="${xercesImpl.jar}"/>
                <pathelement location="${jaxrpc-api.jar}"/>
                <pathelement location="${jaxrpc-spi.jar}"/>
                <pathelement location="${jaxrpc-impl.jar}"/>
                <pathelement location="${saaj-api.jar}"/>
                <pathelement location="${saaj-impl.jar}"/>
                <pathelement location="${relaxngDatatype.jar}"/>
                <pathelement location="${xsdlib.jar}"/>
                <pathelement location="${jax-qname.jar}"/>
                <pathelement location="${ant.jar}"/>
        </path>
        <!--jwsdp.shared=${jwsdphome}/jwsdp-shared
        jaxp.home=${jwsdphome}/jaxp
        jaxrpc.home=${jwsdphome}/jaxrpc
        saaj.home=${jwsdphome}/saaj
        
        wscompile=${jaxrpchome}/bin
        wsdeploy=${jaxrpchome}/bin -->
        
<!--<taskdef name="set-wscompile"
value="${jaxrpchome}/bin/wscompile.bat" />
 <taskdef name="set-wsdeploy" >
     <condition property="wsdeploy"
value="${jaxrpchome}/bin/wsdeploy.bat">
        <os family="windows"/>
     </condition>
     <condition property="wsdeploy"
value="${jaxrpchome}/bin/wsdeploy.sh">
        <not>
           <os family="windows"/>
        </not>
     </condition>
 </taskdef> -->
 <taskdef name="wscompile"
classname="com.sun.xml.rpc.tools.ant.Wscompile.bat">
                <classpath refid="compile.classpath"/>
 </taskdef>
 <taskdef name="wsdeploy"
classname="com.sun.xml.rpc.tools.ant.Wsdeploy.bat">
             <classpath refid="compile.classpath"/>
 </taskdef>
        <target name="init">
                <echo message="-------- ${appname} Sample --------"/>
        </target>
        <target name="build" depends="build-war">
                <echo message=" Building...."/>
        </target>
        
        <target name="prepare" depends="init">
                <!-- <mkdir dir="${samplesbuild}"/>
                <mkdir dir="${samplesbuild}/${appname}/build"/> -->
                <mkdir dir="${sampleshome}/${appname}/build"/>
                <mkdir dir="${sampleshome}/${appname}/dist"/>
                
                <!-- <mkdir
dir="${samplesbuild}/${appname}/classes/server"/> -->
                <!-- <mkdir
dir="${samplesbuild}/${appname}/classes/client"/>
                            <mkdir
dir="${samplesbuild}/${appname}/dist"/>-->
        </target>
        <target name="generate-client" depends="prepare">
       <!--<antcall target="edit-config">
         <param name="config.rpcenc.file"
value="${config.rpcenc.file}"/>
      </antcall> -->
  <set-wscompile
         keep="true"
         client="true"
        base="${sampleshome}/$appname}/src"
         xPrintStackTrace="true"
         verbose="false"
         classpath="${compile.classpath}"
         config="${config.rpcenc.file}">
          <classpath>
            <path refid="compile.classpath"/>
         </classpath>
    </set-wscompile>
   <antcall target="unedit-config">
      <param name="config.rpcenc.file" value="${config.rpcenc.file}"/>
   </antcall>
  </target>
        <target name="generate-server" depends="prepare">
                <antcall target="edit-config">
                        <param name="config.rpcenc.file"
value="${config.rpcenc.file}"/>
                </antcall>
                <set-wscompile keep="true" import="true"
base="${sampleshome}/$appname}/src" xPrintStackTrace="true"
verbose="false" model="${model.rpcenc.file}"
       classpath="${compile.classpath}" config="${config.rpcenc.file}">
                        <classpath>
                                <path refid="compile.classpath"/>
                        </classpath>
</set-wscompile>
                <antcall target="unedit-config">
                        <param name="config.rpcenc.file"
value="${config.rpcenc.file}"/>
                </antcall>
        </target>
        <target name="compile-server" depends="generate-server">
                <javac srcdir="${sampleshome}/${appname}/src/"
destdir="${sampleshome}/${appname}/build" debug="${compile.debug}">
                        <classpath refid="compile.classpath"/>
                </javac>
        </target>
        <target name="create-war" depends="compile-server">
                <war
warfile="${sampleshome}/${appname}/jaxrpc-${appname}-raw.war"
webxml="${webapp.webxml}">
                        <!-- <webinf dir="${basedir}/"
includes="*.wsdl,jaxrpc-ri.xml"/> -->
                        <webinf dir="${basedir}/"
includes="jaxrpc-ri.xml"/>
                        <webinf dir="${basedir}/"
includes="${webapp.jaxrpc.file}" defaultexcludes="no"/>
                        <webinf dir="${sampleshome}/${appname}"
includes="${model.rpcenc.file}" defaultexcludes="no"/>
                        <classes dir="${sampleshome}/${appname}/build"
includes="**/*.class" defaultexcludes="no"/>
                </war>
                <delete dir="${sampleshome}/${appname}/build"/>
        </target>
        <target name="build-war" depends="create-war">
                <echo message="-------- ${appname} --------"/>
                <wsdeploy keep="true"
inWarFile="${sampleshome}/${appname}/${dist}/jaxrpc-${appname}-raw.war"
outWarFile="${sampleshome}/${appname}/${dist}/jaxrpc-${appname}.war"
verbose="true">
                        <classpath refid="compile.classpath"/>
                </wsdeploy>
        </target>
        <target name="deploy-war" depends="build-war">
                <copy
file="${sampleshome}/${appname}/jaxrpc-${appname}.war"
todir="${sampleshome}/${appname}"/>
        </target>
        <!-- <target name="compile-client" depends="generate-client">
    <javac srcdir="${samples.home}/${appname}/src"
           destdir="${samplesbuild}/${appname}/build"
             debug="${compile.debug}"
          optimize="${compile.optimize}">
      <classpath refid="compile.classpath"/>
    </javac>
  </target>
        <path id="run.classpath">
                <path refid="compile.classpath"/>
                <pathelement
location="${samplesbuild}/${appname}/src"/>
        </path> -->
        <!-- <target name="run-client" depends="compile-client">
    <java classname="hello.HelloClient"
          classpathref="run.classpath"
          fork="true">
              <sysproperty key="endpoint" value="${endpoint}"/>
        <arg value="${server.port.url}"/>
    </java>
  </target> -->
        <target name="clean">
                <delete dir="${buildhome}"/>
                <delete dir="${samplesbuild}/${appname}"/>
        </target>
        <!--
   @param: config.file - file to be edited
-->
        <target name="edit-config">
                <replace file="${config.rpcenc.file}" token='location="'
value='location="${basedir}/'/>
        </target>
        <!-- @param: config.file - file to be edited -->
   
        <target name="unedit-config">
                <replace file="${config.rpcenc.file}"
token='location="${basedir}/' value='location="'/>
        </target>
</project>

—----------------------------------------------------------------

Sorry for the long email..,I didnt edited the Build.xml file properly.I
just commented some parts of the file,which are not necessary for my
program.I want to generate the WSDL file from Service endpoints.

Thanks Once again
VPK..,

















>>> robert.bissett_at_sun.com 13/11/03 18:08:40 >>>
Venkatasiva KONDAPALLI wrote:
> Hi,
> Iam still getting the following error after setting up the
Environment
> variables(as shown in "Samples.html" doc).
>
> Error: "taskdef class com.sun.xml.rpc.tools.ant.Wscompile can not
> found"

Hi,

I tried it with a fresh install of the jwsdp and a terminal with no
environment and it worked fine for me. Could you send more info, such
as
the output from the following commands (after setting up the
environment)?

echo $JWSDP_HOME
echo $ANT_HOME
ls $ANT_HOME
echo $PATH
which ant
ant -version

If you're running win, then replace with the appropriate commands. It
sounds like you're calling ant from some place other than the jwsdp.

Cheers,
Bobby


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








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