views:

5886

answers:

5

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!

+6  A: 

Looks like a known bug

https://jira.jboss.org/jira/browse/JBWS-1439

The final comment looks like a workaround:

Copy the three jars from <JBOSS_HOME>\server\default\lib to <JBOSS_HOME>\lib\endorsed.

  • jboss-jaxrpc.jar
  • jboss-jaxws.jar
  • jboss-saaj.jar
skaffman
That's solution is intended for JBoss 4.2.3 (which I had to do for web services to work in that version).I'm trying to run this on JBoss 5.1.0. I found at http://www.jboss.org/jbossas/docs/Release_Notes/510GA/readme.html that there's another set of jars to copy, but since I downloaded JBoss-5.1.0 for jdk6, they are already there.Just tried copying JBoss 4.2.3 libraries into JBoss 5.1.0 endorsed libs folder to try, but still no luck.
Pablo
+5  A: 

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.

Piotr Kochański
Thanks Piotr! After all, the problem was that I was starting JBoss from within eclipse, with it's automatic launch config... which does not pass the -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed param. After adding this (as well as running JBoss from the run.bat script) it worked fine. Thanks again! (you deserve more than just one vote up from me :) )
Pablo
Tried both "-Dsun.lang.ClassLoader.allowArraySyntax=true" and "-Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed", did not work in 4.2.3.GA.
Brian Harris
+4  A: 

I had the same issue with an upgrade from JBoss 4.2.2 and found the answer in the JBoss 5.1.0 Release Notes:

JBossAS 5.0.0.GA can be compiled with both Java5 & Java6. The Java5 compiled binary is our primary/recommended binary distribution. It has undergone rigorous testing and can run under both a Java 5 and a Java 6 runtime. When running under Java 6 you need to manually copy the following libraries from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:

  • jbossws-native-saaj.jar
  • jbossws-native-jaxrpc.jar
  • jbossws-native-jaxws.jar
  • jbossws-native-jaxws-ext.jar

I was using the distribution of JBoss 5.1.0 build with Java 5 (running on JDK 1.6.0_20) and sure enough copying these JARs into the endorsed directory fixed the issue. We're not using the version compiled for Java 6 because of the note:

It should be noted however that the Java 6 compiled distribution of JBoss AS 5 is still in experimental stage.

phatblat
A: 

It could be due to conflict issue with SAAJ jar. Copy Jboss's Saaj jar from {Jboss_HOME}/LIB to {JBOSS_HOME}/lib/endorsed. I hope this would help in resolving issue,