Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] EclipseLink & Spring

Looks like PersistenceAnnotationBeanPostProcessor is not able to inject em in the DAO or it's really not getting called to post process the beans. I would try to debug in the spring code ( for PersistenceAnnotationBeanPostProcessor ) if possible and see what is being done there. Also check the spring log to check what PersistenceAnnotationBeanPostProcessor has to say. With the configuration you have pasted below, it should have worked w/o any issues.


-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of RogerV
Sent: Monday, April 26, 2010 12:24 PM
To: eclipselink-users@xxxxxxxxxxx
Subject: RE: [eclipselink-users] EclipseLink & Spring


Thanks for that. This is what I've got at the moment. Everything starts up
but I'm not getting the EntityManager injected into my Dao classes using

@PersistenceContext
    private EntityManager em;

Trying to access the entityManger results in a Null Pointer Exception. What
am I still missing?

Regards

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="persistenceUnitName"
            value="Genesis" />
    <property name="jpaVendorAdapter">
      <bean
class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
        <property name="showSql" value="true"/>
        <property name="generateDdl" value="true"/>
        <property name="databasePlatform"
value="org.eclipse.persistence.platform.database.MySQLPlatform"/>
      </bean>
    </property>
  </bean>

  <bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://localhost:3306/genesis"/>
    <property name="username" value="userId"/>
    <property name="password" value="password"/>
  </bean>

<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>



--
View this message in context: http://old.nabble.com/EclipseLink---Spring-tp28349408p28361434.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top