4 Replies Latest reply on Mar 30, 2005 12:20 PM by acxsjones

    Cannot deploy a document style webservice on JBoss 4.0.2RC1

    mingweiwu

      Can anyone help? I tried to use JAX-RPC to deploy my web service.
      I installed JBoss 4.0.2RC1 and I tried to deploy a very simple webservice on JBoss. I defined very simple java prg for a service. I got OK when I put style="rpc" in tag of WSDL. The WSDL was created by using Java2WSDL tool in JBoss. I tried to use "style=document" and WSDL was created by my ant scipt(just like the one for rpc style, and the tag includes my new part). I checked all the WEB-INF/*.xml (
      jboss-web.xml, jaxrpc-mapping.xml,webservices.xml,web.xml), and they are same as the one for rpc style. But when I tried to start the Server with run.bat in default mode, only rpc style work; when I tried document style, the server complains "Cannot stattup webservice for: my.war" and said "org.jboss.deployment.DeploymentException: Cannot deploy webservices; - nested throwable: (java.lanag.NullPointerException)", all deployWebservices error message follows.
      May I get a hint? I guess there is some setting either in WSDL or mapping files need to be changed for document-style.
      Definitely need your helps! Thanks!
      Ming-wei Wu

        • 1. Re: Cannot deploy a document style webservice on JBoss 4.0.2
          acxsjones

          I was told not to use Java2WSDL but to use wscompile

          There is a good tutorial on it at
          https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html#2.1

          After I did all this work, I was able to get RPC working but not document. When I went to 4.0.2 RC1, the document literal started working.

          • 2. Re: Cannot deploy a document style webservice on JBoss 4.0.2
            mingweiwu

            Scott Jones:
            Do you have some example to use wscompile? Does that mean I need to have a wsdl first before I can run wscompile? Can I just use the wsdl created by Java2WSDL?

            Thanks!

            Ming-wei

            • 3. Re: Cannot deploy a document style webservice on JBoss 4.0.2
              acxsjones

              I gen'd my wsdl off of the endpoint interface in my ejb. I the ant files that I utilize


              My build-wscompile.xml ant file file

              <!DOCTYPE project [
               <!ENTITY jwsdpClasspath SYSTEM "./build-jwsdp-classpath.xml">
              ]>
              
              <project name="wscompile sub project" default="usage" basedir=".">
               <property file="jboss-build.properties"/>
               <property file="settings.properties"/>
              
               &jwsdpClasspath; <!-- include jwsdp classpath -->
              
               <path id="build.classpath">
               <pathelement location="${build.dir}"/>
               <path refid="jwsdp.classpath"/>
               <fileset dir="${lib.dir}">
               <include name="*.jar"/>
               </fileset>
               <fileset dir="C:\j2sdk1.4.2_06\lib">
               <include name="*.jar"/>
               </fileset>
               </path>
              
               <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
               <classpath refid="jwsdp.classpath"/>
               </taskdef>
              
               <target name="server">
               <mkdir dir="${gend.dir}/${ejb.package}/META-INF/wsdl" />
               <wscompile fork ="true"
               base ="${build.dir}"
               features ="documentliteral"
               sourceBase ="${gend.dir}"
               keep ="true"
               server ="true"
               model ="${gend.dir}/${ejb.package}/META-INF/${ejb.name}.xml.gz"
               mapping ="${gend.dir}/${ejb.package}/META-INF/mapping.xml"
               nonClassDir ="${gend.dir}/${ejb.package}/META-INF/wsdl"
               config ="${src.dir}/${ejb.package}/config/${ejb.name}-config.xml"
               verbose ="true"
               xprintstacktrace="true">
               <classpath refid="build.classpath"/>
               </wscompile>
               </target>
              
               <target name="client">
               <wscompile client="true"
               features="documentliteral, wsi"
               keep="true"
               base="${build.dir}"
               sourceBase="${gend.dir}"
               verbose="true"
               xprintstacktrace="true"
               config="${config.file}">
               <classpath refid="wspack.classpath"/>
               </wscompile>
               </target>
              
               <target name="usage">
               <echo message="*******************************************"/>
               <echo message=" build-wscompile usage"/>
               <echo message="This ant file is to be used by other ant files and not directly."/>
               <echo message="You will need to call it by using the ant target"/>
               <echo message="You will call either the server target or the client target"/>
               <echo message=""/>
               <echo message=" server target params"/>
              
               </target>
              </project>


              My build-jwsdp-classpath.xml ant file
              
               <path id="jwsdp.classpath">
               <!-- JAXRPC jars -->
               <pathelement location="${jaxrpc.lib}/jaxrpc-api.jar"/>
               <pathelement location="${jaxrpc.lib}/jaxrpc-impl.jar"/>
               <pathelement location="${jaxrpc.lib}/jaxrpc-spi.jar"/>
               <!-- JAXP jars -->
               <pathelement location="${jaxp.lib}/jaxp-api.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/xercesImpl.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/sax.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/dom.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/xalan.jar"/>
               <!-- JAXR jars -->
               <pathelement location="${jaxr.lib}/jaxr-api.jar"/>
               <pathelement location="${jaxr.lib}/jaxr-impl.jar"/>
               <!-- SAAJ jars -->
               <pathelement location="${saaj.lib}/saaj-api.jar"/>
               <pathelement location="${saaj.lib}/saaj-impl.jar"/>
               <!-- JAXB jars -->
               <pathelement location="${jaxb.lib}/jaxb-api.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-impl.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-xjc.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-libs.jar"/>
               <!-- Common jars -->
               <pathelement location="${shared.lib}/activation.jar"/>
               <pathelement location="${shared.lib}/mail.jar"/>
               <pathelement location="${shared.lib}/commons-logging.jar"/>
               <pathelement location="${shared.lib}/jax-qname.jar"/>
               <pathelement location="${shared.lib}/xsdlib.jar"/>
               <pathelement location="${shared.lib}/relaxngDatatype.jar"/>
               <pathelement location="${shared.lib}/namespace.jar"/>
               <!-- Servlet jar -->
               </path>
              
              


              The server master ant file
              <!DOCTYPE project [
               <!ENTITY jwsdpClasspath SYSTEM "./build-jwsdp-classpath.xml">
              ]>
              
              <project name="JBoss 4.0 WSI Document Literal Server" default="all" basedir=".">
               <property file="jboss-build.properties"/>
               <property file="settings.properties"/>
              
               &jwsdpClasspath; <!-- include jwsdp classpath -->
              
               <target name="all" depends="clean,compile,generate,compile,package"/>
              
               <path id="build.classpath">
               <pathelement location="${build.dir}"/>
               <path refid="jwsdp.classpath"/>
               <fileset dir="${lib.dir}">
               <include name="*.jar"/>
               </fileset>
               <fileset dir="C:\j2sdk1.4.2_06\lib">
               <include name="*.jar"/>
               </fileset>
               </path>
              
               <target name="clean">
               <delete dir="${build.dir}" />
               <delete dir="${gend.dir}" />
               <mkdir dir="${build.dir}" />
               <mkdir dir="${gend.dir}" />
               </target>
              
               <target name="prepare">
               <mkdir dir="${build.dir}"/>
               <mkdir dir="${gend.dir}" />
               </target>
              
              
               <target name="compile" depends="prepare">
               <javac destdir="${build.dir}"
               classpathref="build.classpath"
               debug="on">
               <src path="${src.dir}"/>
               <src path="${gend.dir}"/>
               </javac>
               </target>
              
               <target name="generate" depends="helloworld.generate, helloworld2.generate"/>
              
               <target name="helloworld.generate">
               <ant antfile="build-wscompile.xml"
               target="server"
               inheritAll="false">
               <property name="ejb.package" value="com/acxiom/test/ejb/helloworld" />
               <property name="ejb.name" value="HelloWorld" />
               </ant>
               </target>
              
               <target name="helloworld2.generate">
               <ant antfile="build-wscompile.xml"
               target="server"
               inheritAll="false">
               <property name="ejb.package" value="com/acxiom/test/ejb/helloworld2" />
               <property name="ejb.name" value="HelloWorld2" />
               </ant>
               </target>
              
               <target name="package" depends="helloworld.package, helloworld2.package"/>
              
               <target name="helloworld.package" >
               <mkdir dir="${dist.dir}" />
               <delete file="${dist.dir}/helloworldws-ejb.jar"/>
              
               <jar jarfile="${dist.dir}/helloworldws-ejb.jar">
               <metainf dir="${src.dir}/com/acxiom/test/ejb/helloworld/META-INF"
               includes="**/*.xml" />
              
               <metainf dir="${gend.dir}/com/acxiom/test/ejb/helloworld/META-INF"
               includes="**/*.xml,**/*.wsdl,**.gz" />
              
               <fileset dir="${build.dir}">
               <include name="com/acxiom/test/ejb/helloworld/**/**" />
               </fileset>
               </jar>
               </target>
              
               <target name="helloworld2.package" >
               <mkdir dir="${dist.dir}" />
               <delete file="${dist.dir}/helloworld2ws-ejb.jar"/>
              
               <jar jarfile="${dist.dir}/helloworld2ws-ejb.jar">
               <metainf dir="${src.dir}/com/acxiom/test/ejb/helloworld2/META-INF"
               includes="**/*.xml" />
              
               <metainf dir="${gend.dir}/com/acxiom/test/ejb/helloworld2/META-INF"
               includes="**/*.xml,**/*.wsdl,**.gz" />
              
               <fileset dir="${build.dir}">
               <include name="com/acxiom/test/ejb/helloworld2/**/**" />
               <include name="com/acxiom/test/basetypes/**/**" />
               </fileset>
               </jar>
               </target>
              
               <target name="deploy">
               <copy todir="${jboss.deploy.dir}">
               <fileset dir="${dist.dir}"
               includes="*.jar"/>
               </copy>
               </target>
              
              
              
               </project>
              


              The client master ant file
              <project name="Web Service 7 RPC" default="all" basedir=".">
               <property file="jboss-build.properties"/>
               <property file="settings.properties"/>
              
               <target name="all" depends="clean,generate,compile,test"/>
              
               <path id="wspack.classpath">
               <!-- JAXRPC jars -->
               <pathelement location="${jaxrpc.lib}/jaxrpc-api.jar"/>
               <pathelement location="${jaxrpc.lib}/jaxrpc-impl.jar"/>
               <pathelement location="${jaxrpc.lib}/jaxrpc-spi.jar"/>
               <!-- JAXP jars -->
               <pathelement location="${jaxp.lib}/jaxp-api.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/xercesImpl.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/sax.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/dom.jar"/>
               <pathelement location="${jaxp.lib}/endorsed/xalan.jar"/>
               <!-- JAXR jars -->
               <pathelement location="${jaxr.lib}/jaxr-api.jar"/>
               <pathelement location="${jaxr.lib}/jaxr-impl.jar"/>
               <!-- SAAJ jars -->
               <pathelement location="${saaj.lib}/saaj-api.jar"/>
               <pathelement location="${saaj.lib}/saaj-impl.jar"/>
               <!-- JAXB jars -->
               <pathelement location="${jaxb.lib}/jaxb-api.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-impl.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-xjc.jar"/>
               <pathelement location="${jaxb.lib}/jaxb-libs.jar"/>
               <!-- Common jars -->
               <pathelement location="${shared.lib}/activation.jar"/>
               <pathelement location="${shared.lib}/mail.jar"/>
               <pathelement location="${shared.lib}/commons-logging.jar"/>
               <pathelement location="${shared.lib}/jax-qname.jar"/>
               <pathelement location="${shared.lib}/xsdlib.jar"/>
               <pathelement location="${shared.lib}/relaxngDatatype.jar"/>
               <pathelement location="${shared.lib}/namespace.jar"/>
               <!-- Servlet jar -->
               </path>
              
               <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
               <classpath refid="wspack.classpath"/>
               </taskdef>
              
               <target name="clean">
               <delete dir="${build.dir}" />
               <delete dir="${gend.dir}" />
               <mkdir dir="${build.dir}" />
               <mkdir dir="${gend.dir}" />
               </target>
              
               <target name="prepare">
               <mkdir dir="${build.dir}"/>
               <mkdir dir="${gend.dir}" />
               </target>
              
               <target name="compile" depends="prepare">
               <javac destdir="${build.dir}"
               classpathref="wspack.classpath"
               debug="on">
               <src path="${src.dir}"/>
               </javac>
               </target>
              
               <target name="generate" depends="HelloWorld.generate, HelloWorld2.generate"/>
              
               <target name="HelloWorld.generate">
               <ant antfile="build-wscompile.xml"
               target="client"
               inheritAll="false">
               <property name="config.file" value="${wsdl.dir}/HelloWorld-config.xml" />
               </ant>
               </target>
              
               <target name="HelloWorld2.generate">
               <ant antfile="build-wscompile.xml"
               target="client"
               inheritAll="false">
               <property name="config.file" value="${wsdl.dir}/HelloWorld2-config.xml" />
               </ant>
               </target>
              
               <target name="test" depends="HelloWorld.test, HelloWorld2.test"/>
              
               <target name="HelloWorld.test" depends="compile">
               <java classname="junit.textui.TestRunner"
               fork="yes"
               failonerror="yes">
              
               <arg value="com.acxiom.test.client.TestHelloWorld"/>
              
               <classpath>
               <path refid="wspack.classpath"/>
               <pathelement location="${build.dir}"/>
               <pathelement location="${lib.dir}/junit.jar"/>
               </classpath>
               </java>
              </target>
              
              <target name="HelloWorld2.test" depends="compile">
               <java classname="junit.textui.TestRunner"
               fork="yes"
               failonerror="yes">
              
               <arg value="com.acxiom.test.client.TestHelloWorld2"/>
              
               <classpath>
               <path refid="wspack.classpath"/>
               <pathelement location="${build.dir}"/>
               <pathelement location="${lib.dir}/junit.jar"/>
               </classpath>
               </java>
              </target>
              
              
              
               </project>
              


              settings.properties
              build.dir=.\\classes
              src.dir=.\\src
              lib.dir=.\\lib
              dist.dir=.\\dist
              gend.dir=.\\gend
              config.dir=.\\config
              wsdl.dir=.\\wsdl
              clientlib.dir=${lib.dir}\\client
              jwsdp.dir=.\\lib\\jwsdp
              jaxrpc.lib=${jwsdp.dir}\\jaxrpc
              jaxp.lib=${jwsdp.dir}\\jaxp
              jaxr.lib=${jwsdp.dir}\\jaxr
              saaj.lib=${jwsdp.dir}\\saaj
              jaxb.lib=${jwsdp.dir}\\jaxb
              shared.lib=${jwsdp.dir}\\shared
              
              


              jboss-build.properties
              jboss.home=C:\jboss-4.0.1
              
              jboss.server=${jboss.home}/server/default
              jboss.deploy.dir=${jboss.server}/deploy
              
              


              • 4. Re: Cannot deploy a document style webservice on JBoss 4.0.2
                acxsjones

                You will need to download jwsdp 1.5 to get my examples to work. It contains some examples with it.

                http://java.sun.com/webservices/jwsdp/index.jsp
                Sun?s main page for jwsdp. Should be able to get to the download from this page

                Also look at the wiki and the examples
                http://www.jboss.org/wiki/Wiki.jsp?page=JBossWS[/url]