setProperty must be overridden by all subclasses of SOAPMessage

Pablo Venturino picture Pablo Venturino · Nov 15, 2009 · Viewed 53.2k times · Source

I'm trying to deploy some web services in a WAR application on JBoss 5.1.0.

I have created the source files from an existing wsdl using JAX-WS tool wsgen. This created the Service files and @XmlType annotated clases that would act as request and response wrappers.

This classes worked well on JBoss 4.2.3, but when moving to JBoss 5.1.0, I get this exception.

java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage

My configuration:

  • Windows XP SP3 (but getting the same on Vista, as well as on Linux)
  • Sun JDK 1.6.0_17
  • JBoss 5.1.0 GA for jdk6

Thanks in advance!

Answer

Piotr Kochański picture Piotr Kochański · Nov 17, 2009

There are a few thing that might go wrong, so I will tell you what helped in my case (analogous to yours, I was using JDK 1.6.0_13).

The problem lies in JARs mismatch. First of all make sure JBoss is using JDK 1.6 check your JAVA_HOME env. variable. Secondly make sure your classes are compiled using JDK 1.6. If you run your project from Eclipse make sure Eclipse is using right JDK, the same if you run JBoss from Eclipse.

I guess your have it right, so there comes some magic. Running client do not use libraries from $JBOSS_HOME/client, but use only the ones provided in $JBOSS_HOME/lib/endorsed. Obviously if you are using any other JAX-WS-unrelated API like JPA or EJB or Servlets you can add them to the classpath, but use only lib/endorsed JAX-WS JARs.

It helped in my particular situation in case of JBoss 5.1, in earlier versions of JBoss a few other tricks worked, for instance try to add java option -Dsun.lang.ClassLoader.allowArraySyntax=true or/and -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed when starting your client and JBoss.