2

This is a continuation of the question here: JBoss - does app have to be compiled under same jdk as JBOSS is running under?

It's different enough though that it required a new question.

I am trying to use jdk6 to run JBOSS 5.1, and I downloaded the JDK6 version of JBOSS 5.1. This works fine and my EAR application deploys fine. However, when I want to run a web service client with code like this:

public static void main(String[] args) throws Exception {
    System.out.println("creating the web service client...");
    TestClient client = new TestClient("http://localhost:8080/tc_test_project-tc_test_project/TestBean?wsdl");
    Test service = client.getTestPort();
    System.out.println("calling service.retrieveAll() using the service client");
    List<TestEntity> list = service.retrieveAll();
    System.out.println("the number of elements in list retrieved using the client is " + list.size());
}

I get the following exception:

javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
    at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:396)
    at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
    at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
    at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)

Now, here's the really interesting part. If I change the JDK that my the code above is running under from JDK6 to JDK5, the exception above goes away! It's really strange.

The only way I found for the code above to run under JDK6 was to take the JBOSS_HOME/lib/endorsed folder and copy it to JDK6_HOME/lib. This seems like it shouldn't be necessary, but it is.

Is there any other way to make this work other than using the workaround I just described?

Community
  • 1
  • 1
dcp
  • 54,410
  • 22
  • 144
  • 164

3 Answers3

3

Looks roughly as if you ran into the presence of JAX-WS as an official feature of JDK 1.6. Don't copy things to 'lib', copy them to an 'endorsed' directory (one listed in java.endorsed.dirs). This might be helpful.

If you have an up-to-date 1.6, you can get around this the same way that Apache CXF does. See the documentation for information on how to use CXF in a 1.6 environment.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • Not sure I understand. I took the JBOSS_HOME/lib/endorsed folder and copied it to JDK6_HOME/lib, so I ended up with JDK6_HOME/lib/endorsed. Did you mean something else? – dcp Mar 13 '10 at 14:01
  • As far as i know JBoss does not use the JDK/lib/endorsed folder. You need to put all jars required by all webapps into the JBOSS/lib/endorsed folder. – Stroboskop Nov 14 '11 at 16:50
2

There are various suggestions and explanations in the respective bug report and elsewhere (e.g. here and here). I don't know how well they work.

Tomislav Nakic-Alfirevic
  • 10,017
  • 5
  • 38
  • 51
0

Information about this issue you can find in JBoss official Installation And Getting Started Guide: http://docs.jboss.org/jbossas/docs/Installation_And_Getting_Started_Guide/5/html/Installation_Alternatives.html

PeterB
  • 323
  • 3
  • 7