骡子 JaxB 反序列化失败,无法解析 ArrayList。

huangapple 未分类评论49阅读模式
英文:

Mule JaxB unmarshalling failingto parse the ArrayList

问题

抱歉,由于您要求只返回翻译好的部分,以下是您提供的内容的翻译:

  1. 我正在尝试一个使用xml-to-object-transformer>转换器在Mule3中将实际XML转换为Java对象的用例,而没有使用DW。我最终遇到了一个奇怪的问题,请检查是否有人可以帮助。
  2. 为了实现这个目标,
  3. 1. 使用XJC JAXB API生成了一个JAXB类。
  4. 2. 将该类设置为转换器中的别名类,以验证数据类型。
  5. 3. 使用上述别名进行xml-to-object-transformer转换。
  6. **Mule的代码片段**
  7. <mulexml:xml-to-object-transformer driverClass="com.thoughtworks.xstream.io.xml.Xpp3Driver" doc:name="XML to Object">
  8. <mulexml:alias class="com.test.jaxb.model.Root" name="root" />
  9. </mulexml:xml-to-object-transformer>
  10. **XSD的代码片段**
  11. <?xml version="1.0" encoding="utf-8"?>
  12. <xs:schema attributeFormDefault="unqualified"
  13. elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  14. <xs:element name="root">
  15. <xs:complexType>
  16. <xs:sequence>
  17. <xs:element name="customerDetails">
  18. <xs:complexType>
  19. <xs:sequence>
  20. <xs:element maxOccurs="unbounded" name="customerDetail">
  21. <xs:complexType>
  22. <xs:sequence>
  23. <xs:element name="customerName" type="xs:string" />
  24. <xs:element name="customerId" type="xs:unsignedShort" />
  25. </xs:sequence>
  26. </xs:complexType>
  27. </xs:element>
  28. </xs:sequence>
  29. </xs:complexType>
  30. </xs:element>
  31. </xs:sequence>
  32. </xs:complexType>
  33. </xs:element>
  34. </xs:schema>
  35. **Root.Java的代码片段[由XJC生成]**
  36. @XmlAccessorType(XmlAccessType.FIELD)
  37. @XmlType(name = "", propOrder = {
  38. "customerDetails"
  39. })
  40. @XmlRootElement(name = "root")
  41. public class Root {
  42. @XmlElement(required = true)
  43. protected Root.CustomerDetails customerDetails;
  44. public Root.CustomerDetails getCustomerDetails() {
  45. return customerDetails;
  46. }
  47. public void setCustomerDetails(Root.CustomerDetails value) {
  48. this.customerDetails = value;
  49. }
  50. @XmlAccessorType(XmlAccessType.FIELD)
  51. @XmlType(name = "", propOrder = {
  52. "customerDetail"
  53. })
  54. public static class CustomerDetails {
  55. @XmlElement(required = true)
  56. protected List<Root.CustomerDetails.CustomerDetail> customerDetail;
  57. public List<Root.CustomerDetails.CustomerDetail> getCustomerDetail() {
  58. if (customerDetail == null) {
  59. customerDetail = new ArrayList<Root.CustomerDetails.CustomerDetail>();
  60. }
  61. return this.customerDetail;
  62. }
  63. @XmlAccessorType(XmlAccessType.FIELD)
  64. @XmlType(name = "", propOrder = {
  65. "customerName",
  66. "customerId"
  67. })
  68. public static class CustomerDetail {
  69. @XmlElement(required = true)
  70. protected String customerName;
  71. @XmlSchemaType(name = "unsignedShort")
  72. protected int customerId;
  73. public String getCustomerName() {
  74. return customerName;
  75. }
  76. public void setCustomerName(String value) {
  77. this.customerName = value;
  78. }
  79. public int getCustomerId() {
  80. return customerId;
  81. }
  82. public void setCustomerId(int value) {
  83. this.customerId = value;
  84. }
  85. }
  86. }
  87. }
  88. **测试消息**
  89. <?xml version="1.0" encoding="UTF-8"?>
  90. <root>
  91. <customerDetails>
  92. <customerDetail>
  93. <customerName>TestUser1</customerName>
  94. <customerId>123</customerId>
  95. </customerDetail>
  96. <customerDetail>
  97. <customerName>TestUser2</customerName>
  98. <customerId>321</customerId>
  99. </customerDetail>
  100. </customerDetails>
  101. </root>
  102. **预期输出**
  103. Java对象
  104. **但实际输出-接收错误**
  105. ---- 调试信息 ----
  106. cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
  107. cause-message : customerName
  108. class : java.util.ArrayList
  109. required-type : java.util.ArrayList
  110. converter-type : com.thoughtworks.xstream.converters.collections.CollectionConverter
  111. path : /root/customerDetails/customerDetail/customerName
  112. line number : 5
  113. class[1] : com.test.jaxb.model.Root$CustomerDetails
  114. converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
  115. class[2] : com.test.jaxb.model.Root
  116. version : 1.4.10
  117. ------------------------------- (com.thoughtworks.xstream.converters.ConversionException)
  118. Payload : org.glassfish.grizzly.utils.BufferInputStream@74447578
  119. Transformer : XmlToObject{this=47272cd3, name='XmlToObject', ignoreBadInput=false, returnClass=SimpleDataType{type=java.lang.Object, mimeType='*/*', encoding='null'}, sourceTypes=[SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}, SimpleDataType{type=[B, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.io.InputStream, mimeType='*/*', encoding='null'}, SimpleDataType{type=org.w3c.dom.Document
  120. <details>
  121. <summary>英文:</summary>
  122. I am trying a usecase that the actual XML to be transformed as Java Object by using xml-to-object-transformer&gt; transformer in Mule3., no DW. I ended up with a strange issue and pls chk if anyone can help.
  123. To do that,
  124. 1. Generated a JAXB class using XJC JAXB API
  125. 2. Setting that class as alias class in the transformer to validate the data types
  126. 3. Do the xml-to-object-transformer with the above alias
  127. **Code snippet of Mule**
  128. &lt;mulexml:xml-to-object-transformer driverClass=&quot;com.thoughtworks.xstream.io.xml.Xpp3Driver&quot; doc:name=&quot;XML to Object&quot;&gt;
  129. &lt;mulexml:alias class=&quot;com.test.jaxb.model.Root&quot; name=&quot;root&quot; /&gt;
  130. &lt;/mulexml:xml-to-object-transformer&gt;
  131. **Code snippet of XSD**
  132. &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  133. &lt;xs:schema attributeFormDefault=&quot;unqualified&quot;
  134. elementFormDefault=&quot;qualified&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
  135. &lt;xs:element name=&quot;root&quot;&gt;
  136. &lt;xs:complexType&gt;
  137. &lt;xs:sequence&gt;
  138. &lt;xs:element name=&quot;customerDetails&quot;&gt;
  139. &lt;xs:complexType&gt;
  140. &lt;xs:sequence&gt;
  141. &lt;xs:element maxOccurs=&quot;unbounded&quot; name=&quot;customerDetail&quot;&gt;
  142. &lt;xs:complexType&gt;
  143. &lt;xs:sequence&gt;
  144. &lt;xs:element name=&quot;customerName&quot; type=&quot;xs:string&quot; /&gt;
  145. &lt;xs:element name=&quot;customerId&quot; type=&quot;xs:unsignedShort&quot; /&gt;
  146. &lt;/xs:sequence&gt;
  147. &lt;/xs:complexType&gt;
  148. &lt;/xs:element&gt;
  149. &lt;/xs:sequence&gt;
  150. &lt;/xs:complexType&gt;
  151. &lt;/xs:element&gt;
  152. &lt;/xs:sequence&gt;
  153. &lt;/xs:complexType&gt;
  154. &lt;/xs:element&gt;
  155. &lt;/xs:schema&gt;
  156. **Code snippet of Root.Java [Generated by XJC]**
  157. @XmlAccessorType(XmlAccessType.FIELD)
  158. @XmlType(name = &quot;&quot;, propOrder = {
  159. &quot;customerDetails&quot;
  160. })
  161. @XmlRootElement(name = &quot;root&quot;)
  162. public class Root {
  163. @XmlElement(required = true)
  164. protected Root.CustomerDetails customerDetails;
  165. public Root.CustomerDetails getCustomerDetails() {
  166. return customerDetails;
  167. }
  168. public void setCustomerDetails(Root.CustomerDetails value) {
  169. this.customerDetails = value;
  170. }
  171. @XmlAccessorType(XmlAccessType.FIELD)
  172. @XmlType(name = &quot;&quot;, propOrder = {
  173. &quot;customerDetail&quot;
  174. })
  175. public static class CustomerDetails {
  176. @XmlElement(required = true)
  177. protected List&lt;Root.CustomerDetails.CustomerDetail&gt; customerDetail;
  178. public List&lt;Root.CustomerDetails.CustomerDetail&gt; getCustomerDetail() {
  179. if (customerDetail == null) {
  180. customerDetail = new ArrayList&lt;Root.CustomerDetails.CustomerDetail&gt;();
  181. }
  182. return this.customerDetail;
  183. }
  184. @XmlAccessorType(XmlAccessType.FIELD)
  185. @XmlType(name = &quot;&quot;, propOrder = {
  186. &quot;customerName&quot;,
  187. &quot;customerId&quot;
  188. })
  189. public static class CustomerDetail {
  190. @XmlElement(required = true)
  191. protected String customerName;
  192. @XmlSchemaType(name = &quot;unsignedShort&quot;)
  193. protected int customerId;
  194. public String getCustomerName() {
  195. return customerName;
  196. }
  197. public void setCustomerName(String value) {
  198. this.customerName = value;
  199. }
  200. public int getCustomerId() {
  201. return customerId;
  202. }
  203. public void setCustomerId(int value) {
  204. this.customerId = value;
  205. }
  206. }
  207. }
  208. }
  209. **Test Message**
  210. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  211. &lt;root&gt;
  212. &lt;customerDetails&gt;
  213. &lt;customerDetail&gt;
  214. &lt;customerName&gt;TestUser1&lt;/customerName&gt;
  215. &lt;customerId&gt;123&lt;/customerId&gt;
  216. &lt;/customerDetail&gt;
  217. &lt;customerDetail&gt;
  218. &lt;customerName&gt;TestUser2&lt;/customerName&gt;
  219. &lt;customerId&gt;321&lt;/customerId&gt;
  220. &lt;/customerDetail&gt;
  221. &lt;/customerDetails&gt;
  222. &lt;/root&gt;
  223. **Expected output**
  224. Java object
  225. **But Actual output - Error receiving**
  226. ---- Debugging information ----
  227. cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
  228. cause-message : customerName
  229. class : java.util.ArrayList
  230. required-type : java.util.ArrayList
  231. converter-type : com.thoughtworks.xstream.converters.collections.CollectionConverter
  232. path : /root/customerDetails/customerDetail/customerName
  233. line number : 5
  234. class[1] : com.test.jaxb.model.Root$CustomerDetails
  235. converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
  236. class[2] : com.test.jaxb.model.Root
  237. version : 1.4.10
  238. ------------------------------- (com.thoughtworks.xstream.converters.ConversionException)
  239. Payload : org.glassfish.grizzly.utils.BufferInputStream@74447578
  240. Transformer : XmlToObject{this=47272cd3, name=&#39;XmlToObject&#39;, ignoreBadInput=false, returnClass=SimpleDataType{type=java.lang.Object, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}, sourceTypes=[SimpleDataType{type=java.lang.String, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}, SimpleDataType{type=[B, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}, SimpleDataType{type=java.io.InputStream, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}, SimpleDataType{type=org.w3c.dom.Document, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}, SimpleDataType{type=org.dom4j.Document, mimeType=&#39;*/*&#39;, encoding=&#39;null&#39;}]}
  241. Element : /poc-json2xml-testFlow/processors/0 @ poc-json2xml-dummy:poc-json2xml-dummy.xml:29 (XML to Object)
  242. Element XML : &lt;mulexml:xml-to-object-transformer driverClass=&quot;com.thoughtworks.xstream.io.xml.Xpp3Driver&quot; doc:name=&quot;XML to Object&quot;&gt;
  243. &lt;mulexml:alias class=&quot;com.test.jaxb.model.Root&quot; name=&quot;root&quot;&gt;&lt;/mulexml:alias&gt;
  244. &lt;/mulexml:xml-to-object-transformer&gt;
  245. --------------------------------------------------------------------------------
  246. Root Exception stack trace:
  247. com.thoughtworks.xstream.mapper.CannotResolveClassException: customerName
  248. at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
  249. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  250. at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
  251. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  252. at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
  253. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  254. at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
  255. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  256. at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
  257. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  258. at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
  259. at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
  260. at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
  261. at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
  262. at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:72)
  263. at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:98)
  264. at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:91)
  265. at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:85)
  266. at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
  267. at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
  268. at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70)
  269. at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
  270. at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:503)
  271. at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:429)
  272. at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:281)
  273. at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
  274. at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70)
  275. at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
  276. at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
  277. at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
  278. at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
  279. at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1486)
  280. at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1466)
  281. at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1337)
  282. at org.mule.module.xml.transformer.XmlToObject.transformMessage(XmlToObject.java:68)
  283. at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
  284. at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:89)
  285. at org.mule.DefaultMuleMessage.transformMessage(DefaultMuleMessage.java:1642)
  286. at org.mule.DefaultMuleMessage.applyAllTransformers(DefaultMuleMessage.java:1545)
  287. at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1519)
  288. at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1511)
  289. at org.mule.transformer.AbstractTransformer.process(AbstractTransformer.java:114)
  290. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  291. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  292. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  293. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  294. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  295. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  296. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  297. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  298. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  299. at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:110)
  300. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  301. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  302. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  303. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  304. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  305. at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:55)
  306. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  307. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  308. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  309. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
  310. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  311. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  312. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  313. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  314. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  315. at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:59)
  316. at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:48)
  317. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  318. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  319. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  320. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  321. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  322. at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:52)
  323. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  324. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  325. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  326. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
  327. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  328. at org.mule.processor.AbstractRequestResponseMessageProcessor.processBlocking(AbstractRequestResponseMessageProcessor.java:57)
  329. at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:48)
  330. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  331. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  332. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  333. at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
  334. at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
  335. at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
  336. at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:111)
  337. at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
  338. at org.mule.construct.AbstractPipeline$3.process(AbstractPipeline.java:232)
  339. at org.mule.module.http.internal.listener.HttpMessageProcessorTemplate.routeEvent(HttpMessageProcessorTemplate.java:73)
  340. at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:73)
  341. at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:60)
  342. at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
  343. at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
  344. at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
  345. at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
  346. at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
  347. at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
  348. at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
  349. at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
  350. at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
  351. at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
  352. at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
  353. at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
  354. at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
  355. at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)
  356. at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:59)
  357. at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:36)
  358. at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.process(PhaseExecutionEngine.java:114)
  359. at org.mule.execution.PhaseExecutionEngine.process(PhaseExecutionEngine.java:41)
  360. at org.mule.execution.MuleMessageProcessingManager.processMessage(MuleMessageProcessingManager.java:32)
  361. at org.mule.module.http.internal.listener.DefaultHttpListener$1.handleRequest(DefaultHttpListener.java:135)
  362. at org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:100)
  363. at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
  364. at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
  365. at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
  366. at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
  367. at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
  368. at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
  369. at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
  370. at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
  371. at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:119)
  372. at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access$100(ExecutorPerServerAddressIOStrategy.java:31)
  373. at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:142)
  374. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  375. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  376. at java.lang.Thread.run(Thread.java:748)
  377. ********************************************************************************
  378. </details>
  379. # 答案1
  380. **得分**: 0
  381. 似乎问题出在您正在使用&lt;mulexml:xml-to-object-transformer&gt;转换器,它不知道如何处理JAXB处理。您应该尝试使用[JAXB转换器][1]。
  382. 对于旧版本的Mule,有一个类似的先前答案:https://stackoverflow.com/a/20243878/721855
  383. [1]: https://docs.mulesoft.com/mule-runtime/3.9/jaxb-transformers
  384. <details>
  385. <summary>英文:</summary>
  386. It looks like the problem is that you are using the &lt;mulexml:xml-to-object-transformer&gt; transformer, which doesn&#39;t know how to handle JAXB processing. You should try instead the [JAXB transformers][1].
  387. There is a previous similar answer for an older version of Mule: https://stackoverflow.com/a/20243878/721855
  388. [1]: https://docs.mulesoft.com/mule-runtime/3.9/jaxb-transformers
  389. </details>

huangapple
  • 本文由 发表于 2020年4月6日 03:59:05
  • 转载请务必保留本文链接:https://java.coder-hub.com/61048683.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定