As far as I can tell, the EHCache config file (ehcache.xml) should go into 
WEB-INF/classes, as EHCache expects its configuration to be on the CLASSPATH. 
Other than that, everything looks fine to me.

The Castor error message you are getting simply indicates that (during an 
update operation, i.e. a re-attachement) Castor is not able to find an object 
with the given identity in its cache(s).

Werner Guttmann

PS You might as well look for log statements that happen during startup of your 
web application that e.g. indicate that EHCache cannot be initialized properly.
________________________________________
Von: Gonzalo Abollado [mailto:[EMAIL PROTECTED] 
Gesendet: Sonntag, 15. April 2007 23:50
An: dev@castor.codehaus.org
Betreff: [castor-dev] Ehcache basic configuration

Hello,

I´m trying to add Ehcache (or any distributed cache solution in case you can 
recommend one) to Castor in a Tomcat environment (J2EE). I´m looking everywhere 
and I don´t manage to find the right docs and I´m not sure if I have configured 
correctly and how to find out. Can you please point me to the right docs or 
give me some clues to configure?

I have added the ehcache-1.2.4.jar to the lib directory and the ehcache.xml and 
ehcache.xsd to the WEB-INF and I have added <cache-type type="ehcache"/> to 
every xml map file.
These are the ehcache.xml properties I have:

<diskStore path="java.io.tmpdir"/>

<cacheManagerEventListenerFactory class="" properties=""/>

<cacheManagerPeerProviderFactory
            
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
            properties="peerDiscovery=automatic,
                        multicastGroupAddress=230.0.0.1,
                        multicastGroupPort=4446, timeToLive=1"/>

    <cacheManagerPeerListenerFactory
            
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>


    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="false"
            maxElementsOnDisk="10000000"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />


I´m running the ehcache debugger and I don´t see any information.
java -jar ehcache-1.2.4-remote-debugger.jar ehcache.xml

This is the info get, and as you can see there are no caches...

13-abr-2007 11:28:57 net.sf.ehcache.distribution.RemoteDebugger main
INFO: Increase the net.sf.ehcache.distribution logging level to debug or trace 
to see distributed cache operations as they occur.
13-abr-2007 11:29:00 net.sf.ehcache.distribution.RemoteDebugger main
INFO: Available caches are:



And if I try to update an object I get this exception:

org.exolab.castor.jdo.PersistenceException: No timestamp information for object 
com.mbook.base.UserBase with identity <2(2)> available in cache (anymore).
            at 
org.exolab.castor.persist.ClassMolder.update(ClassMolder.java:888)
            at org.exolab.castor.persist.LockEngine.update(LockEngine.java:685)
            at 
org.castor.persist.AbstractTransactionContext.markUpdate(AbstractTransactionContext.java:913)
            at 
org.castor.persist.AbstractTransactionContext.update(AbstractTransactionContext.java:966)
            at 
org.exolab.castor.jdo.engine.AbstractDatabaseImpl.update(AbstractDatabaseImpl.java:337)




Do I have to add a cache with a specific name any where? Any specific 
properties? Do I need to add anything in the castor.properties?
Can you please give me a hand?

Thanks a lot and best regards,
Gonzalo Abollado.

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to