4
votes

I've converted my neo4j unmanaged extension to Neo4j 3.0.2. Now when I'm starting neo4j server I'm getting error below (neo4j.log):

WARN  FAILED org.eclipse.jetty.server.handler.HandlerList@26e74145[o.e.j.s.h.MovedContextHandler@6f4821f9{/,null,AVAILABLE}, o.e.j.s.ServletContextHandler@457192e2{/kastr,null,STARTING}, o.e.j.s.ServletContextHandler@15a93e18{/db/manage,null,null}, o.e.j.s.ServletContextHandler@188dddd2{/db/data,null,null}, o.e.j.w.WebAppContext@47c4aef{/browser,jar:file:/C:/apps/neo4j-v3/lib/neo4j-browser-1.1.6.jar!/browser,null}, o.e.j.s.ServletContextHandler@2a15f470{/,null,null}]:     java.lang.NoClassDefFoundError: Lorg/slf4j/Logger; Lorg/slf4j/Logger;
java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller.workOutFieldsList(IntrospectionModeller.java:204)

...

WARN  FAILED org.eclipse.jetty.server.Server@5dd52c54: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger; Lorg/slf4j/Logger;
java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller.workOutFieldsList(IntrospectionModeller.java:204)
at com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller.createResource(IntrospectionModeller.java:116)
at com.sun.jersey.server.impl.application.WebApplicationImpl.getAbstractResource(WebApplicationImpl.java:769)

ERROR Failed to start Neo4j: Starting Neo4j failed: Lorg/slf4j/Logger; Starting Neo4j failed: Lorg/slf4j/Logger;

I'm using slf4j for logging internally.

How logging should be configured now? Could anyone advise.

UPDATE

In order to successfully start neo4j server I added three dependencies to pom.xml for slf4j-api, logback-core and logback-classic, plus copied packages jar files into neo4j\lib folder.

Now server starts without errors and extension loads and works fine. But all extension logging goes into neo4j.log.

In terms of logging configuration I have a logback.xml in conf folder as before, but it looks like it's been ignored.

Logback.xml for the reference is

<configuration>
    <appender name="EXTENSIONS" class="ch.qos.logback.core.rolling.RollingFileAppender">
         <file>logs/extensions.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logs/extensions.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>25</maxHistory>
         </rollingPolicy>
         <encoder>
            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSSZ} %-5level [%logger{15}]: %message%n</pattern>
         </encoder>
    </appender>

    <root level="debug">
        <appender-ref ref="EXTENSIONS"/>
    </root>
</configuration>
1
Which version of slf4j-api and which binding are you using? - Ceki
@ceki self4j-api 1.7.7 - drgraduss

1 Answers

0
votes

What is written to neo4j.log and debug.log ?

You can also add the slf4j dependency in your exension pom.xml

Care that the version is the same as the neo4j's pom :

For Neo4j 3.0.2

<!-- http://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.7</version>
</dependency>

Or you can download the artifact and put it in the lib directory of neo4j.