-->
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.  [ 5 posts ] 
Author Message
 Post subject: JBossCache treecache xml property exception
PostPosted: Fri Oct 15, 2004 4:13 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
Hibernate version:
Hibernate 2.1
Mapping documents:

I am trying to use jboss treecache using the treecache.xml file that was shipped with hibernate. After adding the
<cache usage="transactional"> tag in the relecant hbm.xml file, and
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
in the hibernate.cfg.xml file, I couldn't get it to work with the original treecache.xml file.

But when i removed the
<attribute name="ClusterConfig">
..................
</attribute>

I was able to verify that the particualr class was being cached.

When I tried adding back the following tag (straight out of the original file):

- <attribute name="ClusterConfig">
- <config>
<UDP mcast_addr="228.1.2.3" 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="false" />
<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>


I get this exception


java.lang.ExceptionInInitializerError
at shaw.spectrum.core.company.persistence.CompanyOpsAreaDAO.readCompanyOpsAreaByCompanyOpsArea(CompanyOpsAreaDAO.java:47)
at shaw.spectrum.core.company.test.CompanyOpsAreaCahceTest.run(CompanyOpsAreaCahceTest.java:52)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.RuntimeException: Exception building SessionFactory: Could not instantiate Cache
at shaw.spectrum.core.persistence.HibernateAbstractSessionUtil.<clinit>(HibernateAbstractSessionUtil.java:50)
... 3 more
Caused by: net.sf.hibernate.HibernateException: Could not instantiate Cache
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1070)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:738)
at shaw.spectrum.core.persistence.HibernateAbstractSessionUtil.<clinit>(HibernateAbstractSessionUtil.java:40)
... 3 more
Caused by: net.sf.hibernate.cache.CacheException: java.lang.IllegalArgumentException:
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:53)
at net.sf.hibernate.cache.TreeCacheProvider.buildCache(TreeCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1067)
... 5 more
Caused by: java.lang.IllegalArgumentException:
at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java:138)
at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:228)
at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:140)
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:40)
... 7 more


Again, I could see it work without this tag. I need to get this thing working for replicated/clustered cache. What am I missing? Thank You.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 18, 2004 11:26 am 
Beginner
Beginner

Joined: Mon Aug 16, 2004 6:09 am
Posts: 46
Location: Geneva, Switzerland
I'm using the same config without problems. What version of jboss are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 18, 2004 1:56 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
Short Answer: JBoss 4.0.0

Long Answer: I am not running this test in the JBoss container. I just included all JBoss jar files (that was shipped along with Hibernate) in the class path. Would that be a problem? Hibernate In Action books says all JBoss server specific configuration would be simply ignored in a non-Jboss environment.

Also, since the cache usage is set to transactional, I thought may be this would work only in an managed environment. So I tried running this under Weblogic 8.1 (again with Jboss jars in the classpath), no luck there either. Container or no container, I get the same error.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 20, 2004 1:41 pm 
Beginner
Beginner

Joined: Mon Aug 16, 2004 6:09 am
Posts: 46
Location: Geneva, Switzerland
bshaw wrote:
Short Answer: JBoss 4.0.0

Long Answer: I am not running this test in the JBoss container. I just included all JBoss jar files (that was shipped along with Hibernate) in the class path. Would that be a problem? Hibernate In Action books says all JBoss server specific configuration would be simply ignored in a non-Jboss environment.

Also, since the cache usage is set to transactional, I thought may be this would work only in an managed environment. So I tried running this under Weblogic 8.1 (again with Jboss jars in the classpath), no luck there either. Container or no container, I get the same error.


<ClusterConfig> attribute is a jgroups configuration which is used by treecache as transport layer, no matter in jboss or standalone. I've just cut-n-paste your quoted config to my jboss-cache.xml config and no errors appeared. Visually I see no difference with my own config.
I suggest you take jboss-cache.jar and jgroups.jar whether from the latest treecache distribution or jboss distribution (I've just tried in jboss-3.2.6 release and it's ok) because they could by outdated in hibernate distrib (in particulary jgroups.jar)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 11:15 am 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
That fixed it. Thank You.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.