我有两个简单的类来测试neo4j服务器上的rest调用。我已经将.jar文件与包含的路径放在插件目录中,如:
gov/lanl/graphing/execute/rest/HelloWorldResource.class我修改了新4j-server.properties文件,如:
org.neo4j.server.thirdparty_jaxrs_class=
gov.lanl.graphing.execute.rest=/gov/lanl/graphing/execute/rest我想我对上述财产缺乏了解。
这里有两个类,HelloWorldResrource类是插件direcotry中的一个。注意:这里有一些cooky切割器语法,所以忽略了奇怪的变量名等等。
这非常简单,我认为问题是我不明白server.properties文件中的路径应该如何在主类中表示。谢谢你的帮助。
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();
}
}发布于 2014-12-23 23:46:52
好吧,在我的j.v.吵了很多之后。密码我发现了一些错误。
首先:
org.neo4j.server.thirdparty\_jaxrs\_class= should be: org.neo4j.server.thirdparty\_jaxrs\_classes=第二:
我没有正确配置我的.jar文件,我重新配置了这个编译,以正确地包含类路径和降序目录。问题解决了。关于更困难的问题..。
https://stackoverflow.com/questions/27628721
复制相似问题