Hi Alejandro,
Thank you for reporting this. JPublish before the new commit ;) was
using the 'default' cache name for the Template Manager. I changed
that and now the user can safely define and manage his own cache
details. I strongly recommend Ehcache but in this case please avoid
naming your JPublish cache anme: 'default'.
When using Ehcache, these are the steps for creating a custom cache
and use it in JPublish.
- create a ehcache.xml file in WEB-INF/class (or edit the file that
comes with JPublish demos) and define a new cache, let's say:
'simpleCache'. Example:
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="620"
timeToLiveSeconds="820"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
/>
<!-- the new cache -->
<cache name="simpleCache"
maxElementsInMemory="500"
eternal="false"
timeToIdleSeconds="320"
timeToLiveSeconds="420"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="60"
/>
</ehcache>
- use the newly created cache: 'simpleCache', in the jpublish.xml.
Example:
<cache-manager>
<jpublish.cache.provider>
<implementation name="simpleCache"
class="org.jpublish.util.JPublishCacheImpl"/>
</jpublish.cache.provider>
</cache-manager>
...
<repository name="fs_repository"
classname="org.jpublish.repository.filesystem.FileSystemRepository">
<root>WEB-INF/content</root>
<cache>simpleCache</cache>
</repository>
<repository name="includes"
classname="org.jpublish.repository.filesystem.ExtendedFileSystemRepository">
<root>WEB-INF/includes</root>
<cache>simpleCache</cache>
</repository>
...
With the configuration above and when JPublish is loading, you'll see
something like this:
INFO 10-07-19 11:23:04,190| Initializing JPublish servlet; 4.0
INFO 10-07-19 11:23:04,459| New cache definition: simpleCache
INFO 10-07-19 11:23:04,753| cache created...
INFO 10-07-19 11:23:09,713| The JPublish Template Manager is using
the: simpleCache cache.
All these changes are now in the svn, therefore please build a new
JPublish from the sources and let us know how it works.
V/r
-florin