AlexJoz / play2-maven-plugin

Automatically exported from code.google.com/p/play2-maven-plugin
0 stars 0 forks source link

play2:run raises a NoClassDefFoundError: ch/qos/logback/core/Context #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. mvn clean install
2. mvn play2:run
3.

What is the expected output? What do you see instead?
Expected the server run properly, but the output is as follows :
[INFO] Launching Play! Server
     [play] Play server process ID is 3330
     [play] Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/Context
     [play]     at play.api.Application$class.$init$(Application.scala:264)
     [play]     at play.api.DefaultApplication.<init>(Application.scala:381)
     [play]     at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
     [play]     at play.core.server.NettyServer$.createServer(NettyServer.scala:233)
     [play]     at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:264)
     [play]     at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:263)
     [play]     at scala.Option.map(Option.scala:145)
     [play]     at play.core.server.NettyServer$.main(NettyServer.scala:263)
     [play]     at play.core.server.NettyServer.main(NettyServer.scala)
     [play] Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.Context
     [play]     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
     [play]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     [play]     at java.security.AccessController.doPrivileged(Native Method)
     [play]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     [play]     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
     [play]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
     [play]     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
     [play]     ... 9 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

What version of the product are you using? On what operating system?
Mandriva x86_64 linux
Maven 3.0.3
play2-maven-plugin 1.0.0-alpha6
play_2.10 2.1.5

Please provide any additional information below.
I got this problem even if I added a dependency to logback-classic and 
logback-core in pom.xml.
When I run play ($ play run) without maven in the application directory it 
doesn not find some runtime dependencies. I guess it is normal because the 
dependencies are managed by maven, right ?

Original issue reported on code.google.com by hamouche...@gmail.com on 20 May 2014 at 4:49

GoogleCodeExporter commented 8 years ago
Hi

Can you attach sample project showing this bug or at least log file from "mvn 
play2:run -X" execution?

Answering your last question, if yo have "project" subdirectory with all 
required SBT project files and/or "build.sbt" file you can run Play/SBT 
commands. With proper "pom.xml" you can run Maven build. You can have both 
builds in one project, but they will not share any logic, Maven resolves 
dependencies defined in "pom.xml" file and SBT - "libraryDependencies" defined 
in "build.sbt", "project/Build.scala" (or any other file being a part of SBT 
build).

Original comment by gslowiko...@gmail.com on 20 May 2014 at 5:23

GoogleCodeExporter commented 8 years ago
Hi,
I resolved the problem ! The depnedncy scope of logback was set to 'test', so 
it was not included to the classpath of play run.
Thank you for your reply.

Original comment by hamouche...@gmail.com on 21 May 2014 at 1:05

GoogleCodeExporter commented 8 years ago

Original comment by gslowiko...@gmail.com on 21 May 2014 at 1:43