Need to add slf4j dependency in Alternator pom.xml
I added Alternator per the instructions in your readme. However, when I attempt to start the Alternator server, I ran into an exception (see below). It seems to me that you need to specify an additional dependency in your pom.xml?
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at org.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:613)
at org.eclipse.jetty.util.log.JettyAwareLogger.debug(JettyAwareLogger.java:200)
at org.eclipse.jetty.util.log.Slf4jLog.debug(Slf4jLog.java:84)
at org.eclipse.jetty.util.component.Container.add(Container.java:201)
at org.eclipse.jetty.util.component.Container.update(Container.java:164)
at org.eclipse.jetty.util.component.Container.update(Container.java:106)
at org.eclipse.jetty.server.Server.setConnectors(Server.java:183)
at org.eclipse.jetty.server.Server.addConnector(Server.java:157)
at com.michelboudreau.alternator.AlternatorDB.
These additional dependencies did the trick for me:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.6.6</version>
</dependency>
The issue is discussed in: http://stackoverflow.com/questions/7165633/exception-thrown-while-using-logback-slf4j
Are you having this problem in the alternator project itself or in the app running it?
Was missing the log4j-over-slf4j dependency in pom file. It was working in our application because dependency was already present. Fixed in 0.2.7-SNAPSHOT.
I had this problem in my project, not in Alternator.
Let me try it out in a new project to test it out.
Are you sure you incremented the version number to 0.2.7-SNAPSHOT? I just tried it on a new project which it started and stopped without issue.
yes, I tried it with 0.2.7-SNAPSHOT. I am able to continue forward by adding those dependencies in my pom.xml as well, so it is not a blocker for me. This was mainly FYI. Thanks.
I can't reproduce this error at all, if you can provide me with a small project that creates the error, I can find out what's the cause.
I think the following two dependencies should be scoped to test instead of runtime or compile. Only slf4j-api dependency should be set to compile.
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.0</version>
</dependency>
Based on the guidelines in this doc: http://veithen.blogspot.com/2009/10/taming-beast-managing-slf4j.html