当前位置: 首页 > 知识库问答 >
问题:

无法解析对bean“neo4j template”的引用

阎鸿煊
2023-03-14

我尝试将我的应用程序配置为使用Spring数据 neo4j 。

但是当我提交我的应用程序时,我得到了这个堆栈跟踪跟踪:

SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property 'neo4jTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\String\sts-3.5.1.RELEASE\target\mydata
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4961)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5455)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:634)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:671)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1840)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\String\sts-3.5.1.RELEASE\target\mydata
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1055)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:951)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)
    ... 29 more

这是我的UserRepository:

public interface UserRepository extends GraphRepository<User>,
        RelationshipOperationsRepository<User> {



    public User findByEmail(String email);

    public User findByEmailAndPassword(String email, String password);

    public User findByLogin(String login);

    @Query("start user=node({0}) Match user-[:FRIEND]->(friends) return friends")
    public Set<User> findFriends(User user);

    @Query("start user=node({0}) Match user<-[:FRIEND]-(friends) return count(friends)")
    public int countFollowers(User u);


    /**
     * 
     * @param user
     * @param companyName
     * @return number of Confirmed offers
     */

    @Query("start user=node({0})"
            + " Match (user)-[:ADHERE_TO]->(offer)<-[:PROPOSE]-(c:Company)"
            + "where c.name = {1}"
            + "return count (offer)")
    public int countConfirmedOffersByCompany(User user, String companyName);



}

这是我的porm.xml

http://maven.apache.org/maven-v4_0_0.xsd"

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <spring.core.version>3.2.5.RELEASE</spring.core.version>
    <spring.data.neo4j.version>3.1.0.RELEASE</spring.data.neo4j.version>

    <neo4j.kernel.version>2.1.2</neo4j.kernel.version>
    <neo4j.cypher.version>1.6</neo4j.cypher.version>
    <neo4j.cypher.dsl.version>1.6</neo4j.cypher.dsl.version>

    <hibernate.validator.version>4.1.0.Final</hibernate.validator.version>
    <scala.library.version>2.9.0-1</scala.library.version>

    <cglib.version>2.2</cglib.version>
    <aspectj.version>1.6.10</aspectj.version>

    <slf4j.version>1.6.1</slf4j.version>
    <log4j.version>1.2.14</log4j.version>

    <javax.servlet-api.version>2.5</javax.servlet-api.version>
    <javax.jstl-taglibs.version>1.1.2</javax.jstl-taglibs.version>
    <jackson.version>1.9.3</jackson.version>



    <!-- Testing -->
    <mockito.version>1.8.5</mockito.version>
    <junit.version>4.8.2</junit.version>

    <!-- Plugins -->
    <maven.compiler.plugin.version>2.3.2</maven.compiler.plugin.version>
    <maven.apt.plugin.version>1.0</maven.apt.plugin.version>
</properties>

<dependencies>

    <!-- Spring Core -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.core.version}</version>
        <exclusions>
            <!-- Exclude Commons Logging in favor of SLF4j -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.core.version}</version>
    </dependency>

    <!-- A seamless aspect-oriented extension to the Java programming language -->
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>${aspectj.version}</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>${aspectj.version}</version>
    </dependency>

    <!-- Cglib is a powerful, high performance and quality Code Generation 
        Library, It is used to extend JAVA classes and implements interfaces at runtime. -->
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>${cglib.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- The JavaServer Pages Standard Tag Library (JSTL) encapsulates, as 
        simple tags, core functionality common to many JSP applications. -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>${javax.jstl-taglibs.version}</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>${javax.jstl-taglibs.version}</version>
    </dependency>

    <!-- Data Mapper package is a high-performance data binding package built 
        on Jackson JSON processor -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>${jackson.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Jackson is a high-performance JSON processor (parser, generator) -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>${jackson.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Logger -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- The Simple Logging Facade for Java or (SLF4J) serves as a simple facade 
        or abstraction for various logging frameworks, e.g. java.util.logging, log4j 
        and logback, allowing the end user to plug in the desired logging framework 
        at deployment time. -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Spring Data Neo4j -->
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-neo4j</artifactId>
        <version>${spring.data.neo4j.version}</version>
        <exclusions>
            <exclusion>
                <artifactId>neo4j</artifactId>
                <groupId>org.neo4j</groupId>
            </exclusion>
            <exclusion>
                <artifactId>neo4j-cypher-dsl</artifactId>
                <groupId>org.neo4j</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-kernel</artifactId>
        <version>${neo4j.kernel.version}</version>
    </dependency>

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-cypher</artifactId>
        <version>${neo4j.cypher.version}</version>
    </dependency>

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-cypher-dsl</artifactId>
        <version>${neo4j.cypher.dsl.version}</version>
    </dependency>

    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.library.version}</version>
    </dependency>

    <!-- Hibernate Validator -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${hibernate.validator.version}</version>
    </dependency>

    <!-- Javax Servlet. This needs to be included for runtime only! -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>${javax.servlet-api.version}</version>
        <scope>provided</scope>
    </dependency>

    <!-- Testing dependencies -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>

</dependencies>

<build>
    <finalName>spring-neo4j-tutorial</finalName>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>

    <!-- For main Spring releases -->
    <repository>
        <id>org.springframework.maven.release</id>
        <name>Spring Maven Release Repository</name>
        <url>http://maven.springframework.org/release</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <!-- For testing against latest Spring snapshots -->
    <repository>
        <id>org.springframework.maven.snapshot</id>
        <name>Spring Maven Snapshot Repository</name>
        <url>http://maven.springframework.org/snapshot</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>

    <!-- For developing against latest Spring milestones -->
    <repository>
        <id>org.springframework.maven.milestone</id>
        <name>Spring Maven Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

</repositories>

共有3个答案

杜绍元
2023-03-14

我遇到了一个类似的错误,花了一些时间才发现问题出在属性文件中。

当你使用sdn-rx时,你不能使用spring.data属性,所以它会出现。相反:

org:
  neo4j:
    driver:
      uri: bolt://localhost:7687
      authentication:
        username: neo4j
        password: secret
瞿健
2023-03-14

我通过将porm.xml中的version元素从“1.0.0-BUILD-SNAPSHOT”更改为0.0.1解决了这个问题,但我不明白到底发生了什么,因为我不熟悉maven,但我认为当我更改version元素时,已经下载了一些jar。

这是我的色情片.xml如果你想使用它:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ofamy</groupId>
<artifactId>ofamy-project</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<name>ofamy-project</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <spring.core.version>4.0.6.RELEASE</spring.core.version>

    <spring-data-neo4j.version>3.1.2.RELEASE</spring-data-neo4j.version>
    <neo4j.version>2.1.3</neo4j.version>
    <junit.version>4.11</junit.version>
    <hibernate-validator.version>5.1.2.Final</hibernate-validator.version>

    <scala.library.version>2.10.3</scala.library.version>

    <cglib.version>2.2</cglib.version>
    <aspectj.version>1.6.10</aspectj.version>

    <slf4j.version>1.7.5</slf4j.version>
    <log4j.version>1.2.17</log4j.version>

    <javax.servlet-api.version>2.5</javax.servlet-api.version>
    <javax.jstl-taglibs.version>1.1.2</javax.jstl-taglibs.version>
    <jackson.version>1.9.3</jackson.version>

    <spring.social.core.version>1.1.0.RELEASE</spring.social.core.version>
    <spring.social.web.version>1.1.0.RELEASE</spring.social.web.version>
    <spring.social.facebook.version>1.1.1.RELEASE</spring.social.facebook.version>

    <spring.security.core.version>3.2.4.RELEASE</spring.security.core.version>
    <spring.security.config.version>3.2.4.RELEASE</spring.security.config.version>
    <spring.security.web.version>3.2.4.RELEASE</spring.security.web.version>

    <!-- Testing -->
    <mockito.version>1.8.5</mockito.version>
    <junit.version>4.8.2</junit.version>

    <!-- Plugins -->
    <maven.compiler.plugin.version>2.3.2</maven.compiler.plugin.version>
    <maven.apt.plugin.version>1.0</maven.apt.plugin.version>
</properties>

<dependencies>

    <!-- integration -->
    <dependency>
        <groupId>com.yammer.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>2.2.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.9.3</version>
    </dependency>

    <dependency>
        <groupId>net.spy</groupId>
        <artifactId>spymemcached</artifactId>
        <version>2.11.2</version>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>17.0</version>
    </dependency>

    <dependency>
        <groupId>net.wimpi</groupId>
        <artifactId>telnetd-x</artifactId>
        <version>2.1.1</version>
    </dependency>

    <dependency>
        <groupId>net.wimpi</groupId>
        <artifactId>jamod</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.4</version>
    </dependency>


    <!-- Spring Social -->

    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-core</artifactId>
        <version>${spring.social.core.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-web</artifactId>
        <version>${spring.social.web.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-facebook</artifactId>
        <version>${spring.social.facebook.version}</version>
    </dependency>
    <!-- Spring Security -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>${spring.security.core.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${spring.security.config.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${spring.security.web.version}</version>
    </dependency>


    <!-- mail -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>

    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1</version>
    </dependency>
    <!-- Spring Core -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.core.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.core.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.core.version}</version>
        <exclusions>
            <!-- Exclude Commons Logging in favor of SLF4j -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.core.version}</version>
    </dependency>

    <!-- A seamless aspect-oriented extension to the Java programming language -->
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>${aspectj.version}</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>${aspectj.version}</version>
    </dependency>

    <!-- Cglib is a powerful, high performance and quality Code Generation 
        Library, It is used to extend JAVA classes and implements interfaces at runtime. -->
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>${cglib.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- The JavaServer Pages Standard Tag Library (JSTL) encapsulates, as 
        simple tags, core functionality common to many JSP applications. -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>${javax.jstl-taglibs.version}</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>${javax.jstl-taglibs.version}</version>
    </dependency>

    <!-- Data Mapper package is a high-performance data binding package built 
        on Jackson JSON processor -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>${jackson.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Jackson is a high-performance JSON processor (parser, generator) -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>${jackson.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Logger -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- The Simple Logging Facade for Java or (SLF4J) serves as a simple facade 
        or abstraction for various logging frameworks, e.g. java.util.logging, log4j 
        and logback, allowing the end user to plug in the desired logging framework 
        at deployment time. -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

    <!-- Spring Data Neo4j -->
    <!-- SDN for simple mapping mode -->
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-neo4j</artifactId>
        <version>${spring-data-neo4j.version}</version>
    </dependency>

    <!-- Hibernate implementation of the JSR-303 Bean Validation Spec API. 
        (SDN makes use of the javax.validation:validation-api dependency and hibernate 
        provides a concrete implementation -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${hibernate-validator.version}</version>
    </dependency>

    <!-- TEST dependencies -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-kernel</artifactId>
        <version>${neo4j.version}</version>
        <type>test-jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-cypher</artifactId>
        <version>${neo4j.version}</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.library.version}</version>
    </dependency>

    <!-- Hibernate Validator -->


    <!-- Javax Servlet. This needs to be included for runtime only! -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>${javax.servlet-api.version}</version>
        <scope>provided</scope>
    </dependency>

    <!-- Testing dependencies -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.core.version}</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.7</version>
    </dependency>

    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-client</artifactId>
        <version>5.9.1</version>
    </dependency>
</dependencies>

<build>
    <finalName>spring-neo4j-tutorial</finalName>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-maven-release</id>
        <name>Spring Maven Release Repository</name>
        <url>http://maven.springframework.org/release</url>
    </repository>
    <repository>
        <id>spring-maven-snapshot</id>
        <name>Spring Maven Snapshot Repository</name>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <url>http://maven.springframework.org/snapshot</url>
    </repository>
    <repository>
        <id>spring-maven-milestone</id>
        <name>Spring Maven Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
    </repository>
    <repository>
        <id>neo4j-release-repository</id>
        <name>Neo4j Maven 2 release repository</name>
        <url>http://m2.neo4j.org/releases</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>neo4j-snapshot-repository</id>
        <name>Neo4j Maven 2 snapshot repository</name>
        <url>http://m2.neo4j.org/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
    </repository>
    <repository>
        <id>jboss-public-repo</id>
        <url>http://repository.jboss.org/maven2/</url>
        <name>JBoss public available repo</name>
    </repository>
</repositories>
储思聪
2023-03-14

在没有看到Spring应用程序上下文的情况下进行猜测,但是我冒昧地猜测您遗漏了一些条目。

http://docs.spring.io/spring-data/data-neo4j/docs/current/reference/html/setup.html

在您的应用程序上下文中,是否有类似的内容?

<neo4j:repositories base-package="com.xyz.repositories"/>
<neo4j:config base-package="com.xyz"
              graphDatabaseService="graphDatabaseService"
/>
<bean id="graphDatabaseService"
      class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
    <constructor-arg index="0" value="http://your_url_here:7474/db/data"/>
    <constructor-arg index="1" value="your_user"/>
    <constructor-arg index="2" value="your_password"/>
</bean>
 类似资料:
  • 我是Spring的新手,在尝试将项目从Java6升级到Java8时遇到了此错误。 我在这里读到,要解决这个问题,要么使用Java 7,要么升级Spring版本。Java 7不行,因为我的目标是升级到Java 8,所以我尝试将Spring版本从2.1.9升级到4.0.0,结果出现以下错误: 以下是相关文件: pom.xml bprpp-memory-context.xml

  • 在尝试部署集成了Spring Security性的jsf项目时,我遇到了以下错误。我今天才开始使用Spring Security性,因为安全领域的javaee安全性太麻烦了。我看了这个教程。所以我不确定这个错误到底意味着什么。我今天也开始了分级,所以我把依赖项包括在内,以防万一。 (我会将错误作为引号放在页面底部)。 应用程序上下文.xml 我的渐变依赖项: 我的web.xml 并promise为

  • 我的代码中出现了这个错误。 org.springframework.beans.factory.BeanCreationException:创建名为“roleRepository”的bean时出错:设置bean属性“entityManager”时,无法创建[org.springframework.orm.jpa.SharedEntityManagerCreator]类型的内部bean(内部bean

  • 我正在学习OpenApi。我从Swagger那里得到了这个错误: TypeError: O是未定义的值parameter-row.jsx:149渲染root-injects.jsx:93React 8_renderValidatedComponentWithoutOwnerOrContext_renderValidatedComponent性能初始安装安装组件安装组件安装儿童_createInit

  • 我有一个 springboot 应用程序,我在其中连接到 cassandra DB。 我的pom.xml: cassandraConfig 定义: 仓库类: 实体类: 现在,当我启动应用程序时,我遇到了以下错误: 它说cassandraTemplate和sessionFactory的依赖和bean创建问题。我是使用spring-data的新手,所以不确定我错过了什么。 从启动日志,我可以看到它正在

  • Iam使用spring、hibernate maven项目时出现异常,无法在dispatcher servlet上解析对bean“sessionFactory”的引用。xml文件。下面是iam添加的三个文件内容。dispatcherservlet和应用程序上下文都位于resources文件夹中。问题是什么?请帮忙 我的错误:org。springframework。网状物util。NestedSer