Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does JAX-WS freeze while deploying any service using JAXB databinding?
    primarykey
    data
    text
    <p>I'm attempting to create a JAX-WS service that uses JAXB databinding of objects generated from the very large (900+ classes) set of <a href="http://www.opentravel.org/specifications/SchemaIndex.aspx?FolderName=2011B" rel="nofollow">Opentravel Alliance schemas</a>. </p> <p>I am able to successfully deploy a war (with proper web.xml and sun-jaxws.xml) containing my JAX-WS service on various servlet containers (Jetty, Tomcat6/7, etc.) as long as my web method does <strong>not</strong> reference any of my JAXB objects. For example, this works:</p> <pre><code>@WebService(serviceName = "OTAService", targetNamespace = "http://www.opentravel.org/OTA/2003/05") @Addressing @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public class OTAService { public String sayHello(final String name) { return "Hello " + name + "!"; } } </code></pre> <p>However, if I change the web method to use JAXB databinding by adding a <code>@XmlSeeAlso</code> annotation or by referencing the objects directly, all of the servlet containers I have tried hang indefinitely (1+ hours), without error, and never start:</p> <pre><code>@WebService(serviceName = "OTAService", targetNamespace = "http://www.opentravel.org/OTA/2003/05") @Addressing @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({OTAHotelResNotifRQ.class, OTAHotelResNotifRS.class}) public class OTAService { @Action(input = "OTA_HotelResNotif") @WebMethod(operationName = "OTA_HotelResNotif", action = "OTA_HotelResNotif") public @WebResult OTAHotelResNotifRQ tokenizeOtaHotelResNotifRq( @WebParam(partName = "OTA_HotelResNotifRQ", name = "OTA_HotelResNotifRQ", targetNamespace = "http://www.opentravel.org/OTA/2003/05") final OTAHotelResNotifRQ request) { return request; } } </code></pre> <p>I have verified that all of the necessary jars, including the JAXB and JAX-WS APIs and runtime jars, are present in the war's /lib directory.</p> <p>The jar containing my JAXB objects, which is a required dependency for my JAX-WS project, can be created and installed to your local repo by running <code>mvn clean install</code> on <a href="https://github.com/justingarrick/opentravel-2011b-all" rel="nofollow">this project</a>. </p> <p>My JAX-WS project, which is available <a href="https://github.com/justingarrick/jaxws-test" rel="nofollow">here</a>, can be run in Jetty by invoking <code>mvn clean package jetty:run-war</code>.</p> <p>You will notice that Jetty starts right up if only the simple <code>sayHello</code> method is present. However, if you uncomment the JAXB method, Jetty and every other servlet container that I've tried will hang forever while attempting to instantiate the JAX-WS servlet. <strong>Can someone explain why web methods with JAXB databinding prevent my war from deploying? Since the freezing behavior is identical on a variety of servlet containers, I feel that there must be some crucial step that I'm missing; however, since no errors are reported and the container startup just hangs, I do not know how to proceed.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload