简体   繁体   English

Neo4j 非托管扩展 Spring 上下文不加载

[英]Neo4j Unmanaged Extension Spring context does not load

I am attempting to stand up an unmanaged extension with a spring context.我正在尝试使用 spring 上下文建立一个非托管扩展。 I have been trying to follow these resources:我一直在尝试关注这些资源:

https://groups.google.com/forum/#!topic/neo4j/AZUVcFxvI_k https://groups.google.com/forum/#!topic/neo4j/AZUVcFxvI_k

https://github.com/spring-projects/spring-data-neo4j/tree/master/spring-data-neo4j-rest https://github.com/spring-projects/spring-data-neo4j/tree/master/spring-data-neo4j-rest

https://inserpio.wordpress.com/2014/04/30/extending-the-neo4j-server-with-spring-data-neo4j/ https://inserpio.wordpress.com/2014/04/30/extending-the-neo4j-server-with-spring-data-neo4j/

http://docs.spring.io/spring-data/data-graph/snapshot-site/reference/html/#d5e1991 http://docs.spring.io/spring-data/data-graph/snapshot-site/reference/html/#d5e1991

I have been unable to inject a service from the spring context using the @Context annotation.我一直无法使用 @Context 注释从 spring 上下文注入服务。 I cannot see what I am missing.我看不到我错过了什么。

I have uploaded my project: here我已经上传了我的项目: 这里

I have this line of configuration in conf/neo4j-server.properties我在 conf/neo4j-server.properties 中有这行配置

org.neo4j.server.thirdparty_jaxrs_classes=test.testload=/loader

This is the error from the log file:这是日志文件中的错误:

Feb 05, 2015 3:50:10 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM' Feb 05, 2015 3:50:11 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM' Feb 05, 2015 3:50:11 PM com.sun.jersey.api.core.PackagesResourceConfig init INFO: Scanning for root resource and provider classes in the packages: test.testload Feb 05, 2015 3:50:11 PM com.sun.jersey.api.core.ScanningResourceConfig logClasses INFO: Root resource classes found: class test.testload.HelloWorldResource Feb 05, 2015 3:50:11 PM com.sun.jersey.api.core.ScanningResourceConfig init INFO: No provider classes found. 2015 年 2 月 5 日下午 3:50:10 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO:启动 Jersey 应用程序,版本 'Jersey: 1.9 09/02/2011 11:17 AM' 2015 年 2 月 5 日 3 :50:11 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO: 启动 Jersey 应用程序,版本 'Jersey: 1.9 09/02/2011 11:17 AM' 2015 年 2 月 5 日下午 3:50:11 com.sun.jersey.api.core.PackagesResourceConfig init INFO:扫描包中的根资源和提供程序类:test.testload 2015 年 2 月 5 日下午 3:50:11 com.sun.jersey.api.core.ScanningResourceConfig logClasses信息:找到根资源类:class test.testload.HelloWorldResource 2015 年 2 月 5 日下午 3:50:11 com.sun.jersey.api.core.ScanningResourceConfig init 信息:未找到提供程序类。 Feb 05, 2015 3:50:11 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM' Feb 05, 2015 3:50:11 PM com.sun.jersey.spi.inject.Errors processErrorMessages SEVERE: The following errors and warnings have been detected with resource and/or provider classes: SEVERE: Missing dependency for constructor public test.testload.HelloWorldResource(org.neo4j.graphdb.GraphDatabaseService,test.testload.service.TestService) at parameter index 1 2015 年 2 月 5 日下午 3:50:11 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFO:启动 Jersey 应用程序,版本 'Jersey: 1.9 09/02/2011 11:17 AM' 2015 年 2 月 5 日 3 :50:11 PM com.sun.jersey.spi.inject.Errors processErrorMessages 严重:在资源和/或提供程序类中检测到以下错误和警告:严重:缺少构造函数 public test.testload.HelloWorldResource(org. neo4j.graphdb.GraphDatabaseService,test.testload.service.TestService) 在参数索引 1

What am I missing that will allow me to access the spring context?我缺少什么可以让我访问 spring 上下文? Why is the Plugin Lifecycle class called out in: META-INF/services/org.neo4j.server.plugins.PluginLifecycle being ignored?为什么在 META-INF/services/org.neo4j.server.plugins.PluginLifecycle 中调用 Plugin Lifecycle 类被忽略?

AFAIK the implementations if PluginLifecycle are not detected via serviceloader, so get rid of META-INF/services/org.neo4j.server.plugins.PluginLifecycle .如果没有通过 serviceloader 检测到PluginLifecycle则AFAIK 实现,因此摆脱META-INF/services/org.neo4j.server.plugins.PluginLifecycle

Instead move your PluginLivecycle implementation ( ImportConfig ) to a package being exposed in config org.neo4j.server.thirdparty_jaxrs_classes - in your case test.testload instead of test.testload.config .而是将您的PluginLivecycle实现( ImportConfig )移动到配置org.neo4j.server.thirdparty_jaxrs_classes中公开的包 - 在您的情况下test.testload而不是test.testload.config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM