Uploaded image for project: 'Fuse Tooling'
  1. Fuse Tooling
  2. FUSETOOLS-1395

Issues mapping transformation from JSON to XML

XMLWordPrintable

    • Sprint 2, Fuse 6.2.1 / JBDSIS 8.0.4

      This stems from a conversation in the comments on this blog post: http://tools.jboss.org/blog/2015-06-01-so-you-want-to-transform-part-1.html

      The user has taken the xml-to-json project and reversed it, using it to from json-to-xml. And is getting an issue in the console when the test runs:

      [                          main] TransformationTest2            INFO  ********************************************************************************
      [                          main] TransformationTest2            INFO  Testing: transform(com.slake.testSample.TransformationTest2)
      [                          main] TransformationTest2            INFO  ********************************************************************************
      [                          main] DefaultTypeConverter           INFO  Loaded 183 type converters
      [                          main] SpringCamelContext             INFO  Apache Camel 2.15.1 (CamelContext: camel-1) is starting
      [                          main] ManagedManagementStrategy      INFO  JMX is enabled
      [                          main] GlobalSettings                 INFO  Trying to find Dozer configuration file: dozer.properties
      [                          main] GlobalSettings                 WARN  Dozer configuration file not found: dozer.properties.  Using defaults for all Dozer global properties.
      [                          main] DozerComponent                 INFO  Configuring GlobalSettings to enable EL
      [                          main] DozerInitializer               INFO  Initializing Dozer. Version: 5.5.0, Thread Name: main
      [                          main] JMXPlatformImpl                INFO  Dozer JMX MBean [org.dozer.jmx:type=DozerStatisticsController] auto registered with the Platform MBean Server
      [                          main] JMXPlatformImpl                INFO  Dozer JMX MBean [org.dozer.jmx:type=DozerAdminController] auto registered with the Platform MBean Server
      [                          main] DozerBeanMapper                INFO  Initializing a new instance of dozer bean mapper.
      [                          main] DozerEndpoint                  INFO  Loading Dozer mapping file sample2Xml.xml.
      [                          main] SpringCamelContext             INFO  AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
      [                          main] SpringCamelContext             INFO  StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
      [                          main] SpringCamelContext             INFO  Route: route1 started and consuming from: Endpoint[file:///src/data?fileName=xyz-order.json]
      [                          main] SpringCamelContext             INFO  Route: route2 started and consuming from: Endpoint[direct://sample2Xml-test-input]
      [                          main] SpringCamelContext             INFO  Total 2 routes, of which 2 is started.
      [                          main] SpringCamelContext             INFO  Apache Camel 2.15.1 (CamelContext: camel-1) started in 0.347 seconds
      COntent --->>>{"custId":"ACME-123",
       "priority":"GOLD",
       "orderId":"ORDER1",
       "lineItems":[
       	{"itemId":"PICKLE","amount":1000,"cost":2.25},
       	{"itemId":"BANANA","amount":400,"cost":1.25}
         ]}
      [                          main] route2                         INFO  Before transformation:
       {"custId":"ACME-123",
       "priority":"GOLD",
       "orderId":"ORDER1",
       "lineItems":[
       	{"itemId":"PICKLE","amount":1000,"cost":2.25},
       	{"itemId":"BANANA","amount":400,"cost":1.25}
         ]}
      [                          main] JacksonDataFormat              INFO  Registering module: com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule@3e834538
      [                          main] DefaultErrorHandler            ERROR Failed delivery for (MessageId: ID-brianf-work-59467-1436812489096-0-1 on ExchangeId: ID-brianf-work-59467-1436812489096-0-2). Exhausted after delivery attempt: 1 caught: org.dozer.MappingException: Source object must not be null
      
      Message History
      ---------------------------------------------------------------------------------------------------------------------------------------
      RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
      [route2            ] [route2            ] [direct://sample2Xml-test-input                                                ] [     30948]
      [route2            ] [log2              ] [log                                                                           ] [         3]
      [route2            ] [to3               ] [ref:sample2Xml                                                                ] [     30942]
      
      Exchange
      ---------------------------------------------------------------------------------------------------------------------------------------
      Exchange[
      	Id                  ID-brianf-work-59467-1436812489096-0-2
      	ExchangePattern     InOnly
      	Headers             {breadcrumbId=ID-brianf-work-59467-1436812489096-0-1, CamelRedelivered=false, CamelRedeliveryCounter=0}
      	BodyType            String
      	Body                {"custId":"ACME-123",
       "priority":"GOLD",
       "orderId":"ORDER1",
       "lineItems":[
       	{"itemId":"PICKLE","amount":1000,"cost":2.25},
       	{"itemId":"BANANA","amount":400,"cost":1.25}
         ]}
      ]
      
      Stacktrace
      ---------------------------------------------------------------------------------------------------------------------------------------
      org.dozer.MappingException: Source object must not be null
      	at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:87)
      	at org.dozer.util.MappingValidator.validateMappingRequest(MappingValidator.java:37)
      	at org.dozer.util.MappingValidator.validateMappingRequest(MappingValidator.java:49)
      	at org.dozer.MappingProcessor.map(MappingProcessor.java:103)
      	at org.dozer.MappingProcessor.map(MappingProcessor.java:99)
      	at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:120)
      	at org.apache.camel.component.dozer.DozerProducer.process(DozerProducer.java:79)
      	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
      	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
      	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
      	at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
      	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:375)
      	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:343)
      	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
      	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:343)
      	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
      	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
      	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:137)
      	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:359)
      	at com.slake.testSample.TransformationTest2.transform(TransformationTest2.java:25)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      [                          main] TransformationTest2            INFO  ********************************************************************************
      [                          main] TransformationTest2            INFO  Testing done: transform(com.slake.testSample.TransformationTest2)
      [                          main] TransformationTest2            INFO  Took: 30.960 seconds (30960 millis)
      [                          main] TransformationTest2            INFO  ********************************************************************************
      [                          main] SpringCamelContext             INFO  Apache Camel 2.15.1 (CamelContext: camel-1) is shutting down
      [                          main] DefaultShutdownStrategy        INFO  Starting to graceful shutdown 2 routes (timeout 10 seconds)
      [el-1) thread #1 - ShutdownTask] DefaultShutdownStrategy        INFO  Route: route2 shutdown complete, was consuming from: Endpoint[direct://sample2Xml-test-input]
      [el-1) thread #1 - ShutdownTask] DefaultShutdownStrategy        INFO  Route: route1 shutdown complete, was consuming from: Endpoint[file:///src/data?fileName=xyz-order.json]
      [                          main] DefaultShutdownStrategy        INFO  Graceful shutdown of 2 routes completed in 0 seconds
      [                          main] SpringCamelContext             INFO  Apache Camel 2.15.1 (CamelContext: camel-1) uptime 31.324 seconds
      [                          main] SpringCamelContext             INFO  Apache Camel 2.15.1 (CamelContext: camel-1) is shutdown in 0.008 seconds
      

              teiid John Verhaeg (Inactive)
              bfitzpat_rh Brian Fitzpatrick (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: