0
votes

I am attempting to stand up an unmanaged extension with a spring context. I have been trying to follow these resources:

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

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/

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. I cannot see what I am missing.

I have uploaded my project: here

I have this line of configuration in 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. 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

What am I missing that will allow me to access the spring context? Why is the Plugin Lifecycle class called out in: META-INF/services/org.neo4j.server.plugins.PluginLifecycle being ignored?

1
Perhaps this is related, or the same issue.jake
Have you looked at the GraphAware Framework github.com/graphaware/neo4j-framework? You can just use pure Spring MVC controllers and Spring dependency injection with it. Have a look at the docs and the examples such as this one github.com/graphaware/neo4j-framework/blob/master/examples/… and let us know if you were successful.Michal Bachman
Did you put all dependencies in your neo4j plugins folder? I.e. if you do in your project: mvn dependency:copy-dependencies -> put all those jars into your plugins folder.Michael Hunger
I added the dependency jars to the plugins folder. I received the same missing dependency error. I will look into the graphaware framework. Thank you for your time and assistance.jake

1 Answers

0
votes

AFAIK the implementations if PluginLifecycle are not detected via serviceloader, so get rid of 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.