error in marshalling - missing xmlrootelement annotation error
<p>When i call one of the WSDL operation from a spring project, i am getting following exception - 
<code>com.sun.istack.internal.SAXException2: unable to marshal type "com.pkg.wsdl.ABC" as an element because it is missing an @XmlRootElement annotation</code></p>

<p>I am using following in pom.xml to generate java objects from a WSDL(already used by many clients) as part of a spring project - </p>

<pre><code>        &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
        &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
        &lt;version&gt;0.13.1&lt;/version&gt;
</code></pre>

<p>Looking at similar issue resolution i changed the code to use JAXBElement but still getting same error - </p>

<pre><code>    ABC vabc = new ABC();
    vabc.set(..)   // populate vabc object 

    ObjectFactory of = new ObjectFactory();
    JAXBElement&lt;ABC&gt; jabc = of.createABC(vabc);
    ABC oabc = jabc .getValue();
</code></pre>

<p>Marshaller Code - </p>

<pre><code>Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("com.pkg.wsdl");
</code></pre>

<p>and Calling the backend Web Service -</p>

<pre><code>        ABCResp response = (ABCResp) getWebServiceTemplate()
        .marshalSendAndReceive("http://host:port/svcname",oabc);
</code></pre>