Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

JaxRPC HelloService

Posted on 2006-05-31
18
Medium Priority
?
313 Views
Last Modified: 2013-11-23
I installed JAX-RPC 2.0 EA over JWSDP 1.5 with the steps from http://weblogs.java.net/blog/arungupta/archive/2005/04/jaxrpc_20_ea_on_1.html

Everything went fine, my Tomcat is working but I still can not run helloservice from C:\jwstutorial13\examples\jaxrpc

Form DOS Command I go to C:\jwstutorial13\examples\jaxrpc and type "ant build"
And I always get the following error message:

C:\jwstutorial13\examples\jaxrpc\helloservice>ant build
Buildfile: build.xml

BUILD FAILED
C:\jwstutorial13\examples\jaxrpc\common\targets.xml:30: taskdef class org.apache
.catalina.ant.DeployTask cannot be found

Total time: 2 seconds

What might be the problem?
Here are my system variables:

ANT_HOME: C:\jwsdp-1.3\apache-ant\bin
CATALINA_HOME: C:\tomcat50-jwsdp\tomcat50-jwsdp
CLASSPATH: C:\j2sdk1.4.2_11;C:\jwsdp-1.3\jwstutorial13\examples\jaxrpc\helloservice;C:\jwsdp-1.3\bin;C:\jwsdp-1.3\apache-ant\bin;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
JAVA_HOME: C:\j2sdk1.4.2_11
JWSDP_HOME: C:\jwsdp-1.3\bin

0
Comment
Question by:johnmarco
  • 6
  • 6
  • 3
  • +1
16 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16802766
copy the catalina ant jar from <tomcat>/server/lib to <ant>/lib
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16803658
Please post your target.xml here. Don't copy lib. When you want upgrade Tomcat, you can't remember to upgrade the libs you put in ant lib folder.
Phuoc
0
 

Author Comment

by:johnmarco
ID: 16805004
@ objects: I tried and got the same error message.

@ phuoocnh: Here is the traget.xml

<!-- targets.xml: Referenced by the build.xml files, this file
     contains targets common to all of the jaxrpc examples.  -->

  <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-impl.jar}"/>
    <pathelement location="${jaxrpc-spi.jar}"/>
    <pathelement location="${commons-logging.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}"/>
    <pathelement location="${build}/shared"/>
  </path>
 
  <path id="run.classpath">
     <path refid="compile.classpath"/>
     <pathelement location="${dist}/${client.jar}"/>
  </path>
 
  <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
  <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" />
  <taskdef name="list" classname="org.apache.catalina.ant.ListTask" />
  <taskdef name="start" classname="org.apache.catalina.ant.StartTask" />
  <taskdef name="stop" classname="org.apache.catalina.ant.StopTask" />
  <taskdef name="install"  classname="org.apache.catalina.ant.InstallTask"/>
  <taskdef name="reload"   classname="org.apache.catalina.ant.ReloadTask"/>
  <taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>      

  <target name="install" description="Install web application"
          depends="build">
    <install url="${url}" username="${username}" password="${password}"
          path="/${context.path}" war="file:${example.path}/${build}"/>
  </target>

 
    <target name="deploy"
       description="Deploys a Web application">
        <deploy url="${url}" username="${username}" password="${password}"
          path="/${context.path}" war="file:${war.path}"  
        />
    </target>
 
    <target name="undeploy"
       description="Undeploys a Web application">
        <undeploy url="${url}" username="${username}" password="${password}"
          path="/${context.path}"    
        />
    </target>
 
    <target name="redeploy"
        description="Undeploys and deploys a Web aplication">
        <antcall target="undeploy" />
        <antcall target="deploy" />
    </target>
 
    <target name="list"
       description="Lists Web applications">
       <echo message="Listing the applications...."/>
       <list
          url="${url}"
          username="${username}"
          password="${password}"
        />
    </target>
 
    <target name="start"
       description="Starts a Web application">
       <echo message="Starting the application...."/>
       <start
          url="${url}"
          username="${username}"
          password="${password}"
          path="/${context.path}"
        />
    </target>
 
    <target name="stop"
       description="Stops a Web application">
       <echo message="Stopping the application...."/>
       <stop
          url="${url}"
          username="${username}"
          password="${password}"
          path="/${context.path}"
        />
  </target>

    <target name="prepare"
     description="Creates the build directory" >
     <echo message="Creating the required directories...." />
     <mkdir dir="${build}/${example}" />
  </target>

  <target name="prepare-dist"
     description="Creates the dist directory" >
     <echo message="Creating the required directories...." />
     <mkdir dir="${dist}" />
  </target>

  <target name="set-wscompile" >
     <condition property="wscompile" value="${wscompile.dir}/wscompile.bat">
        <os family="windows"/>
     </condition>
     <condition property="wscompile" value="${wscompile.dir}/wscompile.sh">
        <not>
           <os family="windows"/>
        </not>
     </condition>
  </target>

  <target name="set-wsdeploy" >
     <condition property="wsdeploy" value="${wsdeploy.dir}/wsdeploy.bat">
        <os family="windows"/>
     </condition>
     <condition property="wsdeploy" value="${wsdeploy.dir}/wsdeploy.sh">
        <not>
           <os family="windows"/>
        </not>
     </condition>
  </target>
 
  <target name="compile-service" depends="prepare"
      description="Compiles the server-side source code">
      <echo message="Compiling the server-side source code...."/>
      <javac srcdir="${src}"
             destdir="${build}"
             includes="*.java"
             excludes="*Client.java">
         <classpath refid="compile.classpath"/>
      </javac>
  </target>
 
  <target name="setup-web-inf"
       description="Copies files to build/WEB-INF">
       <echo message="Setting up ${build}/WEB-INF...."/>
       <delete dir="${build}/WEB-INF" />
       <copy todir="${build}/WEB-INF/classes/${example}">
           <fileset dir="${build}/${example}" />
           <fileset dir="${build}/${example}" />
       </copy>
       <copy file="${build}/${model.file}" todir="${build}/WEB-INF" />
       <copy file="web.xml" todir="${build}/WEB-INF" />
       <copy file="jaxrpc-ri.xml" todir="${build}/WEB-INF" />
    </target>
 
    <target name="package-service" depends="prepare-dist"
        description="Packages the WAR file">
        <echo message="Packaging the WAR...."/>
        <delete file="${dist}/${portable.war}" />
        <jar jarfile="${dist}/${portable.war}" >
          <fileset dir="${build}" includes="WEB-INF/**" />
        </jar>
  </target>
 
  <target name="process-war" depends="set-wsdeploy"
        description="Runs wsdeploy to generate the ties and
                     create a deployable WAR file">
     <delete file="dist/${deployable.war}" />
     <antcall target="run-wsdeploy">
       <param name="param1" value="-o dist/${deployable.war} dist/${portable.war}"/>
     </antcall>  
  </target>
   

  <target name="run-wscompile"  depends="prepare,set-wscompile"
       description="Runs wscompile">
    <echo message="Running wscompile:"/>
    <echo message="  ${wscompile} ${param1}"/>
    <exec executable="${wscompile}">
       <arg line="${param1}"/>
    </exec>
  </target>

  <target name="run-wsdeploy"  depends="prepare,set-wsdeploy"
       description="Runs wsdeploy">
    <echo message="Running wsdeploy:"/>
    <echo message="  ${wsdeploy} ${param1}"/>
    <exec executable="${wsdeploy}">
       <arg line="${param1}"/>
    </exec>
  </target>
 
  <target name="generate-sei-service"
      description="Runs wscompile to generate the model file">
    <antcall target="run-wscompile">
      <param name="param1" value="-define -d ${build} -nd ${build}
      -classpath ${build} ${config.interface.file}
      -model ${build}/${model.file}"/>
    </antcall>
    <delete file="${build}/MyHelloService.wsdl"/>
  </target>

  <target name="generate-interface"
      description="Runs wscompile to generate the service endpoint  
                   interface">
    <antcall target="run-wscompile">
      <param name="param1" value="-import -d ${build} -nd ${build}
      -f:norpcstructures -classpath ${build} ${config.wsdl.file}"/>
    </antcall>
  </target>

  <target name="generate-stubs"
      description="Runs wscompile to generate the client stub classes">
    <antcall target="run-wscompile">
      <param name="param1" value="-gen:client -d ${build}
      -classpath ${build} ${config.wsdl.file}"/>
    </antcall>
  </target>

  <target name="compile-client" depends="prepare"
      description="Compiles the client-side source code"  >
      <echo message="Compiling the client source code...."/>
    <javac srcdir="${src}"
           destdir="${build}"
           includes="*.java">
     <classpath refid="compile.classpath"/>
     <classpath path="${build}" />
    </javac>
  </target>

  <target name="package-client" depends="prepare-dist"
      description="Builds the JAR file that contains the client">
      <echo message="Building the client JAR  file...."/>
      <delete file="${dist}/${client.jar}" />
      <jar jarfile="${dist}/${client.jar}" >
        <fileset dir="${build}" />
      </jar>
  </target>

  <target name="package-dynamic"  depends="prepare-dist"
      description="Builds the JAR file that contains the dynamic proxy client">
      <echo message="Building the client JAR  file...."/>
      <delete file="${dist}/${client.jar}" />
      <jar jarfile="${dist}/${client.jar}" >
        <fileset dir="${build}" includes="**/HelloClient.class" />
        <fileset dir="${build}" includes="**/HelloIF.class" />
      </jar>
  </target>

  <target name="build-service" depends="clean,compile-service,generate-sei-service,
      setup-web-inf,package-service,process-war"
     description="Executes the targets needed to build the service.">
  </target>

  <target name="build-static" depends="clean,generate-stubs,
     compile-client,package-client"
     description="Executes the targets needed to build a static stub client.">
  </target>

  <target name="build-dii" depends="clean,prepare,compile-client,package-client"
     description="Executes the targets needed to build a DII client.">
  </target>

  <target name="build-dynamic" depends="clean,prepare,generate-interface,
      compile-client,package-dynamic"
     description="Executes the targets needed to build a dynamic proxy client.">
  </target>

  <target name="build-webclient" depends="clean,generate-stubs"
     description="Executes the targets needed to build a web client.">
  </target>

  <target name="run-client"
     description="Runs a stand-alone (non-J2EE) client">
      <java classname="${client.class}" fork="yes" >
        <arg line="${endpoint.address}" />
        <classpath refid="run.classpath" />
    </java>
  </target>

    <target name="run-secure-client"
     description="Runs a client with basic authentication over SSL">
      <java classname="${client.class}" fork="yes" >
        <arg line="${username} ${password} ${endpoint.address}" />
        <classpath refid="run.classpath" />
    </java>
  </target>

    <target name="run-mutualauth-client"
     description="Runs a client with mutual authentication over SSL">
      <java classname="${client.class}" fork="yes" >
        <arg line="${key.store} ${key.store.password}
                   ${trust.store} ${trust.store.password}
                   ${endpoint.address}" />
        <classpath refid="run.classpath" />
    </java>
  </target>

  <target name="clean"
     description="Removes the build directory">
    <delete dir="${build}" />
  </target>

  <target name="listprops" depends="set-wscompile"
     description="Displays values of some of the properties of this
        build file">
     <echo message="jaxrpc.home = ${jaxrpc.home}" />
     <echo message="wscompile = ${wscompile}" />
     <echo message="build = ${build}" />
     <echo message="src = ${src}" />
     <echo message="dist = ${dist}" />
     <echo message=" " />
     <echo message="example = ${example}" />
     <echo message="client.jar = ${client.jar}" />
     <echo message="client.class = ${client.class}" />
     <echo message=" " />
     <echo message="host = ${host}" />
     <echo message="port = ${port}" />
     <echo message="secure.port = ${secure.port}" />
     <echo message="trust.store = ${trust.store}" />
     <echo message="trust.store.password = ${trust.store.password}" />
     <echo message=" " />
     <echo message="username = ${username}" />
     <echo message="password = ${password}" />
     <echo message="url = ${url}" />
     <echo message=" " />
     <echo message="context.path = ${context.path}" />
     <echo message="secure.context.path = ${secure.context.path}" />
     <echo message="url.pattern = ${url.pattern}" />
     <echo message="endpoint.address = ${endpoint.address}" />
     <echo message="secure.endpoint = ${secure.endpoint}" />
     <echo message=" " />
     <echo message="war.path = ${war.path}" />
     <echo message="portable.war = ${portable.war}" />
     <echo message="deployable.war = ${deployable.war}" />
     
     
  </target>


Any more suggestions.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Expert Comment

by:phuocnh
ID: 16806924
Hi johnmarco!
I think you just add pathelement:
<pathelement location="<path to catalina_ant.jar>"/>
Phuoc
0
 

Author Comment

by:johnmarco
ID: 16806992
can you give it with the correct syntax please?
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16807455
<path id="compile.classpath">
 .................................................
<pathelement location="c:\tomcat\server\lib\catalina_ant.jar"/>
</path>
Phuoc
0
 

Author Comment

by:johnmarco
ID: 16807625
I tried what you said and it did not work.

0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16807703
Where does your catalina_ant.jar locate?
<path id="compile.classpath">
 .................................................
<pathelement location="put it here"/>
</path>
When you continue to catch error, please try to make it details.
Phuoc
0
 

Author Comment

by:johnmarco
ID: 16808292
I have catalina_ant.jar in C:\tomcat50-jwsdp\tomcat50-jwsdp\server\lib and in C:\tomcat50-jwsdp\apache-ant\lib
I have also a folder called jaxrpc-2.0ea when I followed the steps from http://weblogs.java.net/blog/arungupta/archive/2005/04/jaxrpc_20_ea_on_1.html

Here is my build.xml file

C:\jwstutorial13\examples\common\targets.xml

  <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>      
  <taskdef name="install"  classname="org.apache.catalina.ant.InstallTask"/>
  <taskdef name="reload"   classname="org.apache.catalina.ant.ReloadTask"/>
  <taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>      
  <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>      
  <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>      

  <target name="list" description="List web applications" >
    <list url="${url}" username="${username}" password="${password}" />
  </target>

  <target name="install" description="Install web application"
          depends="build">
    <install url="${url}" username="${username}" password="${password}"
          path="/${context.path}" war="file:${build}"/>
  </target>


  <target name="reload" description="Reload web application"
          depends="build">
    <reload  url="${url}" username="${username}" password="${password}"
          path="/${context.path}"/>
  </target>

  <target name="remove" description="Remove web application">
    <remove url="${url}" username="${username}" password="${password}"
          path="/${context.path}"/>
  </target>

  <target name="package"
      description="Packages the WAR file">
      <echo message="Packaging the WAR...."/>
      <delete file="dist/${war.file}" />
      <jar jarfile="dist/${war.file}" >
        <fileset dir="${build}" />
      </jar>
  </target>

  <target name="deploy" description="Deploy a Web application">
      <deploy url="${url}" username="${username}" password="${password}"
        path="/${context.path}" war="file:${example.path}/dist/${war.file}"  
      />
  </target>

  <target name="undeploy" description="Undeploy web application">
    <undeploy url="${url}" username="${username}" password="${password}"
          path="/${context.path}"/>
  </target>

<path id="compile.classpath">
.................................................
<pathelement location="C:\tomcat50-jwsdp\server\lib\catalina_ant.jar"/>
</path>


Did you ask me to add pathelement to targets.xml, isn't it?(like above)
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 16808685
No! In the target.xml file, you look up the tag <path> with id="compile.classpath" and add
<pathelement location="C:\tomcat50-jwsdp\server\lib\catalina_ant.jar"/>
as a subtag of it.
I use "---------------------------------------------" symbol to indicate that there are a  lot of <pathelement> tags here.
Phuoc
0
 
LVL 92

Expert Comment

by:objects
ID: 16810847
define the location in your taskdef

    <taskdef file="tomcatTasks.properties">
        <classpath>
            <pathelement path="C:\tomcat50-jwsdp\server\lib\catalina_ant.jar"/>
        </classpath>
    </taskdef>
0
 

Author Comment

by:johnmarco
ID: 16810992
@phuocnh:  My tarfgets.xml does not include "compile.classpath", do you want me to do in the tragets.xml in
C:\jwstutorial13\examples\jaxrpc\common
Here is what I have? I already changed it to the one you told, but still get the same error.

  <path id="run.classpath">
     <path refid="compile.classpath"/>
     <pathelement location="${dist}/${client.jar}"/>
  </path>


@objects: If you have a look at my targets.xml ( I posted already above ), I do not have my taskdef in that file, where do you want me to paste it?

0
 
LVL 92

Expert Comment

by:objects
ID: 16814644
in your build.xml, it needs to know what the deploy task is.
0
 

Author Comment

by:johnmarco
ID: 16815366
You know all my paths (mentioned above), could you please provide me the full file, it is becoming more complicated.
Thanks
0
 
LVL 6

Expert Comment

by:phuocnh
ID: 17031062
Hi girionis!
"Delete with points refunded".
No. I don't think so. Is there way to refund but delete the thread. I think the thread is useful for another one although it doesn't solve the author's problem ( so I doesn't deserve to receive the points).
Phuoc
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17061137
PAQed with 500 points refunded

CetusMOD
Community Support Moderator
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question