You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "jamesnetherton (via GitHub)" <gi...@apache.org> on 2025/05/16 14:42:37 UTC

[I] JPA endpoints throw CNFE if an EntityManageFactory cannot be resolved [camel-quarkus]

jamesnetherton opened a new issue, #7369:
URL: https://github.com/apache/camel-quarkus/issues/7369

   ### Bug description
   
   If no `EntityManagerFactory` could be resolved, the JPA component attempts to create its own via `LocalEntityManagerFactoryBean`. However, we exclude `spring-orm`, so this cannot work.
   
   I am planning to work around this in https://github.com/apache/camel-quarkus/issues/7315.
   
   But we need a more robust permanent solution where we can override `JpaEndpoint.createEntityManagerFactory` and throw an exception.
   
   ```
   Caused by: java.lang.NoClassDefFoundError: org/springframework/orm/jpa/LocalEntityManagerFactoryBean
       at org.apache.camel.component.jpa.JpaEndpoint.createEntityManagerFactory(JpaEndpoint.java:572)
       at org.apache.camel.component.jpa.JpaEndpoint.getEntityManagerFactory(JpaEndpoint.java:238)
       at org.apache.camel.quarkus.component.jpa.it.JpaResource.createJpaEndpoint(JpaResource.java:152)
       at java.base/java.lang.reflect.Method.invoke(Method.java:580)
       at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:154)
       at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:118)
       at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:560)
       at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:452)
       at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:413)
       at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:321)
       at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:415)
       at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:378)
       at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:356)
       at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:70)
       at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:429)
       ... 17 more
   Caused by: java.lang.ClassNotFoundException: org.springframework.orm.jpa.LocalEntityManagerFactoryBean
       at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
       at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
       at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:576)
       at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:523)
       ... 32 more
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org