after some research I could run the 'HelloMavenCentral' example in my jboss 7.1.1 Final (as normal Java Application it was straight foreward).
However, I was not able to get the MailMerger running. Seems like there is a problem with the JAXBContext. I played around with different setups recommanded on stackoverflow an also tried the moxy implementation (which gives some different error output, but complaining about the totally same lines of code).
Here is my stacktrace, if you need further implementations details please let me know.
- Code: Select all
18:28:14,762 INFO [org.docx4j.model.fields.merge.MailMerger] (http--0.0.0.0-8080-1) Found 4 fields
18:28:14,801 ERROR [org.docx4j.model.fields.FieldRef] (http--0.0.0.0-8080-1) TODO: extract field name from org.docx4j.model.fields.FieldRef
18:28:14,810 ERROR [stderr] (http--0.0.0.0-8080-1) java.lang.RuntimeException: javax.xml.bind.JAXBException: class org.docx4j.model.fields.FieldRef nor any of its super class is known to this context.
18:28:14,812 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:575)
18:28:14,813 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:507)
18:28:14,814 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldRef.getFldName(FieldRef.java:304)
18:28:14,814 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldsPreprocessor.preserveResult(FieldsPreprocessor.java:235)
18:28:14,815 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldsPreprocessor.handleRun(FieldsPreprocessor.java:485)
18:28:14,816 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldsPreprocessor.handleContent(FieldsPreprocessor.java:180)
18:28:14,817 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldsPreprocessor.canonicaliseInstance(FieldsPreprocessor.java:142)
18:28:14,818 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.FieldsPreprocessor.canonicalise(FieldsPreprocessor.java:128)
18:28:14,819 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.merge.MailMerger.performOnInstance(MailMerger.java:479)
18:28:14,821 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.model.fields.merge.MailMerger.performMerge(MailMerger.java:388)
18:28:14,822 ERROR [stderr] (http--0.0.0.0-8080-1) at com.ruwen.docx.FieldsMailMerge.saveDoc(FieldsMailMerge.java:90)
18:28:14,823 ERROR [stderr] (http--0.0.0.0-8080-1) at com.ruwen.rest.DocRestService.getWordDoc(DocRestService.java:57)
18:28:14,823 ERROR [stderr] (http--0.0.0.0-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:28:14,824 ERROR [stderr] (http--0.0.0.0-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
18:28:14,825 ERROR [stderr] (http--0.0.0.0-8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
18:28:14,826 ERROR [stderr] (http--0.0.0.0-8080-1) at java.lang.reflect.Method.invoke(Unknown Source)
18:28:14,826 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)
18:28:14,827 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
18:28:14,828 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
18:28:14,829 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
18:28:14,829 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
18:28:14,830 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
18:28:14,830 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
18:28:14,831 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
18:28:14,831 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
18:28:14,832 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
18:28:14,833 ERROR [stderr] (http--0.0.0.0-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
18:28:14,833 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
18:28:14,834 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
18:28:14,835 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
18:28:14,835 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
18:28:14,836 ERROR [stderr] (http--0.0.0.0-8080-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
18:28:14,836 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
18:28:14,837 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
18:28:14,837 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
18:28:14,838 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
18:28:14,839 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
18:28:14,839 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
18:28:14,840 ERROR [stderr] (http--0.0.0.0-8080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
18:28:14,841 ERROR [stderr] (http--0.0.0.0-8080-1) at java.lang.Thread.run(Unknown Source)
18:28:14,841 ERROR [stderr] (http--0.0.0.0-8080-1) Caused by: javax.xml.bind.JAXBException: class org.docx4j.model.fields.FieldRef nor any of its super class is known to this context.
18:28:14,842 ERROR [stderr] (http--0.0.0.0-8080-1) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:588)
18:28:14,842 ERROR [stderr] (http--0.0.0.0-8080-1) at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:486)
18:28:14,843 ERROR [stderr] (http--0.0.0.0-8080-1) at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
18:28:14,843 ERROR [stderr] (http--0.0.0.0-8080-1) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
18:28:14,844 ERROR [stderr] (http--0.0.0.0-8080-1) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
18:28:14,845 ERROR [stderr] (http--0.0.0.0-8080-1) at org.docx4j.XmlUtils.marshaltoString(XmlUtils.java:563)
18:28:14,845 ERROR [stderr] (http--0.0.0.0-8080-1) ... 39 more
This is the relevant line of code where all the trouble begins (taken from the examples, and working outside of jboss)
- Code: Select all
org.docx4j.model.fields.merge.MailMerger.performMerge(wordMLPackage, thismap, true);
For the full consol please check http://pastebin.com/pmp8iupi
Thank you very much in advance for any hint how to solve this problem.
Ruwen