我有两个库项目,它们是我的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"/>