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);
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).