edeustace / assets-loader

a play plugin to help with asset loading.
MIT License
31 stars 8 forks source link

Uncaught error (akka) when running play in dist or stage mode #13

Closed edeustace closed 10 years ago

edeustace commented 10 years ago

Hey guys, I seem to have a similar problem:

2014-01-20 16:21:30,193 - [ERROR] - from akka.actor.ActorSystemImpl in play-akka.actor.default-dispatcher-2 
Uncaught error from thread [play-akka.actor.default-dispatcher-5] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError: null

https://gist.github.com/edeustace/8538424

Anybody any idea on what the issue may be? We're running:

val assetsLoader = "com.ee" %% "assets-loader" % "0.11.3"
val assetsLoaderReleases = "ed eustace" at "http://edeustace.com/repository/releases"

as the previous version caused other problems. The config:

prod : {
  concatenate: true
  minify: true
  gzip: true
}

Hi, I have created that sample project here: https://github.com/jkypet/assets-loader-test

It's generic play 2.2.1 application with these changes:

added dependency for assets-loader (project/Build.scala) changed default route for assets in routes file created Helper for templates (views/Helper.scala) added assetsLoader.conf added css and javascript loader in main.scala.html added new css and javascript file for testing purposes When I call RUN everything works, but with START and DIST I get the exception from previous comment.

edeustace commented 10 years ago

@jkypet

I just cloned that repo and ran:

play stage
./target/universal/stage/bin/assetloadertest

And when I ran the app I got an alert saying 'document is ready'

Let me know if I need to run it in a different way.

twiho commented 10 years ago

@jkypet @edeustace Hey guys, I can confirm that stage works for me, but dist does not. I run

play dist
cd target/universal/
unzip assetLoaderTest-1.0-SNAPSHOT.zip
./assetLoaderTest-1.0-SNAPSHOT/bin/assetloadertest

I get

Play server process ID is 3020
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play]
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: com.ee.assets.exceptions.AssetsLoaderException: Error can't find a class folder or exploded jar folder
    at com.ee.utils.play.package$$anonfun$initAssetsFolder$3.apply(package.scala:31)
    at com.ee.utils.play.package$$anonfun$initAssetsFolder$3.apply(package.scala:31)
    at scala.Option.getOrElse(Option.scala:120)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:31)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more
Caused by: java.lang.Throwable
    at com.ee.assets.exceptions.AssetsLoaderException.<init>(AssetsLoaderException.scala:4)
    ... 34 more
[ERROR] [01/21/2014 12:45:26.954] [play-akka.actor.default-dispatcher-6] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: com.ee.assets.exceptions.AssetsLoaderException: Error can't find a class folder or exploded jar folder
    at com.ee.utils.play.package$$anonfun$initAssetsFolder$3.apply(package.scala:31)
    at com.ee.utils.play.package$$anonfun$initAssetsFolder$3.apply(package.scala:31)
    at scala.Option.getOrElse(Option.scala:120)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:31)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more
Caused by: java.lang.Throwable
    at com.ee.assets.exceptions.AssetsLoaderException.<init>(AssetsLoaderException.scala:4)
    ... 34 more

Also when I run

play start

it gives me this:

Play server process ID is 3161
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play]
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NullPointerException
    at scala.collection.mutable.ArrayOps$ofRef$.newBuilder$extension(ArrayOps.scala:112)
    at scala.collection.mutable.ArrayOps$ofRef.newBuilder(ArrayOps.scala:108)
    at scala.collection.TraversableLike$class.filter(TraversableLike.scala:262)
    at scala.collection.mutable.ArrayOps$ofRef.filter(ArrayOps.scala:108)
    at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274)
    at scala.collection.mutable.ArrayOps$ofRef.filterNot(ArrayOps.scala:108)
    at com.ee.utils.play.package$.com$ee$utils$play$package$$loadFromScriptName$1(package.scala:66)
    at com.ee.utils.play.package$$anonfun$getAppJar$3.apply(package.scala:91)
    at com.ee.utils.play.package$$anonfun$getAppJar$3.apply(package.scala:91)
    at scala.Option.orElse(Option.scala:257)
    at com.ee.utils.play.package$.getAppJar(package.scala:91)
    at com.ee.utils.play.package$.explodedJarFolder(package.scala:100)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:26)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more
[ERROR] [01/21/2014 12:51:50.552] [play-akka.actor.default-dispatcher-6] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NullPointerException
    at scala.collection.mutable.ArrayOps$ofRef$.newBuilder$extension(ArrayOps.scala:112)
    at scala.collection.mutable.ArrayOps$ofRef.newBuilder(ArrayOps.scala:108)
    at scala.collection.TraversableLike$class.filter(TraversableLike.scala:262)
    at scala.collection.mutable.ArrayOps$ofRef.filter(ArrayOps.scala:108)
    at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274)
    at scala.collection.mutable.ArrayOps$ofRef.filterNot(ArrayOps.scala:108)
    at com.ee.utils.play.package$.com$ee$utils$play$package$$loadFromScriptName$1(package.scala:66)
    at com.ee.utils.play.package$$anonfun$getAppJar$3.apply(package.scala:91)
    at com.ee.utils.play.package$$anonfun$getAppJar$3.apply(package.scala:91)
    at scala.Option.orElse(Option.scala:257)
    at com.ee.utils.play.package$.getAppJar(package.scala:91)
    at com.ee.utils.play.package$.explodedJarFolder(package.scala:100)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:26)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more

[error] a.a.ActorSystemImpl - Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError: null
    at views.html.main$.apply(main.template.scala:36) ~[classes/:na]
    at views.html.index$.apply(index.template.scala:31) ~[classes/:na]
    at views.html.index$.render(index.template.scala:39) ~[classes/:na]
    at views.html.index.render(index.template.scala) ~[classes/:na]
    at controllers.Application.index(Application.java:11) ~[classes/:na]
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49) ~[classes/:na]
Caused by: java.lang.NullPointerException: null
    at scala.collection.mutable.ArrayOps$ofRef$.newBuilder$extension(ArrayOps.scala:112) ~[scala-library.jar:na]
    at scala.collection.mutable.ArrayOps$ofRef.newBuilder(ArrayOps.scala:108) ~[scala-library.jar:na]
    at scala.collection.TraversableLike$class.filter(TraversableLike.scala:262) ~[scala-library.jar:na]
    at scala.collection.mutable.ArrayOps$ofRef.filter(ArrayOps.scala:108) ~[scala-library.jar:na]
    at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274) ~[scala-library.jar:na]
    at scala.collection.mutable.ArrayOps$ofRef.filterNot(ArrayOps.scala:108) ~[scala-library.jar:na]

But! we've noticed, that when we clean first, i.e.

play clean
play start

It DOES run!

When I reload, clean, dist, it doesn't help. However, @jkypet noticed, that when the dist'ed app is run from the project's root, i.e.

./target/universal/assetLoaderTest-1.0-SNAPSHOT/bin/assetloadertest

It gives:

Play server process ID is 3397
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
/Users/twiho/devel/assets-loader-test
Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play]
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.io.FileNotFoundException: target/universal/stage/public/images/favicon.png (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
    at grizzled.file.util$.copyFile(util.scala:883)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:929)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:925)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
    at grizzled.file.util$.copyTree(util.scala:925)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:927)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:925)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
    at grizzled.file.util$.copyTree(util.scala:925)
    at grizzled.file.util$.copyTree(util.scala:904)
    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.devModeTidyUp$1(package.scala:120)[ERROR] [01/21/2014 13:00:07.385] [play-akka.actor.default-dispatcher-6] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError
    at views.html.main$.apply(main.template.scala:36)
    at views.html.index$.apply(index.template.scala:31)
    at views.html.index$.render(index.template.scala:39)
    at views.html.index.render(index.template.scala)
    at controllers.Application.index(Application.java:11)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49)
    at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183)
    at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
    at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
    at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
    at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
    at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.io.FileNotFoundException: target/universal/stage/public/images/favicon.png (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
    at grizzled.file.util$.copyFile(util.scala:883)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:929)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:925)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
    at grizzled.file.util$.copyTree(util.scala:925)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:927)
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:925)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
    at grizzled.file.util$.copyTree(util.scala:925)
    at grizzled.file.util$.copyTree(util.scala:904)
    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.devModeTidyUp$1(package.scala:120)
    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.apply(package.scala:126)
    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.apply(package.scala:101)
    at scala.Option.map(Option.scala:145)
    at com.ee.utils.play.package$.explodedJarFolder(package.scala:100)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:26)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more

    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.apply(package.scala:126)
    at com.ee.utils.play.package$$anonfun$explodedJarFolder$1.apply(package.scala:101)
    at scala.Option.map(Option.scala:145)
    at com.ee.utils.play.package$.explodedJarFolder(package.scala:100)
    at com.ee.utils.play.package$.initAssetsFolder(package.scala:26)
    at com.ee.utils.play.package$.assetsFolder(package.scala:17)
    at com.ee.assets.Loader.assetsFolder$lzycompute(Loader.scala:103)
    at com.ee.assets.Loader.assetsFolder(Loader.scala:103)
    at com.ee.assets.Loader.<init>(Loader.scala:40)
    at views.Helper$.<init>(Helper.scala:6)
    at views.Helper$.<clinit>(Helper.scala)
    ... 24 more
[error] a.a.ActorSystemImpl - Uncaught error from thread [play-akka.actor.default-dispatcher-6] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.ExceptionInInitializerError: null
    at views.html.main$.apply(main.template.scala:36) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
    at views.html.index$.apply(index.template.scala:31) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
    at views.html.index$.render(index.template.scala:39) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
    at views.html.index.render(index.template.scala) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
    at controllers.Application.index(Application.java:11) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:49) ~[assetloadertest.assetloadertest-1.0-SNAPSHOT.jar:na]
Caused by: java.io.FileNotFoundException: target/universal/stage/public/images/favicon.png (No such file or directory)
    at java.io.FileOutputStream.open(Native Method) ~[na:1.7.0_13]
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212) ~[na:1.7.0_13]
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165) ~[na:1.7.0_13]
    at grizzled.file.util$.copyFile(util.scala:883) ~[org.clapper.grizzled-scala_2.10-1.1.4.jar:1.1.4]
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:929) ~[org.clapper.grizzled-scala_2.10-1.1.4.jar:1.1.4]
    at grizzled.file.util$$anonfun$copyTree$1.apply(util.scala:925) ~[org.clapper.grizzled-scala_2.10-1.1.4.jar:1.1.4]

Please, notice the

Caused by: java.io.FileNotFoundException: target/universal/stage/public/images/favicon.png (No such file or directory)

In the last stack trace.

twiho commented 10 years ago

Also, me and @jkypet are both running osx - just a thought, may be connected?

edeustace commented 10 years ago

I'm osx too - will have a look.. cheers

On Tue, Jan 21, 2014 at 12:04 PM, Josef Pacula notifications@github.comwrote:

Also, me and @jkypet https://github.com/jkypet are both running osx - just a thought, may be connected?

— Reply to this email directly or view it on GitHubhttps://github.com/edeustace/assets-loader/issues/13#issuecomment-32864970 .

twiho commented 10 years ago

Last fun bit is that @jkypet discovered, that

play clean
play stage
play dist
unzip target/universal/assetLoaderTest-1.0-SNAPSHOT.zip
assetLoaderTest-1.0-SNAPSHOT/bin/assetloadertest

Does actually work (it creates the target/universal/stage/public/images/favicon.png file during stage)

edeustace commented 10 years ago

@twiho @jkypet - see the PR I just sent you - see if that's better.

https://github.com/jkypet/assets-loader-test/pull/1

jkypet commented 10 years ago

Both DIST and START work for me now. Thank you.

twiho commented 10 years ago

Thank you kindly ;)

On Tue, Jan 21, 2014 at 8:29 PM, ed eustace notifications@github.com wrote:

Closed #13.

Reply to this email directly or view it on GitHub: https://github.com/edeustace/assets-loader/issues/13

twiho commented 10 years ago

Hi @edeustace, so we've had this problem that our .css was cut in the middle with 0.11.2. We stumbled upon this thread and then upgraded to 0.11.3 - which solved the problem. Now again, with 0.11.4 when we use gzip, the .css file is empty, without gzip the .css file is cut in the middle again. Couldn't any of the fixes introduce that problem again? I'll try to replicate it with minimal project.

edeustace commented 10 years ago

can't rule out a regression... if you can create a test project I'll have a look. Does it apply to all modes aka dev, dist and stage?

On Wed, Jan 22, 2014 at 2:28 PM, Josef Pacula notifications@github.comwrote:

Hi @edeustace https://github.com/edeustace, so we've had this problem that our .css was cut in the middle with 0.11.2. We stumbled upon this thread and then upgraded to 0.11.3 - which solved the problem. Now again, with 0.11.4 when we use gzip, the .css file is empty, without gzip the .css file is cut in the middle again. Couldn't any of the fixes introduce that problem again? I'll try to replicate it with minimal project.

— Reply to this email directly or view it on GitHubhttps://github.com/edeustace/assets-loader/issues/13#issuecomment-33027217 .

jkypet commented 10 years ago

I think I know where is the problem:

I cloned my project again, then I ran stage. After running ./target/universal/stage/bin/assetloadertest command I opened browser and I got the alert... so everything worked. But after refreshing the page I got an exception.

I think the problem is in /target/universal/stage/public/stylesheets directory. After first load there are three test files and when I remove them it works (especially gziped file).

(test files are in javascript folder as well)

edeustace commented 10 years ago

So I can use assets-loader-test to reproduce? Just run the command twice?

On Wed, Jan 22, 2014 at 4:17 PM, Jakub Kypet notifications@github.comwrote:

I think I know where is the problem:

I cloned my project again, then I ran stage. After running ./target/universal/stage/bin/assetloadertest command I opened browser and I got the alert... so everything worked. But after refreshing the page I got an exception.

I think the problem is in /target/universal/stage/public/stylesheets directory. After first load there are three test files and when I remove them it works (especially gziped file).

(test files are in javascript folder as well)

— Reply to this email directly or view it on GitHubhttps://github.com/edeustace/assets-loader/issues/13#issuecomment-33038573 .

jkypet commented 10 years ago

Yes. After first successful load just hit refresh. Thanks. (And you can also check if that folder contains those files)

edeustace commented 10 years ago

I see what the problem is - the generated files are being added to the source folders so are being factored in for processing, which throws errors. will look to fix in the morning.

edeustace commented 10 years ago

@twiho @jkypet - try 11.5-SNAPSHOT now.

edeustace commented 10 years ago

Going to close this issue - comment if its still an issue and I'll reopen.

jkypet commented 10 years ago

Sorry for no response. I've tried v0.11.6 and it seems to be working for each environment. But I have some problems with paths for javascript and stylesheets.

For example when I use this (I have only one css file with name style.css): @views.Helper.loader.css("some_name")("stylesheets/style.css").body

I get incorrect path: BASE_URL/assets/stylesheets/style.css/some_name-0123456789.min.gz.css

edeustace commented 10 years ago

Np - odd - if you add a failing example to assets-loader-test I'll have a look.

On Mon, Jan 27, 2014 at 1:34 PM, Jakub Kypet notifications@github.comwrote:

Sorry for no response. I've tried v0.11.6 and it seems to be working for each environment. But I have some problems with paths for javascript and stylesheets.

For example when I use this (I have only one css file with name style.css): _@views.Helper.loader.css("somename")("stylesheets/style.css").body

I get incorrect path: _BASE_URL/assets/stylesheets/style.css/somename-0123456789.min.gz.css

— Reply to this email directly or view it on GitHubhttps://github.com/edeustace/assets-loader/issues/13#issuecomment-33367426 .

jkypet commented 10 years ago

I've just pushed changes to project. It looks like when only one css file is defined it generates incorrect path. When I put there @views.Helper.loader.css("test")("stylesheets/style.css", "stylesheets/main.css").body it works.

When you run play start you can see in browser's code inspector in sources tab path : assets/stylesheets/styles.css/stylesheets/

edeustace commented 10 years ago

Moved the last few comments to #16

kalyan220 commented 9 years ago

I am using play 2.2.6 with java 1.6 and mongodb. I am facing the same issue what I have to do?

edeustace commented 9 years ago

@kalyan220 - can you supply a test app that fails with instructions on how to reproduce? Ed

WhiteboxHub commented 7 years ago

i am using play 2.2.6 with java 1.7 ,,,i am facing this error ....tried a lot solve..but did not found the solution...please suggest to get out of this. Uncaught error from thread [play-akka.actor.default-dispatcher-7] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play] java.lang.NoClassDefFoundError: org/apache/pdfbox/util/PDFTextStripper at java.lang.ClassLoader.defineClass1(Native Method) [ERROR] [02/13/2017 11:36:47.282] [play-akka.actor.default-dispatcher-7] [ActorSystem(play)] Uncaught error from thread [play-ak at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ka.actor.default-dispatcher-7] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) java.lang.NoClassDefFoundError: org/apache/pdfbox/util/PDFTextStripper at java.lang.ClassLoader.defineClass1(Native Method) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.security.AccessController.doPrivileged(Native Method)