Pregunta

I am getting this error on any POST request when I include my set of unmanaged jars in the lib directory. If I remove the lib directory, everything works fine. If it's there, I get this error.. Any ideas?

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[NoSuchMethodError: org.apache.commons.io.IOUtils.closeQuietly(Ljava/io/Closeable;)V]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2]
Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.closeQuietly(Ljava/io/Closeable;)V
at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1150) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1091) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038) ~[commons-io-2.4.jar:2.4]
at controllers.IAcontroller.submit(IAcontroller.java:161) ~[classes/:na]
at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:132) ~[classes/:na]
at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:132) ~[classes/:na]
¿Fue útil?

Solución

AFAIK, Play 2.0.4 contains commons-io:commons-io:2.0.1 through selenium which is itself brought by fluentlenium. And I suspect that you have imported a different version of commons-io in your lib folder.

You can check this by using dependencies on the Play console:

[my_project] $ dependencies
...
| commons-io:commons-io:2.0.1 | org.seleniumhq.selenium:selenium-firefox-driver:2.16.1 | As commons-io.jar |
...
[my_project] $

So either remove the dependency from Play (if you are not using fluentlenium), either from your lib directory.

To remove the transitive dependency from fluentlenium, edit your Build.scala with:

val appDependencies = Seq(
     ...
     ("org.fluentlenium" % "fluentlenium-festassert" % "0.5.6" % "test") .exclude("commons-io", "commons-io")
    )
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top