title: org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception using Spring WebserviceTemplate
body: <p>Have a Java based application uses different maven projects to connect to different webservices, application already had an existing maven project(say project1) which uses webServiceTemplate to call the SOAP based service and get the response.</p>
  <p>I have now a new requirement to create another similar project for a different service but need to use the wsse security headers. I created a new maven project and called the service using the webServiceTemplate implementation.</p>
  <p>Both the projects in standalone works fine, but when clubbed together getting the below exception</p>
  <pre><code>org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is javax.xml.bind.JAXBException: class org.com.project1.cm.CreateRequest nor any of its super class is known to this context..) 
  </code></pre>
  <p>SpringService context xml is as below</p>
  <pre><code>     &lt;bean id=&quot;webServiceTemplate&quot; class=&quot;org.springframework.ws.client.core.WebServiceTemplate&quot;&gt;
          &lt;property name=&quot;messageSender&quot;&gt;
              &lt;bean class=&quot;org.springframework.ws.transport.http.HttpComponentsMessageSender&quot;&gt;
                  &lt;property name=&quot;credentials&quot; ref=&quot;credentialProvider&quot; /&gt;
                  &lt;property name=&quot;authScope&quot; ref=&quot;authScope&quot; /&gt;
                  &lt;property name=&quot;httpClient&quot; ref=&quot;httpClient&quot; /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;property name=&quot;defaultUri&quot; value=&quot;${myproject.endpoint.url}&quot;/&gt;    
          &lt;property name=&quot;marshaller&quot; ref=&quot;marshaller&quot; /&gt;
          &lt;property name=&quot;unmarshaller&quot; ref=&quot;unMarshaller&quot; /&gt;
          &lt;property name=&quot;interceptors&quot;&gt;
              &lt;list&gt;              
                  &lt;bean
                      class=&quot;org.com.project1.cm.SoapLoggingInterceptor&quot; &gt;                    
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      
      &lt;oxm:jaxb2-marshaller id=&quot;marshaller&quot; contextPath=&quot;org.com.project1.cm&quot;/&gt; 
      &lt;oxm:jaxb2-marshaller id=&quot;unMarshaller&quot; contextPath=&quot;org.com.project1.cm&quot; /&gt; 
  
  </code></pre>
  <p>Another project uses a similar Spring Context xml only the jaxb2-marshaller has the contextPath of  new Service</p>
  <p>Invokation of service is done with the below code in both the projects Impl class</p>
  <pre><code>public AttendenceResponse getAttendenceDetails(AttendenceRequest request) {
          try {
              MyData myData = AttendenceRequestMapper.getInstance().map(request.getPayload());
              AttendenceResponse aResponse = (AttendenceResponse) webServiceTemplate.marshalSendAndReceive(webServiceTemplate.getDefaultUri(), myData);
  
              return AttendenceResponseMapper.getInstance().map(aResponse.getMyDataResult());
            } catch (Exception e) {
               throw se;
          }
      }
  </code></pre>
  <p>For the Project 2 I had to add the wsse security headers, so added the below jars in pom.xml</p>
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;org.springframework.ws&lt;/groupId&gt;
              &lt;artifactId&gt;spring-ws-security&lt;/artifactId&gt;
              &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-expression&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>can you please guide me on resolving this issue?</p>
  <pre><code></code></pre>