javawebserverjax-wsjava-ws

JAX-WS 2.2 and JDK6 with maven


I have a web service and I'm using the Endpoint.publish("http://0.0.0.0:8080")

Thing is that JAX-WS 2.0 and 2.1 is affected by an issue that throw a NullPointerException when executing endpoint.stop().

The issue is fixed in 2.2 but when adding the dependency in the pom.xml publishing fails due to a java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String; since I'm using java 1.6.

The workaround is to add to the endorsed folder some libs. But I want to pack it all in jar-with-dependencies. An executable java jar.

Said this, I would be thankful if you help me:

Publishing the endpoint in 2.0 or 2.1 listening to all addresses (0.0.0.0)

or

Configuring dependencies in maven to pack everything using 2.2.x 
but executable with JDK6

EDIT:

Requirements are a deliverable jar. A single jar that pack all of the dependencies (2 so far, about a 400k jar).

But if you think that the only way to make it work is to add an external shell script please let me know too.

Thank you!


Solution

  • The executable jar format does not allow for endorsed folders required for JAX-WS replacement (and neither does the Java WebStart launcher apparently).

    You need to use something that can construct and execute a new "java" command on the fly. The best way from here is most likely to look for an installer which can run the program directly without needing to install.

    What exactly do you need to happen?


    EDIT: As the requirement is a runnable jar you simply cannot do this with JAX-WS 2.2 Find a workaround with the JAX-WS present in the latest release of the Java version you are targetting.

    It is very nice that the JAX-WS stack ship with core Java allowign for very small deployments, but a pain that you cannot easily provide your own.

    Note that you can provide your own with Java 5 but then you need to bring your own Endpoint implementation.