Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Cannot find entities classes when packaged in another bundle than bundle containing persistence.xml
Cannot find entities classes when packaged in another bundle than bundle containing persistence.xml [message #504299] Fri, 18 December 2009 08:25
cmoulliard  is currently offline cmoulliard Friend
Messages: 2
Registered: December 2009
Junior Member
EclipseLink (probably javax.persistence package) cannot find entities classes when they are packages in a separate bundle than the bundle containing the persistence.xml

Remarks :
-They are no conflicts between the two bundles as the packages are well exported and imported
- JDK : 6
- Platform : Apache Felix Karaf 1.2.0 running Felix 2.0.1

Here is the spring / persistence config files
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
        http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

        <persistence-unit name="report" transaction-type="RESOURCE_LOCAL">
       
  <class>org.apache.camel.example.reportincident.restful.ReportIncidentEntity</class>
                <class>org.apache.camel.example.reportincident.restful.DetailEntity</class>

                <!-- Eclipse & Derby -->
                <properties>
                <properties>
                        <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
                        <property name="javax.persistence.jdbc.url"
                                value="jdbc:derby://localhost:1527/report;create=true" />
                        <property name="javax.persistence.jdbc.user" value="sa" />
                        <property name="javax.persistence.jdbc.password" value="" />

                        <property name="eclipselink.logging.file" value="data/eclipsejpa/camel-example-report.log" />
                        <property name="eclipselink.logging.level" value="FINEST" />
                        <property name="eclipselink.logging.logger" value="org.eclipse.persistence.logging.DefaultSessionLog" />
                        <property name="eclipselink.logging.thread" value="true" />
                        <property name="eclipselink.logging.session" value="true" />
                        <property name="eclipselink.logging.exceptions" value="true" />
                </properties>
        </persistence-unit>
</persistence>


and spring file

    <context:load-time-weaver weaver-class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>

        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
                <property name="persistenceUnitName" value="report"/>
                <!-- <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> -->
            <!-- <property name="dataSource" ref="dataSource" /> -->
                <property name="jpaVendorAdapter" ref="jpaAdapter" />
        </bean>

        <!-- TransactionManager -->
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
                <property name="entityManagerFactory" ref="entityManagerFactory" />
        </bean>

        <!-- EclipseLink adapter -->
        <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
                <property name="databasePlatform" value="org.eclipse.persistence.platform.database.DerbyPlatform" />
        </bean>


Regards,

Charles
Charles Moulliard
SOA Architect
Previous Topic:FetchGroup help
Next Topic:Deadlock in cache under load
Goto Forum:
  


Current Time: Fri Nov 28 07:16:53 GMT 2014

Powered by FUDForum. Page generated in 0.02453 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software