2 Replies Latest reply on Oct 18, 2007 7:18 PM by sysuser1

    wsconsume Ant task fails to find

    sysuser1

      I have the following in my build.xml:

      <path id="web.services.classpath">
       <fileset dir="${env.JAVA_HOME}/lib" includes="*.jar" />
       <filesetdir="${jboss.home}/lib/endorsed/" includes="*.jar" />
       <fileset dir="${jboss.home}/lib/" includes="*.jar" />
       <fileset dir="${jboss.home}/client/">
       <include name="activation.jar" />
       <include name="getopt.jar" />
       <include name="wstx.jar" />
       <include name="jbossall-client.jar" />
       <include name="log4j.jar" />
       <include name="mail.jar" />
       <include name="jbossws-spi.jar" />
       <include name="stax-api.jar" />
       <include name="jaxb-api.jar" />
       <include name="jaxb-impl.jar" />
       <include name="jaxb-xjc.jar" />
       <include name="streambuffer.jar" />
       <include name="stax-ex.jar" />
       <include name="javassist.jar" />
       <include name="jboss-xml-inding.jar" />
       <include name="jbossws-client.jar" />
       <include name="jboss-jaxws.jar" />
       <include name="jboss-jaxrpc.jar" />
       <include name="jboss-saaj.jar" />
       <include name="jboss-srp-client.jar" />
       <include name="jbossws-common.jar" />
       <include name="jaxws-tools.jar" />
       <include name="jaxws-rt.jar" />
       </fileset>
      </path>
      
      <target name="wstaskdef">
       <taskdef name="wsconsume"
       classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
       <classpath>
       <path refid="web.services.classpath" />
       </classpath>
       </taskdef>
      </target>
      
      <target name="wsdltojava" depends="init,wstaskdef">
      <wsconsume fork="false"
       verbose="true"
       destdir="${classes.gen.dir}"
       sourcedestdir="${src.gen.dir}"
       keep="true" package="com.example.wsclient"
       wsdl="${resources.dir}/wsdl/DataMartService.wsdl"
      wsdlLocation="http://localhost:8080/datamart/DatamartRemote?wsdl" />
      </target>
      


      And a WSDL that contains a type like this:

      <xs:complexType name='brmEntry'>
       <xs:sequence>
       <xs:element minOccurs='0' name='barcode' type='xs:string'/>
       <xs:element minOccurs='0' name='barcodeType' type='xs:string'/>
       <xs:element minOccurs='0' name='idTag' type='xs:string'/>
       <xs:element minOccurs='0' name='imageStream' ns1:expectedContentTypes='application/octet-stream' type='xs:base64Binary' xmlns:ns1='http://www.w3.org/2005/05/xmlmime'/>
       <xs:element minOccurs='0' name='timestamp' type='xs:dateTime'/>
       </xs:sequence>
      


      When I invoke the 'wsconsume' task from Ant, I get the following:

      package javax.activation does not exist
      [wsconsume] import javax.activation.DataHandler;
      [wsconsume] ^
      [wsconsume] BrmEntry.java:50: cannot find symbol
      [wsconsume] symbol : class DataHandler
      [wsconsume] location: class com.raf.uspsbrm.datamart.wsclient.BrmEntry
      [wsconsume] protected DataHandler imageStream;

      The only way I was able to get around this issue is to add "activation.jar" to Ant's classpath (I'm using Ant 1.7), or use the 'wsconsume.sh' script.

      Does anyone have any idea how to fix the Ant task without necessarily altering Ant's CLASSPATH or is this necessary for 'wsconsume' to work from within Ant?

      Thanks in advance!
      Martin

        • 1. Re: wsconsume Ant task fails to find
          sysuser1

          My apologies - I dont think I did my due diligence with the classpath - I've fixed the problem - I added "fork=true" to the 'wsconsume' Ant task, as well as , and it started to work.

          Thanks for reading :).

          • 2. Re: wsconsume Ant task fails to find
            sysuser1

             

            "balkanboy" wrote:
            My apologies - I dont think I did my due diligence with the classpath - I've fixed the problem - I added "fork=true" to the 'wsconsume' Ant task, as well as <jvmargs pathref="web.services.classpath">, and it started to work.

            Thanks for reading :).


            Hm, my code got eaten- here's the fix:

            <wsconsume verbose="true"
             fork="true"
             destdir="${classes.gen.dir}"
             sourcedestdir="${src.gen.dir}"
             package="com.raf.uspsbrm.datamart.wsclient"
             wsdl="${conf.gen.dir}/DatamartService.wsdl"
             wsdlLocation="http://127.0.0.1:8080/datamart-beans/DatamartImpl?wsdl" >
             <jvmarg pathref="web.services.classpath"/>
             </wsconsume>
            


            Since the forked wsconsume task will run inside of its own JVM, obviously activation.jar is getting picked up...