Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F7B210216 for ; Sat, 25 Jan 2014 16:36:03 +0000 (UTC) Received: (qmail 30049 invoked by uid 500); 25 Jan 2014 16:36:02 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 30021 invoked by uid 500); 25 Jan 2014 16:36:01 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 25253 invoked by uid 99); 24 Jan 2014 15:30:45 -0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Date: Fri, 24 Jan 2014 07:30:19 -0800 (PST) From: Sebarry To: users@camel.apache.org Message-ID: <1390577419856-5746449.post@n5.nabble.com> Subject: Camel JPA - No Persistence provider for EntityManager named camel MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am trying to get the following code to work so I can consume from a JPA entity. String DATASOURCE_CONTEXT = "java:jboss/datasources/WikiDS"; Connection result = null; DataSource datasource = null; try { Context initialContext = new InitialContext(); datasource = (DataSource)initialContext.lookup(DATASOURCE_CONTEXT); if (datasource == null) { System.out.println("Data source is null"); } else { System.out.println("Data source is OK!!!"); } } catch(NamingException ex) { System.out.println("Naming exception is: " + ex.getMessage()); } SimpleRegistry reg = new SimpleRegistry() ; reg.put("myDataSource",datasource); CamelContext context = new DefaultCamelContext(reg); ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); context.addRoutes(new RouteBuilder() { public void configure() { from("jpa://org.apache.camel.example.jmstofile?consumer.namedQuery=step1&consumeDelete=false").to("file://test"); } }); ProducerTemplate template = context.createProducerTemplate(); context.start(); Whatever I do I get the following exception. [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:java (default-cli) on project camel-example-jms-file: An exception occured while executing the Java class. null: InvocationTargetException: No Persistence provider for EntityManager named camel. Any ideas how to fix this? Regards, Sean -- View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-No-Persistence-provider-for-EntityManager-named-camel-tp5746449.html Sent from the Camel - Users mailing list archive at Nabble.com.