I am new to apache camel and I am testing camel-jpa to poll from table and display records
Following is main class EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("LoanServicePU"); CamelContext camelContext = new DefaultCamelContext(); JpaComponent jpa = new JpaComponent(); jpa.setEntityManagerFactory(entityManagerFactory); JpaTransactionManager myTM=new JpaTransactionManager(); myTM.setEntityManagerFactory(entityManagerFactory); jpa.setTransactionManager( myTM ); jpa.setCamelContext(camelContext); camelContext.addRoutes(new JpaRouteBuilder()); camelContext.addComponent("jpa",jpa); camelContext.start(); Thread.sleep(10000); camelContext.stop(); System.out.println("Done"); Following is jparouter class public void configure() throws Exception { from("jpa://com.pns.ab.model.LoanRequest?consumeDelete=false;" + "consumer.delay=2000;maxMessagesPerPoll=1000;" + "consumer.namedQuery=selectLoanRequests").to("stream:out"); } I configured persistence.xml and its under META-INF, in fact in eclipse I start Java Project and then set JPA facet But I am getting following error: [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.12.3 (CamelContext: camel-1) started in 1.426 seconds [Camel (camel-1) thread #0 - jpa://com.pns.ab.model.LoanRequest] WARN org.apache.camel.component.jpa.JpaConsumer - Consumer Consumer[jpa://com.pns.ab.model.LoanRequest?consumeDelete=false%3Bconsumer.delay%3D2000&consumer.namedQuery=selectLoanRequests] failed polling endpoint: Endpoint[jpa://com.pns.ab.model.LoanRequest?consumeDelete=false%3Bconsumer.delay%3D2000&consumer.namedQuery=selectLoanRequests]. Will try again at next poll. Caused by: [javax.persistence.TransactionRequiredException - joinTransaction has been called on a resource-local EntityManager which is unable to register for a JTA transaction.] javax.persistence.TransactionRequiredException: joinTransaction has been called on a resource-local EntityManager which is unable to register for a JTA transaction. at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper.registerIfRequired(EntityTransactionWrapper.java:91) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.joinTransaction(EntityMa -- View this message in context: http://camel.465427.n5.nabble.com/joinTransaction-has-been-called-on-a-resource-local-EntityManager-in-ApacheCamel-tp5748062.html Sent from the Camel - Users mailing list archive at Nabble.com.