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
NoClassDefFoundError with Play 2.0.4 release #4
Comments
Upgrade the plugin to 0.4.9 should resolve that |
In trying to run this in Prod mode I get the following: [warn] module not found: org.jba#play2-mustache_2.9.1;0.4.9 Thanks again for help with this. -nathan From: julien <notifications@github.commailto:notifications@github.com> Upgrade the plugin to 0.4.9 should resolve that — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
sorry, can you retry please? |
Looks good. Thanks. From: julien <notifications@github.commailto:notifications@github.com> sorry, can you retry please. I upload it to the wrong place — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
Hi Julien, I am seeing another issue I thought I should bring to your attention. We are in the process of testing our deployment in a production setting, so we are calling the "dist" target and then pushing the zip to a production environment and unzipping and calling the "start" command. We get the following error upon starting the app: java.lang.NullPointerException The error is a result of the mustache templates under views/mustache not being added to the jar in the "dist" command. Is this something that can be fixed quickly? Thanks for any help with this. -nathan sorry, can you retry please. I upload it to the wrong place — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
Hi, no idea about that. I use only "clean compile stage" for deploy in prod Regards, 2012/10/11 nsullinsmnp notifications@github.com
|
Hi again, I appreciate all your help with this. I wanted to provide some more information. First, when you run the Play/SBT command dist it packages your application and all its dependencies into a zip that you can publish to a server and as long as that server has java installed it can run your application without any dependencies on Play being installed or Git for that matter. In our production environments this is essential because we can't have git or any source code on the box. Secondly, the dist command defined by the Play plugin isn't copying over the mustache templates. I'm looking to see if there is any configuration I can provide to have it do so. If I find anything I will let you know. Thanks, From: julien <notifications@github.commailto:notifications@github.com> Hi, no idea about that. I use only "clean compile stage" for deploy in prod Regards, 2012/10/11 nsullinsmnp <notifications@github.commailto:notifications@github.com>
— This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
HI again, First of all, thanks again for your attention to this. I have some more information that I wanted to provide you that I think should be helpful. I made some changes to my build and now the mustache templates are packaged with jar. Here's a snippet: val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
).settings(
) However, I'm still getting the same error. Here's how the jar looks after calling "dist". You can see that the templates are at the bottom and available. I looked at your code and see where the failure is happening. private val rootPath = Play.current.path + fs + "app" + fs + "views"+ fs + "mustache" The line above represents a path not found in the application after "dist". I think there should be a check if this path exists and if not then should look for a relative like "." fs + "views"+ fs + "mustache" [cid:08AE7E35-A658-456D-9D3C-D1BE313B7821] Again, thanks for any help with this. -nathan From: julien <notifications@github.commailto:notifications@github.com> Hi, no idea about that. I use only "clean compile stage" for deploy in prod Regards, 2012/10/11 nsullinsmnp <notifications@github.commailto:notifications@github.com>
— This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
Hi, A dirty workaround is to copy "app/views/mustache" directory in "dist/{appName}/app/views/mustache", not elegant but it's works. The problem is that the mustache template is not in the final jar because Play considers that there can be only scala templates in this directory, a workaround is to move mustache template in public directory. But this is not enough, because the plugin needs to list all the files under the mustache directory. Unfortunately, I don't think it's possible to do that in a jar file, so it's required to include template on the zip but not in a jar. The solution is probably to tweak something in distTask. I will continue to investigate this in a new issue... |
Hi again, This is definitely a dirty hack. Do you have an ETA for a fix? Thanks, From: julien <notifications@github.commailto:notifications@github.com> Hi, A dirty workaround is to copy "app/views/mustache" directory in "dist/{appName}/app/views/mustache", not elegant but it's works. The problem is that the mustache template is not in the final jar because Play considers that there can be only scala templates in this directory, a workaround is to move mustache template in public directory. But this is not enough, because the plugin needs to list all the files under the mustache directory. Unfortunately, I don't think it's possible to do that in a jar file, so it's required to include template on the zip but not in a jar. The solution is probably to tweak something in distTask. I will continue to investigate this in a new issue... — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
No. |
Cool. So I will wait for the new plugin and use the dirty hack for the interim. What's the plugin named you're working on? Is it available on Github? Thanks for all of your help, From: julien <notifications@github.commailto:notifications@github.com> No. — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
Upgrade to 1.0.0, should work more cleanly. Be sure to read the README, because they are new settings in plugins.sbt, Build.scala and with the asset stuff |
Thanks. That did the trick. I needed to modify the following to get everything to work. In this JS var we are passing in the template from the template, so we don't need the key. var PlayMustache = function(){ var meta = window.__MUSTACHE_TEMPLATES; return { to_html: function (tmpl, context) {
for (var i = 0, len = (rawPartials == null ? 0 : rawPartials.length); i < len; i++) {
} } }(); -nathan From: julien <notifications@github.commailto:notifications@github.com> Upgrade to 1.0.0, should work more cleanly. Be sure to read the README, because they are new settings in plugins.sbt, Build.scala and with the asset stuff — This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message. |
I get the following error with the latest Play! version.
[NoClassDefFoundError: org/apache/commons/lang/StringEscapeUtils]
The text was updated successfully, but these errors were encountered: