Cache configuration

6 views
Skip to first unread message

Alejandro Revilla

unread,
Jul 19, 2010, 9:13:35 AM7/19/10
to jpubli...@googlegroups.com
Hi,

I'm using org.jpublish.util.JPublishCacheImpl and I wonder if it's possible to get rid of the warning at start-up (not a big deal, though, just curious to know if there's an easy way).

WARN JPublishCacheImpl:62 - Could not find a valid configuration for: default, using the 'defaultCache' definition.

(BTW, I'm using latest & greatest r266)

Florin

unread,
Jul 19, 2010, 11:46:22 AM7/19/10
to JPublish User Group
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

Alejandro Revilla

unread,
Jul 19, 2010, 11:58:52 AM7/19/10
to jpubli...@googlegroups.com
Excellent. That did it. Thank you! (that was fast!)

--
You received this message because you are subscribed to the Google Groups "JPublish User Group" group.
To post to this group, send email to jpubli...@googlegroups.com.
To unsubscribe from this group, send email to jpublish-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jpublish-user?hl=en.


Florin

unread,
Jul 19, 2010, 12:22:42 PM7/19/10
to JPublish User Group
You are very welcome and I am glad it now works as expected.

:)


On Jul 19, 11:58 am, Alejandro Revilla <a...@jpos.org> wrote:
> Excellent. That did it. Thank you! (that was fast!)
>
> > jpublish-use...@googlegroups.com<jpublish-user%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages