UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage

Category: ExceptionOfTheDay

3:10 AM, Tue, Apr 15 2008

Tonight we rolled out our entry for the Google Android Developer Challenge: MWTJ, the mobile contacts backup application. It was working fine on the development machines. Fine on development should mean fine on deployment, but we hit:

02:47:22,957 ERROR [RequestHandlerImpl] Error processing web service request
org.jboss.ws.WSException: java.lang.UnsupportedOperationException: 
setProperty must be overridden by all subclasses of SOAPMessage
        at org.jboss.ws.WSException.rethrow(WSException.java:68)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:310)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
        at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)

What's the cause?

This server is running Java 1.6, which ships with JAXB 2.0. JBossWS requires JAXB 2.1. If you start JBossWS on a Java 1.6 machine, it gives you a helpful warning about needing jaxb-api.jar in the libs/endorsed directory. Unfortunately, if that's all you do, you get this exception. We added:

jboss-jaxrpc.jar
jboss-jaxws-ext.jar
jboss-jaxws.jar
jboss-saaj.jar 

and it worked.

In other interesting JBossWS news, we developed our WS beans like this:

@Stateless
@WebService
@WebContext(contextRoot="/webservices")
@Name("authenticateAction")
public class AuthenticateAction implements Authenticate {

The typical way to do it. Note the @WebContext annotation; we couldn't figure out how to deploy the WS without that annotation. It worked fine, and then we could get the service at http://localhost:8080/webservices/AuthenticateAction?wsdl, as you would expect.

We then rolled it out on the server, and reconfigured the Android client to go to http://localhost:8080/webservices/AuthenticateAction?wsdl, also as you would expect, and got 404 errors.

MWTJ.com is virtual hosted. In retrospect, it's not surprising that the @WebContext annotation, which takes the service out of the context, is also taking it out of the virtual server. Web services run within a totally different deployer in JBoss. We solved this by hard-coding the IP address within the Android client.

I would like to see a few improvements in virtual hosting in JBoss. One would be to fix this webservices issue. Another would be to add support for TLS 1.1, which allows name-based virtual hosting, therefore allowing multiple https servers to share one IP address.

Getting our Android entry done and submitted has been a lot of work. I'm eager to see the other entries.