[ 
https://issues.apache.org/jira/browse/CAMEL-8003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Babak Vahdat resolved CAMEL-8003.
---------------------------------
    Resolution: Fixed

> examples - camel-examples-etl is broken (again)
> -----------------------------------------------
>
>                 Key: CAMEL-8003
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8003
>             Project: Camel
>          Issue Type: Task
>          Components: examples
>    Affects Versions: 2.14.0
>            Reporter: Babak Vahdat
>            Assignee: Babak Vahdat
>            Priority: Minor
>             Fix For: 2.14.1, 2.15.0
>
>
> This is currently what you end up with:
> {code}
> ~/dev/workspace/camel/examples/camel-example-etl>mvn camel:run
> [INFO] Scanning for projects...
> [INFO]                                                                        
>  
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building Camel :: Example :: ETL 2.15-SNAPSHOT
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] 
> [INFO] >>> camel-maven-plugin:2.15-SNAPSHOT:run (default-cli) > test-compile 
> @ camel-example-etl >>>
> [INFO] 
> [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ 
> camel-example-etl ---
> [INFO] 
> [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ 
> camel-example-etl ---
> [INFO] 
> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
> camel-example-etl ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 7 resources
> [INFO] Copying 3 resources
> [INFO] 
> [INFO] --- maven-resources-plugin:2.6:resources (default) @ camel-example-etl 
> ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 7 resources
> [INFO] Copying 3 resources
> [INFO] 
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ 
> camel-example-etl ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO] 
> [INFO] --- openjpa-maven-plugin:2.3.0:enhance (enhancer) @ camel-example-etl 
> ---
> 34  camel  INFO   [main] openjpa.Tool - Enhancer running on type "class 
> org.apache.camel.example.etl.CustomerEntity".
> [INFO] 
> [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
> camel-example-etl ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory 
> /Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/test/resources
> [INFO] Copying 3 resources
> [INFO] 
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ 
> camel-example-etl ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO] 
> [INFO] <<< camel-maven-plugin:2.15-SNAPSHOT:run (default-cli) < test-compile 
> @ camel-example-etl <<<
> [INFO] 
> [INFO] --- camel-maven-plugin:2.15-SNAPSHOT:run (default-cli) @ 
> camel-example-etl ---
> [INFO] Using org.apache.camel.spring.Main to initiate a CamelContext
> [INFO] Starting Camel ...
> 2014-11-06 19:26:34,698 [ing.Main.main()] INFO  MainSupport                   
>  - Apache Camel 2.15-SNAPSHOT starting
> 2014-11-06 19:26:34,780 [ing.Main.main()] INFO  
> ClassPathXmlApplicationContext - Refreshing 
> org.springframework.context.support.ClassPathXmlApplicationContext@4e01255e: 
> startup date [Thu Nov 06 19:26:34 CET 2014]; root of context hierarchy
> 2014-11-06 19:26:34,816 [ing.Main.main()] INFO  XmlBeanDefinitionReader       
>  - Loading XML bean definitions from file 
> [/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/target/classes/META-INF/spring/camel-context.xml]
> 2014-11-06 19:26:36,154 [ing.Main.main()] INFO  LocalEntityManagerFactoryBean 
>  - Building JPA EntityManagerFactory for persistence unit 'camel'
> 2014-11-06 19:26:36,642 [ing.Main.main()] INFO  SpringCamelContext            
>  - Apache Camel 2.15-SNAPSHOT (CamelContext: camel) is starting
> 2014-11-06 19:26:36,643 [ing.Main.main()] INFO  SpringCamelContext            
>  - Tracing is enabled on CamelContext: camel
> 2014-11-06 19:26:36,644 [ing.Main.main()] INFO  ManagedManagementStrategy     
>  - JMX is enabled
> 2014-11-06 19:26:36,833 [ing.Main.main()] INFO  DefaultTypeConverter          
>  - Loaded 181 type converters
> 2014-11-06 19:26:36,916 [ing.Main.main()] INFO  JpaComponent                  
>  - Using EntityManagerFactory configured: 
> org.springframework.orm.jpa.LocalEntityManagerFactoryBean@7e28ed26
> 2014-11-06 19:26:36,916 [ing.Main.main()] INFO  JpaComponent                  
>  - Using TransactionManager configured on this component: 
> org.springframework.orm.jpa.JpaTransactionManager@30e99a7f
> 2014-11-06 19:26:36,927 [ing.Main.main()] INFO  SpringCamelContext            
>  - 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.
> 2014-11-06 19:26:36,927 [ing.Main.main()] INFO  SpringCamelContext            
>  - 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
> 2014-11-06 19:26:36,930 [ing.Main.main()] INFO  FileEndpoint                  
>  - Endpoint is configured with noop=true so forcing endpoint to be idempotent 
> as well
> 2014-11-06 19:26:36,930 [ing.Main.main()] INFO  FileEndpoint                  
>  - Using default memory based idempotent repository with cache max size: 1000
> 2014-11-06 19:26:36,977 [ing.Main.main()] INFO  SpringCamelContext            
>  - Route: route1 started and consuming from: 
> Endpoint[file://src/data?noop=true]
> 583  camel  INFO   [org.apache.camel.spring.Main.main()] openjpa.Runtime - 
> Starting OpenJPA 2.3.0
> 694  camel  INFO   [org.apache.camel.spring.Main.main()] openjpa.jdbc.JDBC - 
> Using dictionary class "org.apache.openjpa.jdbc.sql.DerbyDictionary".
> 1172  camel  INFO   [org.apache.camel.spring.Main.main()] openjpa.jdbc.JDBC - 
> Connected to Apache Derby version 10.10 using JDBC driver Apache Derby 
> Embedded JDBC Driver version 10.10.2.0 - (1582446). 
> 2014-11-06 19:26:37,939 [ing.Main.main()] INFO  SpringCamelContext            
>  - Route: route2 started and consuming from: 
> Endpoint[jpa://org.apache.camel.example.etl.CustomerEntity?consumeDelete=false&consumeLockEntity=false&delay=3000]
> 2014-11-06 19:26:37,939 [ing.Main.main()] INFO  SpringCamelContext            
>  - Total 2 routes, of which 2 is started.
> 2014-11-06 19:26:37,940 [ing.Main.main()] INFO  SpringCamelContext            
>  - Apache Camel 2.15-SNAPSHOT (CamelContext: camel) started in 1.297 seconds
> 2014-11-06 19:26:37,994 [file://src/data] INFO  Tracer                        
>  - ID-cbox-local-49360-1415298395855-0-2 >>> (route1) 
> from(file://src/data?noop=true) --> 
> convertBodyTo[org.apache.camel.example.etl.PersonDocument] <<< 
> Pattern:InOnly, Headers:{CamelFileAbsolute=false, 
> breadcrumbId=ID-cbox-local-49360-1415298395855-0-1, 
> CamelFilePath=src/data/row1.xml, CamelFileNameOnly=row1.xml, 
> CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row1.xml,
>  CamelFileNameConsumed=row1.xml, CamelFileParent=src/data, 
> CamelFileLastModified=1411328048000, CamelFileName=row1.xml, 
> CamelFileRelativePath=row1.xml, CamelFileLength=155}, 
> BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file 
> based: GenericFile[row1.xml]]
> 2014-11-06 19:26:38,011 [file://src/data] INFO  StaxConverter                 
>  - Created XMLInputFactory: 
> com.sun.xml.internal.stream.XMLInputFactoryImpl@1f3b070c. DOMSource/DOMResult 
> may have issues with 
> com.sun.xml.internal.stream.XMLInputFactoryImpl@1f3b070c. We suggest using 
> Woodstox.
> 2014-11-06 19:26:38,036 [file://src/data] INFO  Tracer                        
>  - ID-cbox-local-49360-1415298395855-0-2 >>> (route1) 
> convertBodyTo[org.apache.camel.example.etl.PersonDocument] --> 
> jpa://org.apache.camel.example.etl.CustomerEntity <<< Pattern:InOnly, 
> Headers:{CamelFileRelativePath=row1.xml, CamelFileLength=155, 
> CamelFileParent=src/data, CamelFilePath=src/data/row1.xml, 
> CamelFileName=row1.xml, 
> CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row1.xml,
>  CamelFileAbsolute=false, breadcrumbId=ID-cbox-local-49360-1415298395855-0-1, 
> CamelFileLastModified=1411328048000, CamelFileNameConsumed=row1.xml, 
> CamelFileNameOnly=row1.xml}, 
> BodyType:org.apache.camel.example.etl.PersonDocument, Body:<?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
> 2014-11-06 19:26:38,061 [file://src/data] ERROR DefaultErrorHandler           
>  - Failed delivery for (MessageId: ID-cbox-local-49360-1415298395855-0-1 on 
> ExchangeId: ID-cbox-local-49360-1415298395855-0-2). Exhausted after delivery 
> attempt: 1 caught: org.apache.camel.InvalidPayloadRuntimeException: No body 
> available of type: org.apache.camel.example.etl.CustomerEntity but has value: 
> Person[user: james] of type: org.apache.camel.example.etl.PersonDocument on: 
> Message: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
> . Caused by: Error during type conversion from type: java.lang.String to the 
> required type: org.apache.camel.example.etl.CustomerEntity with value <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
>  due java.lang.NullPointerException on the exchange: Exchange[Message: <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
> ]
> Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId              ProcessorId          Processor                           
>                                              Elapsed (ms)
> [route1            ] [route1            ] [file://src/data?noop=true          
>                                            ] [        71]
> [route1            ] [convertBodyTo1    ] 
> [convertBodyTo[org.apache.camel.example.etl.PersonDocument]                   
>  ] [        30]
> [route1            ] [to1               ] 
> [jpa:org.apache.camel.example.etl.CustomerEntity                              
>  ] [        38]
> Exchange
> ---------------------------------------------------------------------------------------------------------------------------------------
> Exchange[
>       Id                  ID-cbox-local-49360-1415298395855-0-2
>       ExchangePattern     InOnly
>       Headers             
> {breadcrumbId=ID-cbox-local-49360-1415298395855-0-1, CamelFileAbsolute=false, 
> CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row1.xml,
>  CamelFileLastModified=1411328048000, CamelFileLength=155, 
> CamelFileName=row1.xml, CamelFileNameConsumed=row1.xml, 
> CamelFileNameOnly=row1.xml, CamelFileParent=src/data, 
> CamelFilePath=src/data/row1.xml, CamelFileRelativePath=row1.xml, 
> CamelRedelivered=false, CamelRedeliveryCounter=0}
>       BodyType            org.apache.camel.example.etl.PersonDocument
>       Body                <?xml version="1.0" encoding="UTF-8" 
> standalone="yes"?><person user="james">    <firstName>James</firstName>    
> <lastName>Strachan</lastName>    <city>London</city></person>
> ]
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> org.apache.camel.InvalidPayloadRuntimeException: No body available of type: 
> org.apache.camel.example.etl.CustomerEntity but has value: Person[user: 
> james] of type: org.apache.camel.example.etl.PersonDocument on: Message: 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
> . Caused by: Error during type conversion from type: java.lang.String to the 
> required type: org.apache.camel.example.etl.CustomerEntity with value <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
>  due java.lang.NullPointerException on the exchange: Exchange[Message: <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
> ]
>       at 
> org.apache.camel.component.jpa.JpaEndpoint$1.evaluate(JpaEndpoint.java:313)
>       at 
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)
>       at 
> org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:57)
>       at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>       at 
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:152)
>       at 
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:304)
>       at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:147)
>       at 
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>       at 
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
>       at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:425)
>       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.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433)
>       at 
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)
>       at 
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)
>       at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
>       at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.camel.TypeConversionException: Error during type 
> conversion from type: java.lang.String to the required type: 
> org.apache.camel.example.etl.CustomerEntity with value <?xml version="1.0" 
> encoding="UTF-8" standalone="yes"?>
> <person user="james">
>     <firstName>James</firstName>
>     <lastName>Strachan</lastName>
>     <city>London</city>
> </person>
>  due java.lang.NullPointerException
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:567)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:174)
>       at 
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)
>       at 
> org.apache.camel.component.jpa.JpaEndpoint$1.evaluate(JpaEndpoint.java:310)
>       ... 25 more
> Caused by: org.apache.camel.RuntimeCamelException: 
> java.lang.NullPointerException
>       at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1367)
>       at 
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1004)
>       at 
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:165)
>       ... 27 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.camel.example.etl.CustomerTransformer$1.doInTransaction(CustomerTransformer.java:76)
>       at 
> org.apache.camel.example.etl.CustomerTransformer$1.doInTransaction(CustomerTransformer.java:74)
>       at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
>       at 
> org.apache.camel.example.etl.CustomerTransformer.findCustomerByName(CustomerTransformer.java:74)
>       at 
> org.apache.camel.example.etl.CustomerTransformer.toCustomer(CustomerTransformer.java:58)
>       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.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1000)
>       ... 30 more
> 2014-11-06 19:26:38,065 [file://src/data] WARN  GenericFileOnCompletion       
>  - Rollback file strategy: 
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@43d027d5
>  for file: GenericFile[row1.xml]
> 2014-11-06 19:26:38,066 [file://src/data] INFO  Tracer                        
>  - ID-cbox-local-49360-1415298395855-0-4 >>> (route1) 
> from(file://src/data?noop=true) --> 
> convertBodyTo[org.apache.camel.example.etl.PersonDocument] <<< 
> Pattern:InOnly, 
> Headers:{CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row2.xml,
>  CamelFilePath=src/data/row2.xml, CamelFileNameOnly=row2.xml, 
> CamelFileLastModified=1411328048000, CamelFileNameConsumed=row2.xml, 
> breadcrumbId=ID-cbox-local-49360-1415298395855-0-3, CamelFileAbsolute=false, 
> CamelFileName=row2.xml, CamelFileParent=src/data, 
> CamelFileRelativePath=row2.xml, CamelFileLength=153}, 
> BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file 
> based: GenericFile[row2.xml]]
> 2014-11-06 19:26:38,068 [file://src/data] INFO  Tracer                        
>  - ID-cbox-local-49360-1415298395855-0-4 >>> (route1) 
> convertBodyTo[org.apache.camel.example.etl.PersonDocument] --> 
> jpa://org.apache.camel.example.etl.CustomerEntity <<< Pattern:InOnly, 
> Headers:{CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row2.xml,
>  breadcrumbId=ID-cbox-local-49360-1415298395855-0-3, 
> CamelFileParent=src/data, CamelFileNameConsumed=row2.xml, 
> CamelFileRelativePath=row2.xml, CamelFilePath=src/data/row2.xml, 
> CamelFileAbsolute=false, CamelFileName=row2.xml, CamelFileNameOnly=row2.xml, 
> CamelFileLength=153, CamelFileLastModified=1411328048000}, 
> BodyType:org.apache.camel.example.etl.PersonDocument, Body:<?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
> 2014-11-06 19:26:38,073 [file://src/data] ERROR DefaultErrorHandler           
>  - Failed delivery for (MessageId: ID-cbox-local-49360-1415298395855-0-3 on 
> ExchangeId: ID-cbox-local-49360-1415298395855-0-4). Exhausted after delivery 
> attempt: 1 caught: org.apache.camel.InvalidPayloadRuntimeException: No body 
> available of type: org.apache.camel.example.etl.CustomerEntity but has value: 
> Person[user: hiram] of type: org.apache.camel.example.etl.PersonDocument on: 
> Message: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
> . Caused by: Error during type conversion from type: java.lang.String to the 
> required type: org.apache.camel.example.etl.CustomerEntity with value <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
>  due java.lang.NullPointerException on the exchange: Exchange[Message: <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
> ]
> Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId              ProcessorId          Processor                           
>                                              Elapsed (ms)
> [route1            ] [route1            ] [file://src/data?noop=true          
>                                            ] [         6]
> [route1            ] [convertBodyTo1    ] 
> [convertBodyTo[org.apache.camel.example.etl.PersonDocument]                   
>  ] [         1]
> [route1            ] [to1               ] 
> [jpa:org.apache.camel.example.etl.CustomerEntity                              
>  ] [         5]
> Exchange
> ---------------------------------------------------------------------------------------------------------------------------------------
> Exchange[
>       Id                  ID-cbox-local-49360-1415298395855-0-4
>       ExchangePattern     InOnly
>       Headers             
> {breadcrumbId=ID-cbox-local-49360-1415298395855-0-3, CamelFileAbsolute=false, 
> CamelFileAbsolutePath=/Users/bvahdat/dev/workspace/camel/examples/camel-example-etl/src/data/row2.xml,
>  CamelFileLastModified=1411328048000, CamelFileLength=153, 
> CamelFileName=row2.xml, CamelFileNameConsumed=row2.xml, 
> CamelFileNameOnly=row2.xml, CamelFileParent=src/data, 
> CamelFilePath=src/data/row2.xml, CamelFileRelativePath=row2.xml, 
> CamelRedelivered=false, CamelRedeliveryCounter=0}
>       BodyType            org.apache.camel.example.etl.PersonDocument
>       Body                <?xml version="1.0" encoding="UTF-8" 
> standalone="yes"?><person user="hiram">    <firstName>Hiram</firstName>    
> <lastName>Chirino</lastName>    <city>Tampa</city></person>
> ]
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> org.apache.camel.InvalidPayloadRuntimeException: No body available of type: 
> org.apache.camel.example.etl.CustomerEntity but has value: Person[user: 
> hiram] of type: org.apache.camel.example.etl.PersonDocument on: Message: 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
> . Caused by: Error during type conversion from type: java.lang.String to the 
> required type: org.apache.camel.example.etl.CustomerEntity with value <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
>  due java.lang.NullPointerException on the exchange: Exchange[Message: <?xml 
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
> ]
>       at 
> org.apache.camel.component.jpa.JpaEndpoint$1.evaluate(JpaEndpoint.java:313)
>       at 
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)
>       at 
> org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:57)
>       at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>       at 
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:152)
>       at 
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:304)
>       at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:147)
>       at 
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>       at 
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
>       at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:425)
>       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.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433)
>       at 
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)
>       at 
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)
>       at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
>       at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.camel.TypeConversionException: Error during type 
> conversion from type: java.lang.String to the required type: 
> org.apache.camel.example.etl.CustomerEntity with value <?xml version="1.0" 
> encoding="UTF-8" standalone="yes"?>
> <person user="hiram">
>     <firstName>Hiram</firstName>
>     <lastName>Chirino</lastName>
>     <city>Tampa</city>
> </person>
>  due java.lang.NullPointerException
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:567)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:174)
>       at 
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)
>       at 
> org.apache.camel.component.jpa.JpaEndpoint$1.evaluate(JpaEndpoint.java:310)
>       ... 25 more
> Caused by: org.apache.camel.RuntimeCamelException: 
> java.lang.NullPointerException
>       at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1367)
>       at 
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1004)
>       at 
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
>       at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:165)
>       ... 27 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.camel.example.etl.CustomerTransformer$1.doInTransaction(CustomerTransformer.java:76)
>       at 
> org.apache.camel.example.etl.CustomerTransformer$1.doInTransaction(CustomerTransformer.java:74)
>       at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
>       at 
> org.apache.camel.example.etl.CustomerTransformer.findCustomerByName(CustomerTransformer.java:74)
>       at 
> org.apache.camel.example.etl.CustomerTransformer.toCustomer(CustomerTransformer.java:58)
>       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.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1000)
>       ... 30 more
> 2014-11-06 19:26:38,074 [file://src/data] WARN  GenericFileOnCompletion       
>  - Rollback file strategy: 
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@43d027d5
>  for file: GenericFile[row2.xml]
> 1897  camel  TRACE  [Camel (camel) thread #1 - 
> jpa://org.apache.camel.example.etl.CustomerEntity] openjpa.jdbc.SQL - <t 
> 552944470, conn 1175966721> executing prepstmnt 2111506687 
> SELECT t0.id, t0.city, t0.firstName, t0.phone, t0.street, t0.surname, 
>         t0.userName, t0.zip 
>     FROM customer t0 
> 1898  camel  TRACE  [Camel (camel) thread #1 - 
> jpa://org.apache.camel.example.etl.CustomerEntity] openjpa.jdbc.SQL - <t 
> 552944470, conn 1175966721> [1 ms] spent
> ^C2014-11-06 19:26:38,555 [Thread-1       ] INFO  
> MainSupport$HangupInterceptor  - Received hang up - stopping the main 
> instance.
> 2014-11-06 19:26:38,555 [Thread-1       ] INFO  MainSupport                   
>  - Apache Camel 2.15-SNAPSHOT stopping
> 2014-11-06 19:26:38,555 [Thread-1       ] INFO  
> ClassPathXmlApplicationContext - Closing 
> org.springframework.context.support.ClassPathXmlApplicationContext@4e01255e: 
> startup date [Thu Nov 06 19:26:34 CET 2014]; root of context hierarchy
> 2014-11-06 19:26:38,556 [Thread-1       ] INFO  SpringCamelContext            
>  - Apache Camel 2.15-SNAPSHOT (CamelContext: camel) is shutting down
> 2014-11-06 19:26:38,556 [Thread-1       ] INFO  DefaultShutdownStrategy       
>  - Starting to graceful shutdown 2 routes (timeout 300 seconds)
> 2014-11-06 19:26:38,559 [ - ShutdownTask] INFO  DefaultShutdownStrategy       
>  - Route: route2 shutdown complete, was consuming from: 
> Endpoint[jpa://org.apache.camel.example.etl.CustomerEntity?consumeDelete=false&consumeLockEntity=false&delay=3000]
> 2014-11-06 19:26:38,559 [ - ShutdownTask] INFO  DefaultShutdownStrategy       
>  - Route: route1 shutdown complete, was consuming from: 
> Endpoint[file://src/data?noop=true]
> 2014-11-06 19:26:38,559 [Thread-1       ] INFO  DefaultShutdownStrategy       
>  - Graceful shutdown of 2 routes completed in 0 seconds
> 2014-11-06 19:26:38,575 [Thread-1       ] INFO  SpringCamelContext            
>  - Apache Camel 2.15-SNAPSHOT (CamelContext: camel) uptime 1.933 seconds
> 2014-11-06 19:26:38,575 [Thread-1       ] INFO  SpringCamelContext            
>  - Apache Camel 2.15-SNAPSHOT (CamelContext: camel) is shutdown in 0.019 
> seconds
> 2014-11-06 19:26:38,577 [Thread-1       ] INFO  LocalEntityManagerFactoryBean 
>  - Closing JPA EntityManagerFactory for persistence unit 'camel'
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to