0
votes

I'm trying to migrate an SDN project from the current stable version (2.3.3) to the 3.0.0 RC1 version wich supports Neo4j 2.0. The project is a WAR which is deployed on a Glassfish 3.1.2.2 server and uses EJBs which access Neo4j via @Autowired Neo4jOperations object and GraphRepository<T> objects. The auto wiring is supported using the SpringBeanAutowiringInterceptor interceptor annotation. The SDN configuration is given by the following lines in the spring xml configuration file:

<context:annotation-config/>
<context:spring-configured/>
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
    <constructor-arg index="0" value="my.db"/>
</bean>
<neo4j:repositories base-package="com.my.neo4j.repository"/>
<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>
<neo4j:config graphDatabaseService="graphDatabaseService"/>

Everything works fine when using the 2.3.3 SDN version, but unfortunately using the 3.0.0 RC1 gives the following error while deploying:

javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]. at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107) at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82) ...

I really have no idea about what's wrong with my project, I would be grateful to anyone that could help me in solving this issue.

UPDATE: Same issue with the 3.0.0.RELEASE.

1
Any solution yet? I am having the same problem, if I introduce a repository which extends "GraphRepository".Markus Schulte
@MarcusSchultö It's been solved in the current version 3.2.0.remigio

1 Answers

0
votes

There is no constructor for EmbeddedGraphDatabase anymore.

You have to use the GraphDatabaseServiceFactoryBean that I added instead.

<bean id="graphDatabaseService" class="org.springframework.data.neo4j.support.GraphDatabaseServiceFactoryBean"
        destroy-method="shutdown" scope="singleton">
    <constructor-arg value="target/config-test"/>
    <constructor-arg>
        <map>
            <entry key="allow_store_upgrade" value="true"/>
        </map>
    </constructor-arg>
</bean>