Web Servicet Client in JBOSS 5.1 with JDK6

Posted by dcp on Stack Overflow See other posts from Stack Overflow or by dcp
Published on 2010-03-13T12:27:15Z Indexed on 2010/03/13 12:35 UTC
Read the original article Hit count: 352

Filed under:
|
|
|
|

This is a continuation of the question here: http://stackoverflow.com/questions/2435286/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?

© Stack Overflow or respective owner

Related posts about jboss

Related posts about jdk6