Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error when accessing assets files on JBoss only #301

Closed
oarshad opened this issue Jan 27, 2016 · 5 comments
Closed

500 Error when accessing assets files on JBoss only #301

oarshad opened this issue Jan 27, 2016 · 5 comments

Comments

@oarshad
Copy link

oarshad commented Jan 27, 2016

I have created a simple app using Play 2.4.6 and packaged it using 1.4-beta1 version of play-2-war plugin and deployed on JBoss 7 (Enterprise 6.4.0.GA). Pages and requests load correctly however I cannot access any files from assets folder and it gives 500 Internal Error.

I deployed the same war on Tomcat 7 and it worked perfectly fine even all files from assets folder.

Then I recreated the same app in Play 2.2.4 and packaged it using 1.21 version of play-2-war plugin, deployed on JBoss 7 and then it works fine.

Issue with assets files with 1.4-beta1 version on JBoss 7.

@dlecan
Copy link
Member

dlecan commented Jan 29, 2016

Any visible errors on JBoss EAP ?
Without stacktraces or error messages, it won't be possible to help you.

@oarshad
Copy link
Author

oarshad commented Feb 1, 2016

This is another problem I am having that I am not being able to enable any type of logging in JBoss with play application. Well anyway I tried to print the stack trace on the page itself and got the following message:

java.lang.NoClassDefFoundError: sun/net/www/protocol/file/FileURLConnection

@oarshad
Copy link
Author

oarshad commented Feb 1, 2016

This is complete stack trace:

    java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/net/www/protocol/file/FileURLConnection
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:498)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:104)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:103)
at scala.Option.map(Option.scala:146)
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:103)
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:96)
at play.api.libs.iteratee.DoneIteratee$$anonfun$mapM$2.apply(Iteratee.scala:741)
at play.api.libs.iteratee.DoneIteratee$$anonfun$mapM$2.apply(Iteratee.scala:741)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
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.NoClassDefFoundError: sun/net/www/protocol/file/FileURLConnection
at play.utils.Resources$.isUrlConnectionADirectory(Resources.scala:31)
at controllers.AssetsBuilder$$anonfun$19.apply(Assets.scala:450)
at controllers.AssetsBuilder$$anonfun$19.apply(Assets.scala:446)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.scala$concurrent$impl$Promise$DefaultPromise$$dispatchOrAddCallback(Promise.scala:280)
at scala.concurrent.impl.Promise$DefaultPromise.onComplete(Promise.scala:270)
at scala.concurrent.Future$class.flatMap(Future.scala:249)
at scala.concurrent.impl.Promise$DefaultPromise.flatMap(Promise.scala:153)
at controllers.AssetsBuilder.controllers$AssetsBuilder$$assetAt(Assets.scala:446)
at controllers.AssetsBuilder$$anonfun$versioned$1.apply(Assets.scala:419)
at controllers.AssetsBuilder$$anonfun$versioned$1.apply(Assets.scala:409)
at play.api.mvc.Action$.invokeBlock(Action.scala:533)
at play.api.mvc.Action$.invokeBlock(Action.scala:530)
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:493)
... 18 more

@oarshad
Copy link
Author

oarshad commented Feb 2, 2016

I managed to fix this problem by making some JBoss configuration changes based on this blog:

http://planet.jboss.org/post/dealing_with_sun_jdk_related_noclassdeffounderror_under_jboss

@oarshad oarshad closed this as completed Feb 2, 2016
@dlecan
Copy link
Member

dlecan commented Feb 3, 2016

Great, thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants