I am experiencing a βclassicβ error. The ResourceConfig instance does not contain any root resource classes from HelloWorldResource.java
I followed the instructions for Unmanaged Extensions :
- Added JAR file in plugins directory
- Set org.neo4j.server.thirdparty_jaxrs_classes = org.neo4j.examples.server.unmanaged = / examples / unmanaged
And here is the code:
package org.neo4j.examples.server.unmanaged; import ... @Path( "/helloworld" ) public class HelloWorldResource { //private final GraphDatabaseService database; //public HelloWorldResource( @Context GraphDatabaseService database ) //{ // this.database = database; //} @GET @Produces( MediaType.TEXT_PLAIN ) @Path( "/{nodeId}" ) public Response hello( @PathParam( "nodeId" ) long nodeId ) { // Do stuff with the database return Response.status( Status.OK ).entity( ("Hello World, nodeId=" + nodeId).getBytes( Charset.forName("UTF-8") ) ).build(); } }
I am using Windows 8.1 and ENTERPRISE 2.2.0_M02, when I start bin\Neo4j.bat I get an error.
C:\Users\user\Dropbox\MyDBs\neo4j\dbmusicovery3>bin\Neo4j.bat 2015-06-15 23:14:58.889+0000 INFO [API] Setting startup timeout to: 120000ms based on 120000 2015-06-15 23:15:05.397+0000 INFO [API] Successfully started database 2015-06-15 23:15:05.477+0000 INFO [API] Starting HTTP on port :7474 with 4 threads available 2015-06-15 23:15:05.724+0000 INFO [API] Enabling HTTPS on port :7473 2015-06-15 23:15:05.856+0000 INFO [API] Mounted REST API at: /db/manage 2015-06-15 23:15:05.875+0000 INFO [API] Mounted unmanaged extension [neo4j.unmanaged] at [/examples/unmanaged] 01:15:05.894 [main] INFO org.eclipse.jetty.util.log - Logging initialized @8256ms 2015-06-15 23:15:05.956+0000 INFO [API] Mounting static content at [/webadmin] from [webadmin-html] 2015-06-15 23:15:06.015+0000 INFO [API] Mounting static content at [/browser] from [browser] 01:15:06.019 [main] INFO org.eclipse.jetty.server.Server - jetty-9.2.1.v20140609 01:15:06.065 [main] INFO oejserver.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler@3827eac9 {/,null,AVAILABLE} 01:15:06.206 [main] INFO oejwStandardDescriptorProcessor - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet 01:15:06.226 [main] INFO oejserver.handler.ContextHandler - Started o.e.j.w.WebAppContext@2aea41c2 {/webadmin,jar:file:/C:/Users/user/Dropbox/MyDBs/neo4j/dbmusico very3/system/lib/neo4j-server-2.2.0-M02-static-web.jar!/webadmin-html,AVAILABLE} 01:15:06.764 [main] WARN /examples/unmanaged - unavailable com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. ... ... FAILED o.e.j.s.ServletContextHandler@1f7bd4dd {/examples/unmanaged,null,STARTING}: ...
Some magazines:
juin 16, 2015 9:51:26 AM com.sun.jersey.api.core.PackagesResourceConfig init INFOS: Scanning for root resource and provider classes in the packages: neo4j.unmanaged juin 16, 2015 9:51:26 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate INFOS: Initiating Jersey application, version 'Jersey: 1.18.1 02/19/2014 03:28 AM' juin 16, 2015 9:51:26 AM com.sun.jersey.server.impl.application.RootResourceUriRules <init> GRAVE: The ResourceConfig instance does not contain any root resource classes.
Fast jar jar:
C:\...\plugins>jar tf myapp.jar META-INF/MANIFEST.MF pom.xml .project org/neo4j/examples/server/unmanaged/AppTest.class org/neo4j/examples/server/unmanaged/HelloWorldResource.class target/test-classes/org/neo4j/examples/server/unmanaged/AppTest.class .classpath
source share