Hi,
Iam trying to use treecahce (Jboss Cache) as a second-level cache and cache mode as local.
I included all the jboss jar files that comes with hibernate3.1 Iam getting the following exception when i try to execute a standalone java class. (not in an app server). Following is the exception:
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/jboss/mx/util/Serialization
java.lang.ExceptionInInitializerError
at com.util.HibernateUtil.init(HibernateUtil.java:38)
at com.util.HibernateUtil.getSessionFactory(HibernateUtil.java:44)
at com.businessprocess.Test.getPrivs(Test.java:71)
at com.businessprocess.Test.main(Test.java:40)
Caused by: java.lang.NoClassDefFoundError: org/jboss/mx/util/Serialization
at javax.management.ObjectName.<clinit>(ObjectName.java:86)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.jboss.system.ServiceMBeanSupport.class$(ServiceMBeanSupport.java:45)
at org.jboss.system.ServiceMBeanSupport.<clinit>(ServiceMBeanSupport.java:45)
at org.hibernate.cache.TreeCacheProvider.start(TreeCacheProvider.java:47)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:173)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.util.HibernateUtil.init(HibernateUtil.java:33)
I can see the org/jboss/mx/util/Serialization in the jboss-jmx.jar which i already included.
Following is my treecahce.xml config:
<?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="CacheMode">LOCAL</attribute>
<attribute name="LockAcquisitionTimeout">15000</attribute>
<attribute name="FetchStateOnStartup">true</attribute>
<attribute name="EvictionPolicyClass">
org.jboss.cache.eviction.LRUPolicy
</attribute>
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Cache wide default -->
<region name="/_default_">
<attribute name="maxNodes">5000</attribute>
<attribute name="timeToIdleSeconds">1000</attribute>
</region>
<region name="/com/businessobjects/Account">
<attribute name="maxNodes">500</attribute>
<attribute name="timeToIdleSeconds">5000</attribute>
</region>
</config>
</attribute>
</mbean>
</server>
Can some one help?
thx.
|