-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: EvictionPolicyConfig not recognized in Tomcat
PostPosted: Tue Dec 07, 2004 6:54 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 5:20 pm
Posts: 43
If I understand correctly I should be able to use jboss-cache with a standard Tomcat 5.0.x servlet container (i.e. not the JBoss app server). I need to do this so that I may run two separate Tomcat machines as a cluster for improved availability.


Things work great with ehcache, but when I switch the configuration to jboss-cache 1.1.1 (the one included with Hibernate 2.1.7) I am having the problems.

It does not appear to find my Eviction Policy config - though it is clearly there. I have re-read the Hibernate in Action section several times, run the jboss-cache demos, etc. Still do not seem my problem.

Thanks for any ideas at all - Richard

Hibernate version:
2.1.7

Mapping documents:
First the hibernate.cfg.xml, then treecache.xml
hibernate.cfg.xml BEGIN:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="jta.UserTransaction">
java:comp/UserTransaction/
</property>
<!-- properties for this SessionFactory only -->
<!-- property name="connection.datasource">java:comp/env/jdbc/@WEBAPPNAME@</property -->
<property name="dialect">net.sf.hibernate.dialect.@hibernate.dialect.prefix@SQLDialect</property>
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
<property name="cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
<!-- mapping files -->
<mapping resource="com/ltoj/persistence/base/PoAddress.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAddressType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAggregation.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAggrMeasurement.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssessment.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssociate.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssocPref.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssocPolicy.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoChar.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCharChoice.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCharValue.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoClass.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoClassMeasurement.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCountry.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoEnrollment.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoEthnicity.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoGradeLevel.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoIndDisabEducAct.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoLanguage.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoMeasurementParms.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoMeasurementUnit.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoOrganizationType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoOrgPolicy.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoPhoneNumber.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoPhoneNumberType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoResult.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoRole.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoStateProvince.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoStatus.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoSubject.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoUserRole.hbm.xml"/>

<class-cache class="com.ltoj.persistence.base.PoAssessment" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoAssocPolicy" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoChar" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoCharChoice" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoCharValue" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoClass" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoClassMeasurement" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoEthnicity" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoGradeLevel" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoIndDisabEducAct" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoLanguage" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoMeasurementParms" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoMeasurementUnit" usage="transactional"/>
<!-- class-cache class="com.ltoj.persistence.base.PoOrganization" usage="transactional"/ -->
<class-cache class="com.ltoj.persistence.base.PoOrganizationType" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoOrgPolicy" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoResult" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoRole" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoStatus" usage="read-only"/>
<!-- class-cache class="com.ltoj.persistence.base.PoStudent" usage="transactional"/ -->
<class-cache class="com.ltoj.persistence.base.PoSubject" usage="transactional"/>
<!-- class-cache class="com.ltoj.persistence.base.PoUser" usage="transactional"/ -->

</session-factory>
</hibernate-configuration>
hibernate.cfg.xml END:

treecache.xml BEGIN:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
<mbean code="org.jboss.cache.TreeCache"
name="jboss.cache:service=TreeCache">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<attribute name="CacheMode">LOCAL</attribute>
<attribute name="ClusterName">TreeCache-Cluster</attribute>
<attribute name="ClusterConfig">
<config>
<UDP mcast_addr="192.168.1.130" mcast_port="45566"
ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
loopback="true"/>
<PING timeout="2000" num_initial_members="3"
up_thread="false" down_thread="false"/>
<MERGE2 min_interval="10000" max_interval="20000"/>
<FD shun="true" up_thread="true" down_thread="true"/>
<VERIFY_SUSPECT timeout="1500"
up_thread="false" down_thread="false"/>
<pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
up_thread="false" down_thread="false"/>
<pbcast.STABLE desired_avg_gossip="20000"
up_thread="false" down_thread="false"/>
<UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
down_thread="false"/>
<FRAG frag_size="8192"
down_thread="false" up_thread="false"/>
<pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
shun="true" print_local_addr="true"/>
<pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
</config>
</attribute>
<attribute name="MaxCapacity">20000</attribute>
<attribute name="InitialStateRetrievalTimeout">20000</attribute>
<attribute name="SyncReplTimeout">10000</attribute>
<attribute name="LockAcquisitionTimeout">15000</attribute>
<attribute name="LockLeaseTimeout">60000</attribute>

<attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>

<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalInSeconds">5</attribute>
<region name="/_default_">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToIdleSeconds">1000</attribute>
</region>
<region name="com.ltoj.persistence.base.PoOrganization">
<attribute named="maxNodes">50</attribute>
<attribute named="timeToIdleSeconds">7200</attribute>
</region>
</config>
</attribute>
</mbean>
</server>
treecache.xml END:


Code between sessionFactory.openSession() and session.close():
Do not think this is applicable.

Full stack trace of any exception that occurs:
Here is the initial exception and logs messages (let me know if you need more - there are other cascading exceptions as the cache attempts to instantiate):
Dec 7, 2004 2:12:44 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.TreeCacheProvider
Dec 7, 2004 2:12:44 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
14:12:44,546 INFO [http8080-Processor25] PropertyConfigurator:172 - configure(): attribute size: 17
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute TransactionManagerLookupClass to org.jboss.cache.DummyTransactionManagerLookup
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute IsolationLevel to REPEATABLE_READ
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute CacheMode to LOCAL
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute ClusterName to TreeCache-Cluster
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setClusterConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
14:12:44,578 INFO [http8080-Processor25] TreeCache:621 - setClusterConfig(): setting cluster properties from xml to: UDP(ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=192.168.1.130;mcast_port=45566;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD(down_thread=true;shun=true;up_thread=true):VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;retransmit_timeout=600,1200,2400,4800;up_thread=false):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=false;up_thread=false)
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setInitialStateRetrievalTimeout(long) with parameter "20000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setSyncReplTimeout(long) with parameter "10000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setLockAcquisitionTimeout(long) with parameter "15000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute EvictionPolicyClass to org.jboss.cache.eviction.LRUPolicy
14:12:44,609 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setEvictionPolicyConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
14:12:44,609 INFO [http8080-Processor25] TreeCache:573 - setEvictionPolicyConfig(): [config: null]
Dec 7, 2004 2:12:44 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
14:12:44,625 DEBUG [http8080-Processor25] TreeCache:266 - Starting TreeCache
14:12:44,640 ERROR [http8080-Processor25] DummyTransactionManager:45 - binding of DummyTransactionManager failed
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:948)
at org.apache.naming.NamingContext.bind(NamingContext.java:876)
at org.apache.naming.NamingContext.bind(NamingContext.java:216)
at org.apache.naming.NamingContext.bind(NamingContext.java:232)
at org.apache.naming.SelectorContext.bind(SelectorContext.java:217)
at javax.naming.InitialContext.bind(InitialContext.java:355)
at org.jboss.cache.transaction.DummyTransactionManager.getInstance(DummyTransactionManager.java:41)
at org.jboss.cache.DummyTransactionManagerLookup.getTransactionManager(DummyTransactionManagerLookup.java:17)
at org.jboss.cache.TreeCache.startService(TreeCache.java:1098)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:172)
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:47)
at net.sf.hibernate.cache.TreeCacheProvider.buildCache(TreeCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1135)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:795)
at com.ltoj.persistence.ServiceLocator.<init>(ServiceLocator.java:86)
at com.ltoj.persistence.ServiceLocator.<clinit>(ServiceLocator.java:62)
at com.ltoj.webapp.filter.ActionFilter.doFilter(ActionFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)

Name and version of the database you are using:
MySQL 4.1.7

The generated SQL (show_sql=true):
Do not think applicable

Debug level Hibernate log excerpt:
Available if needed.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 8:00 pm 
Newbie

Joined: Wed Jun 23, 2004 11:18 pm
Posts: 3
Yes, you can run JBossCache under standard Tomcat 5.0. Are you saying that even the JBossCache demo can't pick up the eviction policy configuration?

Forget about the transaction exception. It is ok to have that if you are using Hibernate.

-Ben Wang


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 09, 2004 2:30 am 
Beginner
Beginner

Joined: Tue Sep 09, 2003 5:20 pm
Posts: 43
Hmm. OK, I was just a bit unnerved by the exception and the "[config: null]" message. I did a bit more twiddling and by just ommitting both TransactionManagerLookupClass and EvictionPolicyClass entries, the exceptions are gone.

I still get the do get the "[config: null]" on the setEvictionPolicyConfig message below - though it is not null, i have about two dozen regions configured. And it says "no JNDI name configured", but otherwise OK. Right?

So far though, all seems to be working now. Here are the startup messages I get:
Code:
INFO: Query language substitutions: {}
Dec 8, 2004 11:12:43 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.TreeCacheProvider
Dec 8, 2004 11:12:43 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
23:12:44,167  INFO [http8080-Processor25] PropertyConfigurator:172 - configure(): attribute size: 57
23:12:44,167 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute IsolationLevel to REPEATABLE_READ
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute CacheMode to LOCAL
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute ClusterName to TreeCache-Cluster
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setClusterConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
23:12:44,183  INFO [http8080-Processor25] TreeCache:621 - setClusterConfig(): setting cluster properties from xml to: UDP(ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=192.168.1.130;mcast_port=45566;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD(down_thread=true;shun=true;up_thread=true):VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;retransmit_timeout=600,1200,2400,4800;up_thread=false):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=false;up_thread=false)
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setInitialStateRetrievalTimeout(long) with parameter "20000" of type class java.lang.Long
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setSyncReplTimeout(long) with parameter "10000" of type class java.lang.Long
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setLockAcquisitionTimeout(long) with parameter "15000" of type class java.lang.Long
23:12:44,183 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setEvictionPolicyConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
23:12:44,183  INFO [http8080-Processor25] TreeCache:573 - setEvictionPolicyConfig(): [config: null]
Dec 8, 2004 11:12:44 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
23:12:44,214 DEBUG [http8080-Processor25] TreeCache:266 - Starting TreeCache
23:12:44,214  WARN [http8080-Processor25] TreeCache:1100 - No transaction manager lookup class has been defined. TX will be null
23:12:44,214  INFO [http8080-Processor25] TreeCache:1237 - interceptor chain is:
class org.jboss.cache.interceptors.CallInterceptor
23:12:44,229  INFO [http8080-Processor25] TreeCache:1120 - cache mode is local, will not create the channel
23:12:44,229 DEBUG [http8080-Processor25] TreeCache:299 - Started TreeCache
Dec 8, 2004 11:12:44 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Dec 8, 2004 11:12:46 PM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured


I will test/verify further tomorrow. Thank you for the help.

- Richard[/code]


Top
 Profile  
 
 Post subject: Re: EvictionPolicyConfig not recognized in Tomcat
PostPosted: Wed May 11, 2005 2:42 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
I have the same set up as yours and I found the eviction policy doesn't work. It keeps complaining ClassNotFound exception for LRUEvictionPolicy. I didn't specify any EvictionPolicyConfig attribute thought.

In addition, I found that comment <!-- Name of the eviction policy class. Not supported now. --> in sample treecache.xml file with Hibernate2.1.7. does it mean the Eviction Policy is not supported?

thanx.

rnmixon wrote:
If I understand correctly I should be able to use jboss-cache with a standard Tomcat 5.0.x servlet container (i.e. not the JBoss app server). I need to do this so that I may run two separate Tomcat machines as a cluster for improved availability.


Things work great with ehcache, but when I switch the configuration to jboss-cache 1.1.1 (the one included with Hibernate 2.1.7) I am having the problems.

It does not appear to find my Eviction Policy config - though it is clearly there. I have re-read the Hibernate in Action section several times, run the jboss-cache demos, etc. Still do not seem my problem.

Thanks for any ideas at all - Richard

Hibernate version:
2.1.7

Mapping documents:
First the hibernate.cfg.xml, then treecache.xml
hibernate.cfg.xml BEGIN:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="jta.UserTransaction">
java:comp/UserTransaction/
</property>
<!-- properties for this SessionFactory only -->
<!-- property name="connection.datasource">java:comp/env/jdbc/@WEBAPPNAME@</property -->
<property name="dialect">net.sf.hibernate.dialect.@hibernate.dialect.prefix@SQLDialect</property>
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
<property name="cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
<!-- mapping files -->
<mapping resource="com/ltoj/persistence/base/PoAddress.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAddressType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAggregation.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAggrMeasurement.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssessment.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssociate.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssocPref.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoAssocPolicy.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoChar.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCharChoice.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCharValue.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoClass.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoClassMeasurement.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoCountry.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoEnrollment.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoEthnicity.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoGradeLevel.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoIndDisabEducAct.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoLanguage.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoMeasurementParms.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoMeasurementUnit.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoOrganizationType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoOrgPolicy.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoPhoneNumber.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoPhoneNumberType.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoResult.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoRole.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoStateProvince.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoStatus.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoSubject.hbm.xml"/>
<mapping resource="com/ltoj/persistence/base/PoUserRole.hbm.xml"/>

<class-cache class="com.ltoj.persistence.base.PoAssessment" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoAssocPolicy" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoChar" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoCharChoice" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoCharValue" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoClass" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoClassMeasurement" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoEthnicity" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoGradeLevel" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoIndDisabEducAct" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoLanguage" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoMeasurementParms" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoMeasurementUnit" usage="transactional"/>
<!-- class-cache class="com.ltoj.persistence.base.PoOrganization" usage="transactional"/ -->
<class-cache class="com.ltoj.persistence.base.PoOrganizationType" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoOrgPolicy" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoResult" usage="transactional"/>
<class-cache class="com.ltoj.persistence.base.PoRole" usage="read-only"/>
<class-cache class="com.ltoj.persistence.base.PoStatus" usage="read-only"/>
<!-- class-cache class="com.ltoj.persistence.base.PoStudent" usage="transactional"/ -->
<class-cache class="com.ltoj.persistence.base.PoSubject" usage="transactional"/>
<!-- class-cache class="com.ltoj.persistence.base.PoUser" usage="transactional"/ -->

</session-factory>
</hibernate-configuration>
hibernate.cfg.xml END:

treecache.xml BEGIN:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
<mbean code="org.jboss.cache.TreeCache"
name="jboss.cache:service=TreeCache">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<attribute name="CacheMode">LOCAL</attribute>
<attribute name="ClusterName">TreeCache-Cluster</attribute>
<attribute name="ClusterConfig">
<config>
<UDP mcast_addr="192.168.1.130" mcast_port="45566"
ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
loopback="true"/>
<PING timeout="2000" num_initial_members="3"
up_thread="false" down_thread="false"/>
<MERGE2 min_interval="10000" max_interval="20000"/>
<FD shun="true" up_thread="true" down_thread="true"/>
<VERIFY_SUSPECT timeout="1500"
up_thread="false" down_thread="false"/>
<pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
up_thread="false" down_thread="false"/>
<pbcast.STABLE desired_avg_gossip="20000"
up_thread="false" down_thread="false"/>
<UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
down_thread="false"/>
<FRAG frag_size="8192"
down_thread="false" up_thread="false"/>
<pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
shun="true" print_local_addr="true"/>
<pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
</config>
</attribute>
<attribute name="MaxCapacity">20000</attribute>
<attribute name="InitialStateRetrievalTimeout">20000</attribute>
<attribute name="SyncReplTimeout">10000</attribute>
<attribute name="LockAcquisitionTimeout">15000</attribute>
<attribute name="LockLeaseTimeout">60000</attribute>

<attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>

<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalInSeconds">5</attribute>
<region name="/_default_">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToIdleSeconds">1000</attribute>
</region>
<region name="com.ltoj.persistence.base.PoOrganization">
<attribute named="maxNodes">50</attribute>
<attribute named="timeToIdleSeconds">7200</attribute>
</region>
</config>
</attribute>
</mbean>
</server>
treecache.xml END:


Code between sessionFactory.openSession() and session.close():
Do not think this is applicable.

Full stack trace of any exception that occurs:
Here is the initial exception and logs messages (let me know if you need more - there are other cascading exceptions as the cache attempts to instantiate):
Dec 7, 2004 2:12:44 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.TreeCacheProvider
Dec 7, 2004 2:12:44 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
14:12:44,546 INFO [http8080-Processor25] PropertyConfigurator:172 - configure(): attribute size: 17
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute TransactionManagerLookupClass to org.jboss.cache.DummyTransactionManagerLookup
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute IsolationLevel to REPEATABLE_READ
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute CacheMode to LOCAL
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute ClusterName to TreeCache-Cluster
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setClusterConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
14:12:44,578 INFO [http8080-Processor25] TreeCache:621 - setClusterConfig(): setting cluster properties from xml to: UDP(ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=192.168.1.130;mcast_port=45566;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD(down_thread=true;shun=true;up_thread=true):VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;retransmit_timeout=600,1200,2400,4800;up_thread=false):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=false;up_thread=false)
14:12:44,578 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setInitialStateRetrievalTimeout(long) with parameter "20000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setSyncReplTimeout(long) with parameter "10000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setLockAcquisitionTimeout(long) with parameter "15000" of type class java.lang.Long
14:12:44,593 DEBUG [http8080-Processor25] PropertyConfigurator:208 - setting attribute EvictionPolicyClass to org.jboss.cache.eviction.LRUPolicy
14:12:44,609 DEBUG [http8080-Processor25] PropertyConfigurator:250 - Invoking setter method: public void org.jboss.cache.TreeCache.setEvictionPolicyConfig(org.w3c.dom.Element) with parameter "[config: null]" of type class org.apache.xerces.dom.DeferredElementImpl
14:12:44,609 INFO [http8080-Processor25] TreeCache:573 - setEvictionPolicyConfig(): [config: null]
Dec 7, 2004 2:12:44 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
14:12:44,625 DEBUG [http8080-Processor25] TreeCache:266 - Starting TreeCache
14:12:44,640 ERROR [http8080-Processor25] DummyTransactionManager:45 - binding of DummyTransactionManager failed
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:948)
at org.apache.naming.NamingContext.bind(NamingContext.java:876)
at org.apache.naming.NamingContext.bind(NamingContext.java:216)
at org.apache.naming.NamingContext.bind(NamingContext.java:232)
at org.apache.naming.SelectorContext.bind(SelectorContext.java:217)
at javax.naming.InitialContext.bind(InitialContext.java:355)
at org.jboss.cache.transaction.DummyTransactionManager.getInstance(DummyTransactionManager.java:41)
at org.jboss.cache.DummyTransactionManagerLookup.getTransactionManager(DummyTransactionManagerLookup.java:17)
at org.jboss.cache.TreeCache.startService(TreeCache.java:1098)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:172)
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:47)
at net.sf.hibernate.cache.TreeCacheProvider.buildCache(TreeCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1135)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:795)
at com.ltoj.persistence.ServiceLocator.<init>(ServiceLocator.java:86)
at com.ltoj.persistence.ServiceLocator.<clinit>(ServiceLocator.java:62)
at com.ltoj.webapp.filter.ActionFilter.doFilter(ActionFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)

Name and version of the database you are using:
MySQL 4.1.7

The generated SQL (show_sql=true):
Do not think applicable

Debug level Hibernate log excerpt:
Available if needed.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 4:52 pm 
Newbie

Joined: Wed Jun 23, 2004 11:18 pm
Posts: 3
Hmmn! JBossCache1.1.1 should have eviction policy support already. Can you download JBossCache1.2.1 (not the latest 1.2.2 since packaging dependency is a bit different) and place it under Hibernate to see if that works?

-Ben


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 6:17 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
It doesn't solve the problem. JbossCache 1.2.1 and 1.1.1 have the same behavior when specifying the eviction policy as org.jboss.cache.eviction.LRUPolicy.


The excetpion is:
TreeCache ERROR - Starting failed TreeCache
java.lang.NullPointerException
at org.jboss.cache.eviction.LRUPolicy.getAttr(LRUPolicy.java:157)
at org.jboss.cache.eviction.LRUPolicy.parseConfig(LRUPolicy.java:126)
at org.jboss.cache.eviction.LRUPolicy.configure(LRUPolicy.java:211)
at org.jboss.cache.TreeCache.createEvictionPolicy(TreeCache.java:1131)
at org.jboss.cache.TreeCache.startService(TreeCache.java:1086)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:172)
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:47)
at net.sf.hibernate.cache.TreeCacheProvider.buildCache(TreeCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1135)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:795)
at com.elasticpath.dataaccess.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:40)
at com.elasticpath.dataaccess.hibernate.TransactionDAO.beginTransaction(TransactionDAO.java:17)
at com.elasticpath.business.domain.TransactionBO.beginTransaction(TransactionBO.java:16)
at com.elasticpath.commons.ElasticPath.loadDefaultLocale(ElasticPath.java:330)
at com.elasticpath.commons.ElasticPath.init(ElasticPath.java:167)
at com.elasticpath.commons.ElasticPath.getInstance(ElasticPath.java:73)
at com.elasticpath.web.struts.plugin.ElasticPathConfigPlugin.init(ElasticPathConfigPlugin.java:52)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:476)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2298)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.