[2.0 RC3] One-jar regression?

200 views
Skip to first unread message

Dan Hopkins

unread,
Mar 1, 2012, 12:10:49 PM3/1/12
to play-fr...@googlegroups.com
Hey guys,

I had sbt-one-jar setup on 2.0 beta but am now getting an error about loading ehcache.xml.

Anyone have ideas on how to fix this?

A simple way to test is: create a new play project.

Edit the plugins.sbt and add:

resolvers += Resolver.url(
  "sbt-plugin-releases",
)(Resolver.ivyStylePatterns)

addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.7")

libraryDependencies += "commons-lang" % "commons-lang" % "2.6"


Edit Build.scala so that main play project looks like this:

val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA,
      settings = standardSettings ++ SbtOneJar.oneJarSettings
    )

Run "play one-jar" and then "java -jar target/scala/2.9.1/YOURAPP.jar"

I get an error like this:

Play server process ID is 41418
Oops, cannot start the server.
net.sf.ehcache.CacheException: Error configuring from jar:file:/emailscorer-application.jar!/lib/play_2.9.1.jar!//ehcache.xml. Initial cause was Error configuring from input stream. Initial cause was null
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:103)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:138)
at net.sf.ehcache.CacheManager.create(CacheManager.java:743)
at play.api.cache.EhCachePlugin.x$3(Cache.scala:110)
at play.api.cache.EhCachePlugin.cache(Cache.scala:109)
at play.api.cache.EhCachePlugin.onStart(Cache.scala:127)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)

I tried baking in the ehcache.xml into the conf directory but it still can't find it.

I know this isn't strictly a play issue but any pointers would be helpful.

Thanks!
Dan

Olivier Refalo

unread,
Mar 11, 2012, 8:45:50 AM3/11/12
to play-fr...@googlegroups.com
did you eventually get this to work ?

Dan Hopkins

unread,
Mar 11, 2012, 3:24:10 PM3/11/12
to play-fr...@googlegroups.com
I wasn't able to get it to work and ended up switching to a brute force jar strategy. This extracts all the jars, merges them and rejars it.

This is much less optimal because it stomps files with the same name. For right now it's all I have gotten working.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/U102BDu8NucJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Olivier Refalo

unread,
Mar 11, 2012, 5:11:56 PM3/11/12
to play-fr...@googlegroups.com
k tks
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

tomonori takao

unread,
Mar 7, 2013, 5:12:36 AM3/7/13
to play-fr...@googlegroups.com
Hi.
you can solve this problem, if your application  doesn't require ehcache,or depends on other cache plugin (ex memcached).
you only need to add a configuraton "ehcacheplugin=disabled"  to  YOUR_APP_DIR/conf/application.conf

My environment
OS    : Amazon Linux AMI (compatible CentOS)
java   : 1.6.0_24
scala : 2.10.0
play   : 2.1.0
application : simple Scala application


Reply all
Reply to author
Forward
0 new messages