title: JAXB 2 spring-ws 2.0.3.RELEASE SOAP Services Tutorial Link/Advice Request
body: <p>I am trying to use JAXB 2 and spring-ws 2.0.3 to make a SOAP service on glassfish 3. </p>
  
  <p>I am having some problems with the xml file configurations because there is a ton of information (tutorials, examples) about getting older versions of these packages running but not much on the newer versions. </p>
  
  <p>I have succesfully gotten client/server programs working through the httpInvokerProxy remoting service, but the amount of configuration required in these files is substantially more.</p>
  
  <p>Essentially I used the xjc maven tool to create java classes out of my xml schema and the spring-ws annotations <code>@PayloadRoot</code>, <code>@EndPoint</code>, and <code>@ResponsePayload</code> to mark the methods in my endpoint java class. I am just trying to be sure that my wsdl file is available at the correct URL and that soap requests are being accepted and the responses delivered.</p>
  
  <p>If someone could recommend a good place to get this information or have the heart to look through my 3 xml files I would be very greatful. Otherwise, here is the error I am getting when going to the root servlet directory after uploading the war file.</p>
  
  <blockquote>
    <p>org.springframework.beans.BeanInstantiationException: Could not instantiate bean class     [org.springframework.web.context.support.XmlWebApplicationContext]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter</p>
  </blockquote>
  
  <p>My xml files are as follows:</p>
  
  <p><code>web.xml</code></p>
  
  <pre><code>    &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
               http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
           version="2.4"&gt;
  
      &lt;display-name&gt;Licensing SOAP Service&lt;/display-name&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;licensingSOAPService&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.ws.transport.http.MessageDispatcherServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;licensingSOAPService&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><code>licensingSOAPService-servlet.xml</code></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;
  
      &lt;import resource-"/applicationContext.xml"/&gt;
  
      &lt;bean id = "licensingSOAPService" class="mypackage.soap.LicensingSOAPService"&gt;
      &lt;/bean&gt;
  
      &lt;bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"&gt;
          &lt;description&gt;An endpoint mapping strategy that looks for @Endpoint and @PayloadRoot annotations.&lt;/description&gt;
      &lt;/bean&gt;
  
      &lt;bean class="org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter"&gt;
          &lt;description&gt;Enables the MessageDispatchServlet to invoke methods requiring OXM marshalling.&lt;/description&gt;
          &lt;constructor-arg ref="marshaller"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"
            p:contextPath="mypackage.schemas" /&gt;
  
  
      &lt;bean id = "licensingWSDL" class ="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"&gt;
          &lt;property name = "schema" ref = "schema"&gt;
          &lt;property name = "portTypeName" value = "licenseResource"/&gt;
          &lt;property name = "locationUri" value ="/licensing/schema/" /&gt;
          &lt;property name = "targetNamespace" value = "mypackage/schemas" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id ="schema" class ="org.springframework.xml.xsd.SimpleXsdSchema"&gt;
          &lt;property name ="xsd" value = "/licenseSchema.xsd"/&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><code>applicationContext.xml</code></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:sws="http://www.springframework.org/schema/web-services"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/web-services
  http://www.springframework.org/schema/web-services/web-services-2.0.xsd"&gt;
  
  &lt;sws:annotation-driven /&gt;
  
  &lt;context:component-scan base-package="mypackagel.licensing"/&gt;  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Does anybody see anything blatantly wrong with these? </p>
  
  <p>EDIT:</p>
  
  <p>Wanted to include dependency part of my pom.xml as it was pointed out (correctly so) that I have both spring 3.1 AND spring 3.5 jars in my war file.</p>
  
  <pre><code>&lt;repositories&gt;
          &lt;repository&gt; 
              &lt;id&gt;com.springsource.repository.bundles.release&lt;/id&gt; 
              &lt;name&gt;SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases&lt;/name&gt; 
              &lt;url&gt;http://repository.springsource.com/maven/bundles/release&lt;/url&gt; 
          &lt;/repository&gt;
          &lt;repository&gt;
            &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;
            &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
            &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
            &lt;layout&gt;default&lt;/layout&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;  
              &lt;groupId&gt;com.sun.xml.messaging.saaj&lt;/groupId&gt;  
              &lt;artifactId&gt;saaj-impl&lt;/artifactId&gt;  
              &lt;version&gt;1.3&lt;/version&gt;  
              &lt;scope&gt;runtime&lt;/scope&gt;  
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.ws&lt;/groupId&gt;
              &lt;artifactId&gt;spring-ws-core&lt;/artifactId&gt;
              &lt;version&gt;2.0.3.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;  
              &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;  
              &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;  
              &lt;version&gt;2.0&lt;/version&gt;  
          &lt;/dependency&gt;  
          &lt;dependency&gt;  
              &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;  
              &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;  
              &lt;version&gt;2.0.3&lt;/version&gt;  
          &lt;/dependency&gt;  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;3.1.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;finalName&gt;LicensingSOAPService&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;generate&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>