Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F28E510335 for ; Sun, 29 Sep 2013 09:57:35 +0000 (UTC) Received: (qmail 16692 invoked by uid 500); 29 Sep 2013 09:57:31 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 16673 invoked by uid 500); 29 Sep 2013 09:57:28 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 16658 invoked by uid 99); 29 Sep 2013 09:57:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Sep 2013 09:57:24 +0000 Date: Sun, 29 Sep 2013 09:57:24 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CAMEL-6798) JPAComponent: unable to find EntityManagerFactory in JNDIRegistry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-6798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-6798. -------------------------------- Resolution: Duplicate Assignee: Claus Ibsen There is another JIRA about JNDIRegistry should be improved to implement these methods also. > JPAComponent: unable to find EntityManagerFactory in JNDIRegistry > ----------------------------------------------------------------- > > Key: CAMEL-6798 > URL: https://issues.apache.org/jira/browse/CAMEL-6798 > Project: Camel > Issue Type: Bug > Components: camel-core, camel-jpa > Affects Versions: 2.12.0, 2.12.1 > Reporter: Alessandro Baldoni > Assignee: Claus Ibsen > > When using a JNDIRegistry in a Camel context to make a JPA EntityManagerFactory available to a JPAComponent (required when running Camel in a Java EE container), the JPAComponent is unable to find it due do this line: > Map map = getCamelContext().getRegistry().findByTypeWithName(EntityManagerFactory.class); > since the method findByTypeWithName in JNDIRegistry is unimplemented (returns a null map). > This forces to fallback to a SimpleRegistry or to a Spring registry, thus making impossible to use the JAVA EE container JNDI registry. > Proposted solution: At present, JNDI does not allow lookups based on a class. > My suggestion is to lookup the EntityManagerFactory by a standard name, such as when looking for the default persistence unit name (and eventually adding a property for the JPA URL in order to use a custom name). -- This message was sent by Atlassian JIRA (v6.1#6144)