无法从spring应用程序连接neo4j服务器

用户名

我试图从我的Spring应用程序连接本地运行的neo4j实例。我正在尝试使用链接sdn-twitter-graph中提到的twitter应用程序示例

但是它失败并出现以下异常

`
Caused by: java.lang.NullPointerException
    at org.neo4j.rest.graphdb.ExecutingRestRequest.uriWithoutSlash(ExecutingRestRequest.java:78)
    at org.neo4j.rest.graphdb.ExecutingRestRequest.<init>(ExecutingRestRequest.java:72)
    at org.neo4j.rest.graphdb.ExecutingRestRequest.with(ExecutingRestRequest.java:149)
    at org.neo4j.rest.graphdb.entity.RestEntity.<init>(RestEntity.java:52)
    at org.neo4j.rest.graphdb.entity.RestNode.<init>(RestNode.java:47)
    at org.neo4j.rest.graphdb.RestAPI.getReferenceNode(RestAPI.java:168)
    at org.neo4j.rest.graphdb.RestGraphDatabase.getReferenceNode(RestGraphDatabase.java:67)
    at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.isAlreadySubRef(TypeRepresentationStrategyFactory.java:71)
    at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactory.java:56)
    at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.<init>(TypeRepresentationStrategyFactory.java:40)
    at org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory(Neo4jConfiguration.java:151)
    at org.springframework.data.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$c7a98d47.CGLIB$typeRepresentationStrategyFactory$9(<generated>)
    at org.springframework.data.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$c7a98d47$$FastClassByCGLIB$$d6c07f8a.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:285)
    at org.springframework.data.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$c7a98d47.typeRepresentationStrategyFactory(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)
    ... 82 more
`

POM配置

    <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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test.spring.neo4j</groupId>
    <artifactId>TestSpringWithNeo4j</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-neo4j</artifactId>
            <version>2.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-twitter</artifactId>
            <version>1.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.neo4j</groupId>
            <artifactId>neo4j</artifactId>
            <version>1.8.M06</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>
        <!-- <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> 
            <version>3.0</version> </dependency> -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-neo4j-rest</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2</version>
        </dependency>
                <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.1.0.Final</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>spring</id>
            <url>http://repo.springsource.org/libs-milestone</url>
        </repository>
        <repository>
            <id>neo4j</id>
            <url>http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/</url>
        </repository>
    </repositories>
 </project>

TwitterGraph-server.xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:neo4j="http://www.springframework.org/schema/data/neo4j" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/data/neo4j
        http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd 
        http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <context:component-scan base-package="com.test.spring.services"/>
    <context:annotation-config/>

    <neo4j:repositories base-package="com.test.spring.repositories"/>
    <tx:annotation-driven mode="proxy"/>

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

    <neo4j:config graphDatabaseService="graphDatabaseService"/>

</beans>

请帮助我进行配置。

谢谢..

迈克尔·汉格

然后,您应该将Neo4j 1.8用作服务器,因为您的SDN依赖性也适用于1.8。

或等待针对Neo4j 2.0的SDN 3.0.M2。

SDN 3.0 M1仍为2.0.0-M06

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

与neo4j服务器进行Web应用程序通信的方式是什么

来自分类Dev

连接到远程 neo4j 服务器

来自分类Dev

Neo4j无法连接到图形数据库服务器

来自分类Dev

Neo4J服务器异常-无法启动

来自分类Dev

无法启动neo4j服务器2.1.2

来自分类Dev

无法启动neo4j服务器

来自分类Dev

应用程序无法连接X服务器以启动

来自分类Dev

应用程序无法连接到简单的服务器

来自分类Dev

使用Spring Data Neo4J 3.3.1创建数据库时,Neo4j 2.2.3服务器无法启动

来自分类Dev

带有spring aplicationContext和外部Neo4j服务器的Neo4j配置

来自分类Dev

如何从Android使用asynctask连接到Neo4j服务器(本地主机)

来自分类Dev

如何连接graphenedb / neo4j来播放在heroku上运行的应用程序?

来自分类Dev

如何使用独立的neo4j服务器配置spring-data-neo4j?

来自分类Dev

Neo4j服务器无法以非托管扩展名启动

来自分类Dev

Neo4j服务器无法在120秒内启动

来自分类Dev

以只读模式部署Neo4j服务器

来自分类Dev

了解Neo4j服务器插件

来自分类Dev

Neo4j服务器超时

来自分类Dev

Neo4j 在 CentoOS 服务器上关闭

来自分类Dev

无法在 Neo4j 电影示例应用程序中搜索电影

来自分类Dev

无法运行由 neo4j 支持的 Rails 应用程序的 ruby 规范测试

来自分类Dev

Neo4J Cypher推荐应用程序

来自分类Dev

无法使用neo4j驱动程序从nodejs连接到neo4j

来自分类Dev

无法使用neo4j驱动程序从nodejs连接到neo4j

来自分类Dev

ionic应用程序无法将启用了cors的服务器与$ http连接

来自分类Dev

无法从C#.net应用程序连接到oracle服务器

来自分类Dev

worklight-首次尝试安装后,应用程序无法与服务器连接

来自分类Dev

将应用程序发布到远程服务器时,无法连接到SQL

来自分类Dev

mobilefirst ios混合应用程序无法连接到生产服务器

Related 相关文章

  1. 1

    与neo4j服务器进行Web应用程序通信的方式是什么

  2. 2

    连接到远程 neo4j 服务器

  3. 3

    Neo4j无法连接到图形数据库服务器

  4. 4

    Neo4J服务器异常-无法启动

  5. 5

    无法启动neo4j服务器2.1.2

  6. 6

    无法启动neo4j服务器

  7. 7

    应用程序无法连接X服务器以启动

  8. 8

    应用程序无法连接到简单的服务器

  9. 9

    使用Spring Data Neo4J 3.3.1创建数据库时,Neo4j 2.2.3服务器无法启动

  10. 10

    带有spring aplicationContext和外部Neo4j服务器的Neo4j配置

  11. 11

    如何从Android使用asynctask连接到Neo4j服务器(本地主机)

  12. 12

    如何连接graphenedb / neo4j来播放在heroku上运行的应用程序?

  13. 13

    如何使用独立的neo4j服务器配置spring-data-neo4j?

  14. 14

    Neo4j服务器无法以非托管扩展名启动

  15. 15

    Neo4j服务器无法在120秒内启动

  16. 16

    以只读模式部署Neo4j服务器

  17. 17

    了解Neo4j服务器插件

  18. 18

    Neo4j服务器超时

  19. 19

    Neo4j 在 CentoOS 服务器上关闭

  20. 20

    无法在 Neo4j 电影示例应用程序中搜索电影

  21. 21

    无法运行由 neo4j 支持的 Rails 应用程序的 ruby 规范测试

  22. 22

    Neo4J Cypher推荐应用程序

  23. 23

    无法使用neo4j驱动程序从nodejs连接到neo4j

  24. 24

    无法使用neo4j驱动程序从nodejs连接到neo4j

  25. 25

    ionic应用程序无法将启用了cors的服务器与$ http连接

  26. 26

    无法从C#.net应用程序连接到oracle服务器

  27. 27

    worklight-首次尝试安装后,应用程序无法与服务器连接

  28. 28

    将应用程序发布到远程服务器时,无法连接到SQL

  29. 29

    mobilefirst ios混合应用程序无法连接到生产服务器

热门标签

归档