Failed to load class "org.slf4j.impl.StaticLoggerBinder"

1,181 views
Skip to first unread message

Eirik Sletteberg

unread,
Oct 23, 2013, 8:50:26 PM10/23/13
to scalat...@googlegroups.com
"... defaulting to no-operation (NOP) logger implementation."

I'm getting this problem, and can't log any output from my app! (I'm not sure whether that error is the reason, or not)

- g8 scalatra/scalatra-sbt
-  all options default (com.example etc)
- cd my-scalatra-web-app
- sbt
- container:start

(The error appers in the sbt output)

I'm running Windows 7 64 bit. Java version 1.7.0_01-b08.

Anybody else who gets this output?

Ivan Porto Carrero

unread,
Oct 23, 2013, 8:51:43 PM10/23/13
to scalat...@googlegroups.com
I think you need to add logback-classic to your build.sbt 

---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero - Mob: +1 (415) 323-8084
Web: http://flanders.co.nz
Twitter: http://twitter.com/casualjim



--
You received this message because you are subscribed to the Google Groups "scalatra-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatra-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Eirik Sletteberg

unread,
Oct 24, 2013, 10:53:52 AM10/24/13
to scalat...@googlegroups.com
logback-classic is in there already, by default... (from the g8 generator)

Ivan Porto Carrero

unread,
Oct 24, 2013, 5:07:37 PM10/24/13
to scalat...@googlegroups.com

Could you gist the entire output of sbt?

Eirik Sletteberg

unread,
Oct 26, 2013, 4:53:00 PM10/26/13
to scalat...@googlegroups.com
It gets weirder... I believe it might have something to do with sbt.

When I run:

sbt container:start > sbtlog.txt

I get a file (sbtlog.txt) with this content:

[info] Loading global plugins from C:\Users\Eirik\.sbt\0.13\plugins
[info] Loading project definition from D:\workspace\blatest\my-scalatra-web-app\project
[info] Set current project to My Scalatra Web App (in build file:/D:/workspace/blatest/my-scalatra-web-app/)
[info] Generating D:\workspace\blatest\my-scalatra-web-app\target\scala-2.10\resource_managed\main\rebel.xml.
[info] Compiling Templates in Template Directory: D:\workspace\blatest\my-scalatra-web-app\src\main\webapp\WEB-INF\templates
[info] jetty-8.1.8.v20121106
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
22:46:31.663 [pool-7-thread-1] INFO  o.scalatra.servlet.ScalatraListener - Initializing life cycle class: ScalatraBootstrap
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
22:46:31.949 [pool-7-thread-1] INFO  o.f.s.servlet.ServletTemplateEngine - Scalate template engine using working directory: C:\Users\Eirik\AppData\Local\Temp\scalate-6594350449708575862-workdir
[success] Total time: 1 s, completed 26.okt.2013 22:46:31

(everything seems fine.)

When I run

sbt container:start

I get this console output:

D:\workspace\blatest\my-scalatra-web-app>sbt container:start
[info] Loading global plugins from C:\Users\Eirik\.sbt\0.13\plugins
[info] Loading project definition from D:\workspace\blatest\my-scalatra-web-app\project
[info] Set current project to My Scalatra Web App (in build file:/D:/workspace/blatest/my-scalatra-web-app/)
[info] Generating D:\workspace\blatest\my-scalatra-web-app\target\scala-2.10\resource_managed\main\rebel.xml.
[info] Compiling Templates in Template Directory: D:\workspace\blatest\my-scalatra-web-app\src\main\webapp\WEB-INF\templates
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
[info] jetty-8.1.8.v20121106
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
Null identity service, trying login service: null
Finding identity service: null
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
22:44:55.169 [pool-7-thread-4] INFO  o.scalatra.servlet.ScalatraListener - Initializing life cycle class: ScalatraBootstrap
[info] started o.e.j.w.WebAppContext{/,[file:/D:/workspace/blatest/my-scalatra-web-app/src/main/webapp/]}
22:44:55.449 [pool-7-thread-4] INFO  o.f.s.servlet.ServletTemplateEngine - Scalate template engine using working directory: C:\Users\Eirik\AppData\Local\Temp\scalate-7432287242830895053-workdir
[success] Total time: 1 s, completed 26.okt.2013 22:44:55


So the error is not there when I pipe the output to a file.

Ivan Porto Carrero

unread,
Oct 26, 2013, 6:27:19 PM10/26/13
to scalat...@googlegroups.com

I think you first need to start sbt.  And then in the sbt console do container:start

Eirik Sletteberg

unread,
Oct 28, 2013, 7:37:18 AM10/28/13
to scalat...@googlegroups.com
I tried it. Gives me the exact same result.

Matt

unread,
Feb 23, 2015, 5:01:45 AM2/23/15
to scalat...@googlegroups.com
I also get this problem, though my logging works fine afterwards. I noticed that the warn message only appears when I enable pre-compilation of templates. So it seems that whatever is compiling the templates in the template directory is not able to discover the logback library. Any ideas?

Ivan Porto Carrero

unread,
Feb 23, 2015, 2:30:04 PM2/23/15
to scalat...@googlegroups.com
it's the scalate compiler that looks for a logging library.  IIRC if you want the error to go away depend on a slf4j logger in plugins.sbt  so that one is available on the classpath for sbt stuff. 

---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero - Mob: +1 (415) 323-8084
Web: http://flanders.co.nz
Twitter: http://twitter.com/casualjim


For more options, visit https://groups.google.com/d/optout.

Matt

unread,
Mar 4, 2015, 6:56:46 AM3/4/15
to scalat...@googlegroups.com
Thank you for your help. Unfortunately, I couldn't figure out how to depend on a regular artifact in plugins.sbt
Anyway, since it's only a nuisance but not a deal-breaker, I decided to just ignore it.

Leif Warner

unread,
Mar 4, 2015, 3:45:44 PM3/4/15
to scalat...@googlegroups.com
You should be able to add a line to your plugins.sbt:

libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.10"

Matt

unread,
Mar 30, 2015, 5:28:01 AM3/30/15
to scalat...@googlegroups.com
Thanks, it seems to work!
Reply all
Reply to author
Forward
0 new messages