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

NoClassDefFoundError with Play 2.0.4 release #4

Closed
ghost opened this issue Oct 3, 2012 · 14 comments
Closed

NoClassDefFoundError with Play 2.0.4 release #4

ghost opened this issue Oct 3, 2012 · 14 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2012

I get the following error with the latest Play! version.

[NoClassDefFoundError: org/apache/commons/lang/StringEscapeUtils]

@julienba
Copy link
Owner

julienba commented Oct 9, 2012

Upgrade the plugin to 0.4.9 should resolve that

@ghost
Copy link
Author

ghost commented Oct 9, 2012

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
[warn] ==== local: tried
[warn] /usr/local/bin/../Cellar/play/2.0.4/bin/../libexec/framework/../repository/local/org.jba/play2-mustache_2.9.1/0.4.9/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/jba/play2-mustache_2.9.1/0.4.9/play2-mustache_2.9.1-0.4.9.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/org/jba/play2-mustache_2.9.1/0.4.9/play2-mustache_2.9.1-0.4.9.pom
[warn] ==== sonatype snapshots: tried
[warn] http://oss.sonatype.org/content/repositories/snapshots/org/jba/play2-mustache_2.9.1/0.4.9/play2-mustache_2.9.1-0.4.9.pom
[warn] ==== julienba.github.com: tried
[warn] http://julienba.github.com/repo/org.jba/play2-mustache_2.9.1/0.4.9/ivys/ivy.xml
[warn] ==== projects: tried
[warn] file:/Users/init/git/lib/play2-mustache_2.9.1-0.4.9.jar
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/jba/play2-mustache_2.9.1/0.4.9/play2-mustache_2.9.1-0.4.9.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.jba#play2-mustache_2.9.1;0.4.9: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/init/git/consumer/cons-play/consumer/}consumer/*:update: sbt.ResolveException: unresolved dependency: org.jba#play2-mustache_2.9.1;0.4.9: not found

Thanks again for help with this.

-nathan

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, October 9, 2012 12:59 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

Upgrade the plugin to 0.4.9 should resolve that


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9276697.


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.

@julienba
Copy link
Owner

julienba commented Oct 9, 2012

sorry, can you retry please?
I upload it to the wrong place

@ghost
Copy link
Author

ghost commented Oct 9, 2012

Looks good. Thanks.

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, October 9, 2012 1:25 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

sorry, can you retry please. I upload it to the wrong place


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9277899.


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.

@julienba julienba closed this as completed Oct 9, 2012
@ghost
Copy link
Author

ghost commented Oct 10, 2012

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
at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:115)
at scala.collection.IndexedSeqLike$class.iterator(IndexedSeqLike.scala:90)
at scala.collection.mutable.ArrayOps.iterator(ArrayOps.scala:38)
at org.jba.JavaMustache.jsTemplate(Mustache.scala:60)
at org.jba.JavaMustache.(Mustache.scala:50)
at org.jba.MustachePlugin.instance(Mustache.scala:17)
at org.jba.MustachePlugin.onStart(Mustache.scala:24)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at play.api.Play$.start(Play.scala:60)
at play.core.StaticApplication.(ApplicationProvider.scala:51)
at play.core.server.NettyServer$.createServer(NettyServer.scala:133)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:162)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:161)
at scala.Option.map(Option.scala:133)
at play.core.server.NettyServer$.main(NettyServer.scala:161)
at play.core.server.NettyServer.main(NettyServer.scala)

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
From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Tuesday, October 9, 2012 1:25 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

sorry, can you retry please. I upload it to the wrong place


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9277899.


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.

@julienba
Copy link
Owner

Hi,

no idea about that. I use only "clean compile stage" for deploy in prod
mode. I plan to investigate that and your other issues this weekend

Regards,
Julien

2012/10/11 nsullinsmnp notifications@github.com

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
at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:115)
at scala.collection.IndexedSeqLike$class.iterator(IndexedSeqLike.scala:90)
at scala.collection.mutable.ArrayOps.iterator(ArrayOps.scala:38)
at org.jba.JavaMustache.jsTemplate(Mustache.scala:60)
at org.jba.JavaMustache.(Mustache.scala:50)
at org.jba.MustachePlugin.instance(Mustache.scala:17)
at org.jba.MustachePlugin.onStart(Mustache.scala:24)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)

at scala.collection.immutable.List.foreach(List.scala:45)
at play.api.Play$.start(Play.scala:60)
at play.core.StaticApplication.(ApplicationProvider.scala:51)
at play.core.server.NettyServer$.createServer(NettyServer.scala:133)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:162)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:161)
at scala.Option.map(Option.scala:133)
at play.core.server.NettyServer$.main(NettyServer.scala:161)
at play.core.server.NettyServer.main(NettyServer.scala)

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
From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.com<mailto:
reply@reply.github.com>>
Date: Tuesday, October 9, 2012 1:25 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.com<mailto:
play2-mustache@noreply.github.com>>
Cc: Nathan Sullins <nathan.sullins@realpage.com<mailto:
nathan.sullins@realpage.com>>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release
(#4)

sorry, can you retry please. I upload it to the wrong place


Reply to this email directly or view it on GitHub<
https://github.com/julienba/play2-mustache/issues/4#issuecomment-9277899>.


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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9323571.

@ghost
Copy link
Author

ghost commented Oct 11, 2012

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,
nathan

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Thursday, October 11, 2012 12:33 AM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

Hi,

no idea about that. I use only "clean compile stage" for deploy in prod
mode. I plan to investigate that and your other issues this weekend

Regards,
Julien

2012/10/11 nsullinsmnp <notifications@github.commailto:notifications@github.com>

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
at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:115)
at scala.collection.IndexedSeqLike$class.iterator(IndexedSeqLike.scala:90)
at scala.collection.mutable.ArrayOps.iterator(ArrayOps.scala:38)
at org.jba.JavaMustache.jsTemplate(Mustache.scala:60)
at org.jba.JavaMustache.(Mustache.scala:50)
at org.jba.MustachePlugin.instance(Mustache.scala:17)
at org.jba.MustachePlugin.onStart(Mustache.scala:24)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)

at scala.collection.immutable.List.foreach(List.scala:45)
at play.api.Play$.start(Play.scala:60)
at play.core.StaticApplication.(ApplicationProvider.scala:51)
at play.core.server.NettyServer$.createServer(NettyServer.scala:133)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:162)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:161)
at scala.Option.map(Option.scala:133)
at play.core.server.NettyServer$.main(NettyServer.scala:161)
at play.core.server.NettyServer.main(NettyServer.scala)

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
From: julien <notifications@github.commailto:notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com<mailto:
reply@reply.github.commailto:reply@reply.github.com>>
Date: Tuesday, October 9, 2012 1:25 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com<mailto:
play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com<mailto:
nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release
(#4)

sorry, can you retry please. I upload it to the wrong place


Reply to this email directly or view it on GitHub<
https://github.com/julienba/play2-mustache/issues/4#issuecomment-9277899>.


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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9323571.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9331116.


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.

@ghost
Copy link
Author

ghost commented Oct 12, 2012

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(

  // Add your own project settings here

  lessEntryPoints <<= baseDirectory(customLessEntryPoints),



  resolvers += "sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",

  resolvers += Resolver.url("julienba.github.com", url("http://julienba.github.com/repo/"))(Resolver.ivyStylePatterns),

  resolvers += Resolver.url("projects", url("file:" + System.getProperty("user.home") + "/git/lib/"))(Patterns("[module]-[revision].jar")),



  externalResolvers <<= resolvers map { rs =>

  Resolver.withDefaultResolvers(rs, mavenCentral = true, scalaTools = true)

  },



  templatesImport += "org.jba.Mustache"

).settings(

  mappings in (Compile, packageBin) ~= { ms =>

    val mustacheStuff = Seq(//will need to loop through files but adding this for now as quick fix

        (file(".") / "app/views/mustache/search_property.html") -> "views/mustache/search_property.html"

    )

    ms ++ mustacheStuff

  }

)

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>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Thursday, October 11, 2012 12:33 AM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

Hi,

no idea about that. I use only "clean compile stage" for deploy in prod
mode. I plan to investigate that and your other issues this weekend

Regards,
Julien

2012/10/11 nsullinsmnp <notifications@github.commailto:notifications@github.com>

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
at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:115)
at scala.collection.IndexedSeqLike$class.iterator(IndexedSeqLike.scala:90)
at scala.collection.mutable.ArrayOps.iterator(ArrayOps.scala:38)
at org.jba.JavaMustache.jsTemplate(Mustache.scala:60)
at org.jba.JavaMustache.(Mustache.scala:50)
at org.jba.MustachePlugin.instance(Mustache.scala:17)
at org.jba.MustachePlugin.onStart(Mustache.scala:24)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)

at scala.collection.immutable.List.foreach(List.scala:45)
at play.api.Play$.start(Play.scala:60)
at play.core.StaticApplication.(ApplicationProvider.scala:51)
at play.core.server.NettyServer$.createServer(NettyServer.scala:133)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:162)
at
play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:161)
at scala.Option.map(Option.scala:133)
at play.core.server.NettyServer$.main(NettyServer.scala:161)
at play.core.server.NettyServer.main(NettyServer.scala)

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
From: julien <notifications@github.commailto:notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com<mailto:
reply@reply.github.commailto:reply@reply.github.com>>
Date: Tuesday, October 9, 2012 1:25 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com<mailto:
play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com<mailto:
nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release
(#4)

sorry, can you retry please. I upload it to the wrong place


Reply to this email directly or view it on GitHub<
https://github.com/julienba/play2-mustache/issues/4#issuecomment-9277899>.


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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9323571.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9331116.


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.

@julienba
Copy link
Owner

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...

@ghost
Copy link
Author

ghost commented Oct 22, 2012

Hi again,

This is definitely a dirty hack. Do you have an ETA for a fix?

Thanks,
nathan

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Sunday, October 14, 2012 1:40 PM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

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...


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9426749.


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.

@julienba
Copy link
Owner

No.
I work on a SBT plugin that compile mustache template like the AssetCompiler does for LESS

@ghost
Copy link
Author

ghost commented Oct 22, 2012

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,
nathan

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, October 22, 2012 12:40 AM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

No.
I work on a SBT plugin that compile mustache template like the AssetCompiler does for LESS


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-9654969.


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.

@julienba
Copy link
Owner

julienba commented Nov 3, 2012

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

@ghost
Copy link
Author

ghost commented Nov 4, 2012

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) {

        var partials = {};

        var pattern = new RegExp("{{>([\w\s\/_]+)}}","g");

        //var rawPartials = tmpl.match(/{{>([\w\s\d/_]+)}}/g);

        var rawPartials = tmpl.match(pattern);

for (var i = 0, len = (rawPartials == null ? 0 : rawPartials.length); i < len; i++) {

            if (typeof rawPartials[i] == 'undefined') break;

            var key = rawPartials[i].replace("{{>", "").replace("}}", "");

            var name = key.substr(key.lastIndexOf('/') + 1);

            partials[key] = meta[name + '.html'];

        }

        return Mustache.to_html(tmpl, context, partials);

}

}

}();

-nathan

From: julien <notifications@github.commailto:notifications@github.com>
Reply-To: julienba/play2-mustache <reply@reply.github.commailto:reply@reply.github.com>
Date: Saturday, November 3, 2012 9:02 AM
To: julienba/play2-mustache <play2-mustache@noreply.github.commailto:play2-mustache@noreply.github.com>
Cc: Nathan Sullins <nathan.sullins@realpage.commailto:nathan.sullins@realpage.com>
Subject: Re: [play2-mustache] NoClassDefFoundError with Play 2.0.4 release (#4)

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


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-10040774.


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.

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

1 participant