0 Replies Latest reply on Apr 30, 2007 11:17 AM by aodhan hoffman

    testing examples sans Ant

    aodhan hoffman Newbie

      I'm working through the jboss4guide WS chapter. The expected form for testing applications is to use cascading Ant scripts. Yet, for me, that obscures the actual operation. I appreciate the power of Ant, but I don't have time to learn Ant just yet.

      How would I go about calling web service clients from the command-line?
      ( This would also avoid unnecessary compile/deploy phases when tweaking the example. )

      The ant target is :

      <target name="run-example1" depends="chap12-war">
       <copy file="${chapter.dir}/hello-servlet.war"
       todir="${jboss.dist}/server/default/deploy"/>
       <echo message="Waiting for 5 seconds for deploy..." />
       <sleep seconds="5"/>
       <java dir="${build.classes.dir}" fork="yes" failOnError="true"
       className="org.jboss.ws.client.HelloClient">
       <jvmarg value="-Djava.endorsed.dirs=${jboss.dist}/lib/endorsed" />
       <arg value="http://localhost:8080/hello-servlet/Hello?wsdl" />
       <arg value="JBoss neophyte" />
       <classpath>
       <pathelement location="${build.dir}/classes"/>
       <path refid="client.path" />
       </classpath>
       </java>
       </target>


      My attempt to call the script is:

      C:\jboss4guide\examples>java -Djava.endorsed.dirs=C:\jboss-4.0.5.GA\lib\endorsed -cp C:\jboss4guide\
      examples\src\main\org\jboss\ws\hello org.jboss.ws.client.HelloClient "http://localhost:8080/hello-servlet/Hello?wsdl" "JBoss neophyte"
      Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/ws/client/HelloClient


      The error tells me that my runtime classpath is wrong.
      Consequently, I've tried different classpath values
      - C:\jboss4guide\examples\src\main\org\jboss\ws\client
      - C:\jboss4guide\examples\src\main\
      - C:\jboss4guide\examples\

      Am I wrong about the classpath, or what should I use? thanks