Spring Data Neo4j - 不能继承最终类com.sun.proxy。$ Proxy76

时间:2014-07-16 21:03:23

标签: spring spring-data-jpa spring-data-neo4j

我有两个库项目,它们是我的Web项目的依赖项。在其中一个库项目中,我正在使用Spring Data JPA和另一个库项目,我正在使用Spring Data Neo4j。当我尝试启动我的网络项目并尝试自动装配GraphRepository时,我得到:

Caused by: java.lang.IllegalArgumentException: Cannot subclass final class class com.sun.proxy.$Proxy76

以下是我的xml文件

jpa.xml

<jpa:repositories base-package="com.mypackage.commons" />

<bean id="jpaVendorAdapter"
    class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    <property name="showSql" value="true" />
    <property name="generateDdl" value="true" />
    <property name="database" value="MYSQL" />
</bean>

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="jdbcDataSource" />
    <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
    <property name="packagesToScan" value="com.mypackage.commons" />
</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" />

<tx:annotation-driven proxy-target-class="true" />

neo4j.xml

<neo4j:config graphDatabaseService="graphDatabaseService"
    base-package="com.mypackage.neo4j" />

<bean id="graphDatabaseService"
    class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
    <constructor-arg type="java.lang.String">
            <value>http://localhost:7474/db/data/</value>
    </constructor-arg>
</bean>

<neo4j:repositories base-package="com.mypackage.neo4j"/>

0 个答案:

没有答案