首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >需要帮助使用简单的neo4j rest概念证明

需要帮助使用简单的neo4j rest概念证明
EN

Stack Overflow用户
提问于 2014-12-23 22:07:34
回答 1查看 46关注 0票数 0

我有两个简单的类来测试neo4j服务器上的rest调用。我已经将.jar文件与包含的路径放在插件目录中,如:

代码语言:javascript
复制
gov/lanl/graphing/execute/rest/HelloWorldResource.class

我修改了新4j-server.properties文件,如:

代码语言:javascript
复制
org.neo4j.server.thirdparty_jaxrs_class=
     gov.lanl.graphing.execute.rest=/gov/lanl/graphing/execute/rest

我想我对上述财产缺乏了解。

这里有两个类,HelloWorldResrource类是插件direcotry中的一个。注意:这里有一些cooky切割器语法,所以忽略了奇怪的变量名等等。

这非常简单,我认为问题是我不明白server.properties文件中的路径应该如何在主类中表示。谢谢你的帮助。

代码语言:javascript
复制
public class Resting {

    public static String URI = "http://localhost:7474/gov/lanl/graphing/execute/rest/helloworld/";
    public static void main (String[] args) {

        Client client = Client.create();
        client.addFilter(new LoggingFilter(System.out));
        WebResource cypher = client.resource(URI + "rico");
        ClientResponse cypherResponse = cypher.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
        cypherResponse.close();
        System.out.println(cypherResponse);
    }
}


@Path("/helloworld")
public class HelloWorldResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/{name}")
    public Response hello(@PathParam("name") String name)
    {
        return Response.status(Status.OK).entity(
                ("hello there , " + name).getBytes(Charset.forName("UTF-8"))).build();
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-23 23:46:52

好吧,在我的j.v.吵了很多之后。密码我发现了一些错误。

首先:

代码语言:javascript
复制
 org.neo4j.server.thirdparty\_jaxrs\_class= should be:      org.neo4j.server.thirdparty\_jaxrs\_classes=

第二:

我没有正确配置我的.jar文件,我重新配置了这个编译,以正确地包含类路径和降序目录。问题解决了。关于更困难的问题..。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27628721

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档