Alessandro Baldoni created CAMEL-6798:
-----------------------------------------

             Summary: JPAComponent: method findByTypeWithName in JNDIRegistry 
is unimplemented
                 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.1, 2.12.0
            Reporter: Alessandro Baldoni


The method findByTypeWithName in JNDIRegistry is unimplemented (returns a null 
map).
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<String, EntityManagerFactory> map = 
getCamelContext().getRegistry().findByTypeWithName(EntityManagerFactory.class);

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)

Reply via email to