2 Replies Latest reply on Jun 15, 2005 2:55 PM by Ryan

    Ant and wscompile taskdef

    Stefano Sabbadin Newbie

      Hi all,

      I'm using:
      - jboss 4.0.1
      - jwsdp 1.5
      - ant 1.6.2

      I have defined the build.xml file for ant.

      All is correct when I generate client stubs and jaxrpc-mapping with

      <property name="wscompile" value="${jwsdp.home}/jaxrpc/bin/wscompile.bat" />
      
       <target name="wscompile-client">
       <exec executable="${wscompile}">
       <arg line="-mapping ${build.home}/WEB-INF/Organization-mapping.xml" />
       <arg line="-gen:client" />
       <arg line="-d ${build.home}/WEB-INF/wsgen" />
       <arg line="-f:rpcliteral" />
       <arg line="-nd ${build.home}/WEB-INF/wsdl" />
       <arg line="configOrganization.xml" />
       </exec>
       </target>


      but, when I define the taskdef
       <path id="wscompile.classpath">
       <fileset dir="${jwsdp.home}">
       <include name="**/*.jar" />
       </fileset>
       </path>
       <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile" classpathref="wscompile.classpath" />


      and then I substitute previous task with

      <wscompile
       mapping="${build.home}/WEB-INF/Organization-mapping.xml"
       client="true"
       base="${build.home}/WEB-INF/wsgen"
       features="rpcliteral"
       nonClassDir="${build.home}/WEB-INF/wsdl"
       config="configOrganization.xml">
       <classpath>
       <path refid="wscompile.classpath"></path>
       </classpath>
       </wscompile>


      I have the following error:

      wscompile-client:
      [wscompile] error: -mapping is an invalid option or argument
      [wscompile] Usage: wscompile [options] configuration_file
      [wscompile] Use "wscompile -help" for a detailed description of options.
      [wscompile] Command invoked: wscompile -d "......\WEB-INF\wsgen" -features:rpcliteral -gen:client -mapping "......\WEB-INF\Organization-mapping.xml" -nd "......\WEB-INF\wsdl" "......\configOrganization.xml" -classpath C:\Sun\jwsdp-1.5\_uninst\uninstall.jar;C:\Sun\jwsdp-1.5\apache-ant\etc\ant-bootstrap.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-junit.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-launcher.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-nodeps.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-trax.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-api.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-impl.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-libs.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-xjc.jar;C:\Sun\jwsdp-1.5\jaxb\samples\pull-parser\lib\kxml2.jar;C:\Sun\jwsdp-1.5\jaxb\samples\pull-parser\lib\xmlpull.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\dom.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\sax.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xalan.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xercesImpl.jar;C:\Sun\jwsdp-1.5\jaxp\lib\jaxp-api.jar;C:\Sun\jwsdp-1.5\jaxr\lib\jaxr-api.jar;C:\Sun\jwsdp-1.5\jaxr\lib\jaxr-impl.jar;C:\Sun\jwsdp-1.5\jaxr\samples\jaxr-browser\jaxr-browser.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-api.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-impl.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-spi.jar;C:\Sun\jwsdp-1.5\jstl\lib\jstl.jar;C:\Sun\jwsdp-1.5\jstl\lib\standard.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\bin\commons-launcher.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\activation.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-beanutils.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-collections.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-digester.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-logging.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jaas.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jax-qname.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jta-spec1_0_1.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\mail.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\namespace.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\relaxngDatatype.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\xsdlib.jar;C:\Sun\jwsdp-1.5\registry-server\samples\jar\RegistryServer.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-api.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-impl.jar;C:\Sun\jwsdp-1.5\saaj\samples\soapprocessor\lib\soapprocessor.jar;C:\Sun\jwsdp-1.5\sjsxp\lib\jsr173_api.jar;C:\Sun\jwsdp-1.5\sjsxp\lib\sjsxp.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xindice-1.1b.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xmldb-api-20021118.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xmlrpc-1.1.jar;C:\Sun\jwsdp-1.5\wsi-sampleapp\lib\servlet-api.jar;C:\Sun\jwsdp-1.5\wsi-sampleapp\lib\wsi-client.jar;C:\Sun\jwsdp-1.5\xmldsig\lib\xmldsig.jar;C:\Sun\jwsdp-1.5\xws-security\lib\keyexport.jar;C:\Sun\jwsdp-1.5\xws-security\lib\pkcs12import.jar;C:\Sun\jwsdp-1.5\xws-security\lib\security-plugin.jar;C:\Sun\jwsdp-1.5\xws-security\lib\soapprocessor.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xmlsec.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xws-security.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xws-security_jaxrpc.jar


      It's very strange that if i copy the command invoked and I execute it in a windows shell, it works fine.

      Any ideas?

      Thanks

        • 1. Re: Ant and wscompile taskdef
          Ryan Newbie

           

          "sselda" wrote:
          Hi all,

          I'm using:
          - jboss 4.0.1
          - jwsdp 1.5
          - ant 1.6.2

          I have defined the build.xml file for ant.

          All is correct when I generate client stubs and jaxrpc-mapping with

          <property name="wscompile" value="${jwsdp.home}/jaxrpc/bin/wscompile.bat" />
          
           <target name="wscompile-client">
           <exec executable="${wscompile}">
           <arg line="-mapping ${build.home}/WEB-INF/Organization-mapping.xml" />
           <arg line="-gen:client" />
           <arg line="-d ${build.home}/WEB-INF/wsgen" />
           <arg line="-f:rpcliteral" />
           <arg line="-nd ${build.home}/WEB-INF/wsdl" />
           <arg line="configOrganization.xml" />
           </exec>
           </target>


          but, when I define the taskdef
           <path id="wscompile.classpath">
           <fileset dir="${jwsdp.home}">
           <include name="**/*.jar" />
           </fileset>
           </path>
           <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile" classpathref="wscompile.classpath" />


          and then I substitute previous task with

          <wscompile
           mapping="${build.home}/WEB-INF/Organization-mapping.xml"
           client="true"
           base="${build.home}/WEB-INF/wsgen"
           features="rpcliteral"
           nonClassDir="${build.home}/WEB-INF/wsdl"
           config="configOrganization.xml">
           <classpath>
           <path refid="wscompile.classpath"></path>
           </classpath>
           </wscompile>


          I have the following error:

          wscompile-client:
          [wscompile] error: -mapping is an invalid option or argument
          [wscompile] Usage: wscompile [options] configuration_file
          [wscompile] Use "wscompile -help" for a detailed description of options.
          [wscompile] Command invoked: wscompile -d "......\WEB-INF\wsgen" -features:rpcliteral -gen:client -mapping "......\WEB-INF\Organization-mapping.xml" -nd "......\WEB-INF\wsdl" "......\configOrganization.xml" -classpath C:\Sun\jwsdp-1.5\_uninst\uninstall.jar;C:\Sun\jwsdp-1.5\apache-ant\etc\ant-bootstrap.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-junit.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-launcher.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-nodeps.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant-trax.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-api.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-impl.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-libs.jar;C:\Sun\jwsdp-1.5\jaxb\lib\jaxb-xjc.jar;C:\Sun\jwsdp-1.5\jaxb\samples\pull-parser\lib\kxml2.jar;C:\Sun\jwsdp-1.5\jaxb\samples\pull-parser\lib\xmlpull.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\dom.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\sax.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xalan.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xercesImpl.jar;C:\Sun\jwsdp-1.5\jaxp\lib\jaxp-api.jar;C:\Sun\jwsdp-1.5\jaxr\lib\jaxr-api.jar;C:\Sun\jwsdp-1.5\jaxr\lib\jaxr-impl.jar;C:\Sun\jwsdp-1.5\jaxr\samples\jaxr-browser\jaxr-browser.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-api.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-impl.jar;C:\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-spi.jar;C:\Sun\jwsdp-1.5\jstl\lib\jstl.jar;C:\Sun\jwsdp-1.5\jstl\lib\standard.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\bin\commons-launcher.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\activation.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-beanutils.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-collections.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-digester.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\commons-logging.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jaas.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jax-qname.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jta-spec1_0_1.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\mail.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\namespace.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\relaxngDatatype.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\xsdlib.jar;C:\Sun\jwsdp-1.5\registry-server\samples\jar\RegistryServer.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-api.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-impl.jar;C:\Sun\jwsdp-1.5\saaj\samples\soapprocessor\lib\soapprocessor.jar;C:\Sun\jwsdp-1.5\sjsxp\lib\jsr173_api.jar;C:\Sun\jwsdp-1.5\sjsxp\lib\sjsxp.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xindice-1.1b.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xmldb-api-20021118.jar;C:\Sun\jwsdp-1.5\work\forappserver\registry-server\WEB-INF\lib\xmlrpc-1.1.jar;C:\Sun\jwsdp-1.5\wsi-sampleapp\lib\servlet-api.jar;C:\Sun\jwsdp-1.5\wsi-sampleapp\lib\wsi-client.jar;C:\Sun\jwsdp-1.5\xmldsig\lib\xmldsig.jar;C:\Sun\jwsdp-1.5\xws-security\lib\keyexport.jar;C:\Sun\jwsdp-1.5\xws-security\lib\pkcs12import.jar;C:\Sun\jwsdp-1.5\xws-security\lib\security-plugin.jar;C:\Sun\jwsdp-1.5\xws-security\lib\soapprocessor.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xmlsec.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xws-security.jar;C:\Sun\jwsdp-1.5\xws-security\lib\xws-security_jaxrpc.jar


          It's very strange that if i copy the command invoked and I execute it in a windows shell, it works fine.

          Any ideas?

          Thanks


          If you search this forum, I came across this a few months back... the same issue. I believe it's a bug... you can find my post here:

          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=57446

          In any case, this is what I did to solve it...

          I just used the following:

          <java classname="com.sun.xml.rpc.tools.wscompile.Main" fork="yes" dir=".">
           <classpath refid="compile.classpath"/>
           <arg line='-d "${build.web.service.generated.classes.home}"' />
           <arg line='-nd "${build.web.service.wsdl.home}"' />
           <arg line='-s "${build.web.service.generated.src.home}"' />
           <arg line="-gen:server"/>
           <arg line="-features:documentliteral" />
           <arg line='-mapping "${build.web.service.generated.home}/${jaxrpc.mapping.file}"'/>
           <arg line="-keep" />
           <arg line="-verbose" />
           <arg line='-classpath "${build.classes.home}"' />
           <arg line='"${config.home}/${config.file}"' />
           </java>


          You can pretty much figure out what property values I used, etc. Post if you have any problems.

          _Ryan

          • 2. Re: Ant and wscompile taskdef
            Ryan Newbie

            Apparently, I didn't read to the end of my old thread. :)

            You can put fork="true" in the wscompile task and it's stated that the error will disappear.

            http://forum.java.sun.com/thread.jspa?threadID=592994&tstart=0