camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Babak Vahdat (JIRA)" <>
Subject [jira] [Commented] (CAMEL-5044) Use the openjpa-maven-plugin instead of maven-antrun-plugin to enhance the JPA entities for OpenJPA
Date Mon, 14 May 2012 14:11:51 GMT


Babak Vahdat commented on CAMEL-5044:

This fix has broken the functionality of camel-example-tracer as now while executing "mvn
camel:run" by this example the VM *exits* and beyond others we get the following stacktrace
on the console:

Caused by: java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(
        at org.hibernate.util.ReflectHelper.classForName(
        at org.hibernate.ejb.Ejb3Configuration.classForName(
        at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(
        at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(
        at org.hibernate.ejb.Ejb3Configuration.configure(
        at org.hibernate.ejb.Ejb3Configuration.configure(
        at org.hibernate.ejb.Ejb3Configuration.configure(
        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(
        at javax.persistence.Persistence.createEntityManagerFactory(
        at org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(

Reverting back the POM of camel-jpa to revision 1234937, and doing a "mvn clean install" on
it would resolve the problem by the example mentioned. The behaviour is obvious: The byte
code has been contaminated with the class name "org.apache.openjpa.enhance.PersistenceCapable"
(not being on the classpath) while we do make use of the JPA provider hibernate-entity-manager!

Probably I miss something here but I don't see *any* good reason to do JPA bytecode enhancement
at *build* time, so why I think we should completely remove/avoid this, reason: the same that
today happens for the Camel's own example could happen by a Camel powered Application using
camel-jpa who as an example uses Eclipselink as it's JPA-Provider. BTW apparently in the meanwhile
*even* OpenJPA can enhance the byte code at runtime:

All in one, to my understanding this code enhancement at the build time does make camel-jpa
component as OpenJPA *specific*. We could also put a question on the Dev-Forum to ask others
for any good reasons to do enhance bytecode by camel-jpa *specific for OpenJPA*.

> Use the openjpa-maven-plugin instead of maven-antrun-plugin to enhance the JPA entities
for OpenJPA
> ---------------------------------------------------------------------------------------------------
>                 Key: CAMEL-5044
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jpa
>    Affects Versions: 2.9.0
>            Reporter: Christian Müller
>            Assignee: Christian Müller
>            Priority: Minor
>             Fix For: 2.10.0

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message