0

私はデータベースとしてSpringとNeo4jを使用してRESTfulなWebサービスを開発しています。私はWindows 7システムにNeo4j 3.0.7をインストールしました。 Springコンフィグレーションで次の行を使用してCRUD APIを開発することができました:<neo4j:config storeDirectory="C:\demo.graphdb" base-package="test.model"/>SpringのaplicationContextと外部のneo4jサーバーを持つNeo4j構成

今、私はlocalhost:7474で実行されているが、WARファイルの展開中に例外を取得しています、私の既存のNeo4jデータベースを接続したい:

Configuration problem: Unable to locate Spring NamespaceHandler for 
XML schema namespace 
[http://www.springframework.org/schema/data/neo4j] Offending resource: 
ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml] 

マイ全体春のApplicationContextは次のとおりです。

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

    <context:component-scan base-package="test.*" /> 
    <context:property-placeholder location="classpath:spring.properties" ignore-unresolvable="true" />  
    <mvc:annotation-driven /> 
    <mvc:default-servlet-handler /> 

    <bean id="graphDataBaseService" class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase" >   <constructor-arg index="0" value="http://localhost:7474" /> 
    <constructor-arg index="1" value="neo4j"/> 
    <constructor-arg index="2" value="[email protected]"/> 
    </bean> 

    <neo4j:config graphDataBaseService="graphDataBaseService" base-package="test.model" /> 
    <neo4j:repositories base-package="test.dao"/> 
    </beans> 

私は使用しています:

  • 春データNeo4jバージョン4.1.6.RELEASE
  • のNeo4jのバージョン3.0.7
  • 春WebMvcバージョン4.1.1.RELEASE

答えて

1

春データのNeo4j 4.xのXMLコンフィギュレーションをサポートしていません(これは3.xの中に落ちた - >の4.xリライト)。

は、この貴重な情報を共有するためのhttp://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#_java_based_bean_configuration

+0

ありがとうfrant.hartmを参照してください。今私はJavaベースのBeanの設定をさらに進めようとしますが、何か問題が発生した場合は私は投稿していきます。もう一度ありがとう。 – sayan

関連する問題