I am trying to deploy two or more independent Play! (1.2.4) based on the same instance of Jetty.
According to this post , apparently, you can extract the shared lib from each directory PrjName.war/WEB-INF/lib
and place them in the shared lib directory, i.e. jetty/lib/ext
.
We have a large number of small independent projects that we would like to implement using Play! but they must all be deployed in the same instance. Jetty uses all libraries to reduce the use of RAM. Is my assumption correct that multiple projects sharing the same lib will reduce the total memory?
My attempts to put all the libraries in a shared folder, i.e. jetty/lib/ext
, worked for one project, but the deployment of the second project failed and crashes the first.
The problem seems to be related to conflicting instances of EhCache.
Here is the jetty log:
... at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.jetty.start.Main.invokeMain(Main.java:469) at org.eclipse.jetty.start.Main.start(Main.java:612) at org.eclipse.jetty.start.Main.parseCommandLine(Main.java:265) at org.eclipse.jetty.start.Main.main(Main.java:79) Caused by: net.sf.ehcache.ObjectExistsException: Cache play already exists at net.sf.ehcache.CacheManager.addCache(CacheManager.java:859) at play.cache.EhCacheImpl.<init>(EhCacheImpl.java:32) at play.cache.EhCacheImpl.newInstance(EhCacheImpl.java:41) at play.cache.Cache.init(Cache.java:241) at play.Play.start(Play.java:511) ... 42 more
Any help is greatly appreciated.
Tino
source share