title: Cannot convert to type spring.oxm.marshaller: no matching editors or conversion strategy found
body: <p>I have been struggling with that error for long time, have googled, looked at the examples around the web and still not getting to work. To be honest I don't understand why my project throws this error.</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.oxm.Marshaller] for property 'marshaller': no matching editors or conversion strategy found
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264)
      at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)
      ... 52 more)
      at junit.framework.Assert.fail(Assert.java:57)
      at junit.framework.TestCase.fail(TestCase.java:227)
      at junit.framework.TestSuite$1.runTest(TestSuite.java:100)
      at junit.framework.TestCase.runBare(TestCase.java:141)
      at junit.framework.TestResult$1.protect(TestResult.java:122)
      at junit.framework.TestResult.runProtected(TestResult.java:142)
      at junit.framework.TestResult.run(TestResult.java:125)
      at junit.framework.TestCase.run(TestCase.java:129)
      at junit.framework.TestSuite.runTest(TestSuite.java:255)
      at junit.framework.TestSuite.run(TestSuite.java:250)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>So my setup is Spring Web Services, Jaxb2, maven. I have predefined xsd files and generated java classes from them by jaxb2 maven plugin.</p>
  
  <pre><code>&lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;jaxb2-maven-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;schema1-xjc&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;xjc&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;schemaDirectory&gt;src/main/resources/&lt;/schemaDirectory&gt;
                              &lt;schemaFiles&gt;ApplicationResponse.xsd&lt;/schemaFiles&gt;
                              &lt;packageName&gt;com.package.response&lt;/packageName&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>My pom has additionally these dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
      &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
      &lt;version&gt;${jaxb.api.version}&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.2.7&lt;/version&gt;
      &lt;!-- &lt;exclusions&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;javax.activation&lt;/groupId&gt;
              &lt;artifactId&gt;activation&lt;/artifactId&gt;
          &lt;/exclusion&gt;
      &lt;/exclusions&gt; --&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
      &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
      &lt;version&gt;2.5.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.xml.stream&lt;/groupId&gt;
      &lt;artifactId&gt;sjsxp&lt;/artifactId&gt;
      &lt;version&gt;1.0.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Here is my appContext.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:util="http://www.springframework.org/schema/util"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:sws="http://www.springframework.org/schema/web-services"
         xmlns:p="http://www.springframework.org/schema/p"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans 
                             http://www.springframework.org/schema/beans/spring-beans.xsd
                             http://www.springframework.org/schema/context
                             http://www.springframework.org/schema/context/spring-context.xsd
                             http://www.springframework.org/schema/web-services
                          http://www.springframework.org/schema/web-services/web-services-2.0.xsd
                          http://www.springframework.org/schema/util
                          http://www.springframework.org/schema/util/spring-util-2.0.xsd"&gt;
  
      &lt;context:component-scan base-package="com.package" /&gt;
  
      &lt;sws:annotation-driven /&gt;
  
      &lt;bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"&gt;
          &lt;property name="soapVersion"&gt;
              &lt;util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_11" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"&gt;
          &lt;constructor-arg ref="messageFactory"/&gt;
          &lt;property name="defaultUri" value="https://example/address/hidden"/&gt;
          &lt;property name="marshaller" value="marshaller" /&gt;
          &lt;property name="unmarshaller" value="marshaller" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt;
            &lt;property name="contextPath" value="com.package.request:com.package.request" /&gt;
            &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>My service client class</p>
  
  <pre><code>@Component
  public class NorServiceClient implements NorService {
  
      @Autowired
      private WebServiceTemplate wsTemplate;
  
      public void setDefaultUri(String defaultUri) {
          wsTemplate.setDefaultUri(defaultUri);
      }
  
      public ApplicationResponse downloadFileList(ApplicationRequest request) {
          // Command: DownloadFileList
          return (ApplicationResponse) wsTemplate.marshalSendAndReceive(request);
      }
  }
  </code></pre>
  
  <p>And my test case:</p>
  
  <pre><code>public class AppTest extends TestCase {
  
      private ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/appContext.xml");
  
      @Test
      public void testApplicationRequest() {
          assertNotNull(new Object());
          System.out.println("Context: " + context);
          NorService norService = (NorService) context.getBean("norServiceClient");
          ApplicationRequest request = new ApplicationRequest();
          nordeaService.downloadFileList(request);
      }
  }
  </code></pre>
  
  <p>When launching my app it doesn't even get to the service.downloadFileList, it throws the exception when initializing context. So I don't think it may be the problem that I have instatiated just empty ApplicationRequest object.</p>
  
  <p>Where could the problem lie? By all the examples in the internet I have done setup the same way, but in my project it throws the exception that <code>no matching editors or conversion strategy found</code></p>