嵌入式neo4j webadmin无法正常工作

时间:2012-01-24 19:01:52

标签: java maven neo4j

我在使用WebAdmin运行neo4j(在嵌入模式下)时遇到了一些问题 - 版本1.6。

我按如下方式初始化DB和webadmin:

graphDb = new EmbeddedGraphDatabase( DB_PATH);
        srv = new WrappingNeoServerBootstrapper( graphDb);
        srv.start();
        registerShutdownHook( graphDb, srv );

这是Neo4j文档中描述的常用方式。

我的Maven依赖项是:

<dependencies>
    <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>${neo4j-version}</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j.app</groupId>
        <artifactId>neo4j-server</artifactId>
        <version>${neo4j-version}</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j.app</groupId>
        <artifactId>neo4j-server</artifactId>
        <classifier>static-web</classifier>
        <version>${neo4j-version}</version>
    </dependency>
</dependencies>

尝试访问http://localhost:7474时遇到的错误是:

Problem accessing /. Reason:

    javax.servlet.http.HttpServletRequest.getRequestURL()Ljava/lang/StringBuffer;
Caused by:

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getRequestURL()Ljava/lang/StringBuffer;
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:638)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)

1 个答案:

答案 0 :(得分:1)

尽管我有依赖关系和我的依赖关系:树输出看起来像这样:

[INFO] neo4j-starter:neo4j-starter:jar:0.0.1-SNAPSHOT
[INFO] +- commons-configuration:commons-configuration:jar:1.4:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.2:compile
[INFO] |  +- commons-lang:commons-lang:jar:2.3:compile
[INFO] |  +- commons-logging:commons-logging-api:jar:1.0.4:compile
[INFO] |  +- commons-digester:commons-digester:jar:1.8:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.1:compile
[INFO] |  |     +- logkit:logkit:jar:1.0.1:compile
[INFO] |  |     \- avalon-framework:avalon-framework:jar:4.1.3:compile
[INFO] |  +- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.3:compile
[INFO] |  \- commons-jxpath:commons-jxpath:jar:1.2:compile
[INFO] |     +- xerces:xerces:jar:1.2.3:compile
[INFO] |     +- javax.servlet:servlet-api:jar:2.2:compile
[INFO] |     +- ant:ant-optional:jar:1.5.1:compile
[INFO] |     +- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |     \- jdom:jdom:jar:b9:compile
[INFO] +- org.neo4j:neo4j:jar:1.6.M03:compile
[INFO] |  +- org.neo4j:neo4j-kernel:jar:1.6.M03:compile
[INFO] |  |  \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] |  +- org.neo4j:neo4j-lucene-index:jar:1.6.M03:compile
[INFO] |  |  \- org.apache.lucene:lucene-core:jar:3.5.0:compile
[INFO] |  +- org.neo4j:neo4j-graph-algo:jar:1.6.M03:compile
[INFO] |  +- org.neo4j:neo4j-udc:jar:1.6.M03:compile
[INFO] |  +- org.neo4j:neo4j-graph-matching:jar:1.6.M03:compile
[INFO] |  +- org.neo4j:neo4j-cypher:jar:1.6.M03:compile
[INFO] |  |  \- org.scala-lang:scala-library:jar:2.9.0-1:compile
[INFO] |  \- org.neo4j:neo4j-jmx:jar:1.6.M03:compile
[INFO] +- org.neo4j.app:neo4j-server:jar:1.6.M03:compile
[    INFO] |  +- org.neo4j:neo4j:pom:1.6.M03:compile
[INFO] |  +- org.neo4j:server-api:jar:1.6.M03:compile
[INFO] |  |  \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] |  +- org.slf4j:log4j-over-slf4j:jar:1.6.1:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[INFO] |  +- org.mortbay.jetty:jetty:jar:6.1.25:compile
[INFO] |  |  +- org.mortbay.jetty:jetty-util:jar:6.1.25:compile
[INFO] |  |  \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile
[INFO] |  +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] |  |  +- asm:asm:jar:3.1:compile
[INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] |  +- commons-io:commons-io:jar:1.4:compile
[INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.8.3:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.3:compile
[INFO] |  +- com.tinkerpop.gremlin:gremlin-groovy:jar:1.4:compile
[INFO] |  |  +- com.tinkerpop.gremlin:gremlin-java:jar:1.4:compile
[INFO] |  |  +- com.tinkerpop:pipes:jar:0.9:compile
[INFO] |  |  +- org.codehaus.groovy:groovy:jar:1.8.4:compile
[INFO] |  |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  |  +- asm:asm-commons:jar:3.2:compile
[INFO] |  |  |  +- asm:asm-util:jar:3.2:compile
[INFO] |  |  |  +- asm:asm-analysis:jar:3.2:compile
[INFO] |  |  |  \- asm:asm-tree:jar:3.2:compile
[INFO] |  |  \- org.fusesource.jansi:jansi:jar:1.5:compile
[INFO] |  +- com.tinkerpop.blueprints:blueprints-neo4j-graph:jar:1.1:compile
[INFO] |  |  \- com.tinkerpop.blueprints:blueprints-core:jar:1.1:compile
[INFO] |  |     \- org.codehaus.jettison:jettison:jar:1.3:compile
[INFO] |  |        \- stax:stax-api:jar:1.0.1:compile
[INFO] |  +- org.rrd4j:rrd4j:jar:2.0.7:compile
[INFO] |  +- com.sun.jersey.contribs:jersey-multipart:jar:1.9:compile
[INFO] |  |  \- org.jvnet:mimepull:jar:1.6:compile
[INFO] |  \- org.neo4j:neo4j-shell:jar:1.6.M03:compile
[INFO] |     \- org.apache.servicemix.bundles:org.apache.servicemix.bundles.jline:jar:0.9.94_1:compile
[INFO] +- org.neo4j.app:neo4j-server:jar:static-web:1.6.M03:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.4:compile
[INFO] |  \- log4j:log4j:jar:1.2.16:compile
[INFO] \- junit:junit:jar:4.8:compile

我需要包含较新版本的servlet-api

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.3</version>
    </dependency>