0

When i generated the play framework example application (play-java) with activator and imported into IntelliJ everything worked fine and I can run up the application.

I can run the tests on the command line and they all work.

However when I try to run them from the IDE i get the following stack:

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at play.api.Logger$.<init>(Logger.scala:182)
    at play.api.Logger$.<clinit>(Logger.scala)
    at play.api.Play$.<init>(Play.scala:35)
    at play.api.Play$.<clinit>(Play.scala)
    at views.html.play20.welcome$.apply(welcome.template.scala:18)
    at views.html.index$.apply(index.template.scala:33)
    ...

I'm pretty sure its something simple, but I'm just moving over to Play/IntelliJ from C# so it's not immediately obvious to me!!

Thanks,

Ben

Ben Flowers
  • 1,434
  • 7
  • 21
  • 49

1 Answers1

0

Apparently the Jar: slf4j.jar is't not getting loaded for some reason.

atish shimpi
  • 4,873
  • 2
  • 32
  • 50
  • Yeah its a bit confusing as i used activator to generate the project. It doesn't seem to affect when I run on the command line so I think its an IDE issue. I literally set it up directly before starting the play app so im not sure if it configured incorrectly? – Ben Flowers Jan 14 '15 at 15:03
  • have you added `slf4j.jar` in your class path of IDE. – atish shimpi Jan 14 '15 at 15:04
  • Nope. Do you know how to do this in IntelliJ (Sorry, just moving over to this so it's all a bit new to me) – Ben Flowers Jan 14 '15 at 15:07
  • Refer this link http://stackoverflow.com/questions/16742085/adding-jar-files-to-intellijidea-classpath – atish shimpi Jan 14 '15 at 15:11
  • Okay. After doing this through maven, the tests run, but im now getting an the following warnings: SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10] and SLF4J: Class path contains multiple SLF4J bindings. – Ben Flowers Jan 14 '15 at 16:17
  • just configure single self4j binding, it might be next question. – atish shimpi Jan 14 '15 at 16:23