I want to generate xml file from Struts action object. So that I have tried to use the plugin named struts2-jaxb-plugin. Infact I am new to this and they have given an example to how to use the JAXB plugin in struts2. Click here to see the example what I have tried.
While starting the server, it gives the following Exception.
INFO - Could not locate any XML to UnMarshall an object from. Attempted using the parameter jaxbXML
23 Jan, 2012 1:12:26 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/Object;)Ljava/lang/Object;
at org.apache.struts2.result.jaxb.JAXBResultType.isGzipOkay(JAXBResultType.java:213)
at org.apache.struts2.result.jaxb.JAXBResultType.prepareForResponse(JAXBResultType.java:113)
at org.apache.struts2.result.jaxb.JAXBResultType.doExecute(JAXBResultType.java:58)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
…
I am using the following jars in my project:
xwork-core-2.1.6.jar,
struts2-core-2.2.1.jar
JAXB-plugin jar: struts2-jaxb-plugin.jar
Thanks in advance friends!
Looks like this Plugin is writen for an older version Struts 2.0.x and is not compatible for newer versions like 2.1.x or higher.