X

Geertjan's Blog

  • September 12, 2005

Deploying JAX-RPC Web Services to JBoss

Geertjan Wielenga
Product Manager
To deploy a web service in NetBeans IDE 5.0 to JBoss:

  1. Copy all JAR files from $NB_HOME/ide6/ext/jaxrpc16 to $JBOSS_HOME/servers/default/lib.

  2. Create web application (Ctrl-Shift-N) and set JBoss as your target server.

  3. Add this target to your build.xml:
    <target name="-pre-init">
    <!-- property libs.jaxrpc16.classpath is defined in
    $USERDIR/build.properties -->
    <property name="j2ee.platform.wscompile.classpath"
    value="${libs.jaxrpc16.classpath}"/>
    </target>

  4. Use Web Service wizard to create the web service files and then develop them further.

  5. Build the web service.

  6. Take the url-pattern from web.xml and put it in the project's Relative URL edit box (in the Run Panel, in the Project Properties dialog box).

  7. Run the project. Hurray, this is the result in the browser:



Notes:
  • Remember to set the proxy as described earlier.
  • Remember that when you register JBoss in the IDE, you must make sure that the port you set matches the port set in the actual configuration file, because setting the port in the IDE does not set the port in the configuration file.
  • Remember that JBoss and the Sun Java System Application Server both use port 8080 by default, therefore you should manually change one of them if you're going to use both.
  • I tried the above steps on Tomcat, but it didn't work.

Join the discussion

Comments ( 8 )
  • Sebastian Wednesday, September 28, 2005
    Hi,
    I was trying to invoke a method called operation. I got such an error:
    ERROR [RPCInvocation] org.xml.sax.SAXException: Deserializing parameter 'operation': could not find deserializer for type {urn:NewWebService/types}operation
    When I looked into JBoss log i found this:
    WARN [TypeMappingDescription] Class not found: ws.NewWebServiceSEI_operation_RequestStruct
    WARN [TypeMappingDescription] Class not found: ws.NewWebServiceSEI_operation_ResponseStruct
    Do you know how to deal with that?
    I am using Netbans 5.0 (20050922) and JBoss 4.0.3rc2.
  • Geertjan Wednesday, September 28, 2005
    Try this: right-click the project, choose Properties, and play with the WsCompile features in the Web Service and Web Service Clients pages. Don't know very much about them myself, but I heard of someone who unselected 'useonewayoperations' and then their problem (can't remember what it was) was solved. Does this help?
  • Sebastian Wednesday, September 28, 2005
    Nope. Still the same problem. I did everything what you wrote in your instruction. Also 'useonewayoperations' didn't help. I am able to see wsdl file and page with 'And now... Some Services'. The problem is when I want to try if this webservice is working. Have you tried to consume JAX-RPC webservices deployed on JBoss?
  • Geertjan Wednesday, September 28, 2005
    Yes, I have. Read all about it here and please write and say if it helped or not.
  • Sebastian Wednesday, September 28, 2005
    'documentliteral' option was turned on. I do not know what does it mean, but after I have changed to 'rpcliteral' webservice was ok :) Thank you for your suggestion with wscompile features.
  • Geertjan Wednesday, September 28, 2005
    Ah, yes. I know about this problem. Read this for details and then read this.
  • Leos Saturday, October 15, 2005
    Thanks for your tips. With 'rpcliteral' setting I now can deploy webservice but when WS method returns array, then I get the following warning in server.log:

    WARN [org.jboss.webservice.deployment.TypeMappingDescri
    ption] Class not found: cz.qds.ws.phonedirectory._arrays.java.lang.StringArray

    Method declaration is:

    public String[] getNames(java.lang.String name);

    And client:

    cz.qds.ws.phonedirectory.stub.StringArray sa = phoneDirectorySEIPort.getNames("U");

    String[] x = sa.getValue();

    for (String s: x) System.out.println(s);

    Returns error:

    java.rmi.RemoteException: Runtime exception; nested exception is: deserialization error: unexpected XML reader state. expected: END but found: START: item

    I have only one difference - I run JBOSS in configuration mode ALL (and copied JAXRPC from NB into server/all/lib directory).

    Do you have some ideas?

  • guest Thursday, March 23, 2006
    a
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.