I'm trying to deploy two or more independent Play! (1.2.4) based projects to the same Jetty instance.
According to this post it apparently is possible to extract the
common lib's from each PrjName.war/WEB-INF/lib
directory and place
them into a shared lib directory i.e. jetty/lib/ext
.
We have a large number of smaller independent projects that we would like to implement using Play! but all need to be deployed in the same Jetty instance sharing all the libs to reduce RAM usage. Is my assumption correct that several projects sharing the same lib's will reduce the overall memory footprint?
My attempts putting all the libs in a shared location i.e. jetty/lib/ext
worked for a single project but deploying the second project fails
and breaks the first one.
It appears to be an issue with conflicting EhCache instances.
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.