-->
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.  [ 9 posts ] 
Author Message
 Post subject: JBoss TreeCache
PostPosted: Thu Mar 25, 2004 7:39 pm 
Newbie

Joined: Wed Jan 28, 2004 9:29 am
Posts: 2
Hey,

I'm trying to use JBoss TreeCache with Hibernate (2.1). I specified the right cache provider in my jboss-service file (net.sf.hibernate.cache.TreeCacheProvider) but it doesn't work.

I get the following error : NoClassDefFound : org/jboss/cache/TransactionManagerLookup

What jars do i have to add and where to put them? And if is not a jar problem, just listen to any help.


Thx


Top
 Profile  
 
 Post subject: JBoss TreeCache
PostPosted: Fri May 07, 2004 9:03 am 
Newbie

Joined: Fri May 07, 2004 8:02 am
Posts: 3
Location: Luxembourg
HI Jean,

I 'm confronted to a similar problem (java.lang.NoClassDefFoundError: org/jboss/cache/TreeCache).

I found in the lib folder of the hibernate distribution the jar "jboss-cache.jar" that contains the "TransactionManagerLookup" class. So I put it in the lib folder of my <JBoss dist>\server\default\lib, restarted the server again but that doesn't resolved it.

I even added it (jboss-cache.jar) to my ear file (of course I didn't forget to add <module><java>jboss-cache.jar</java><module> to the application.xml file) without success.

Maybe I'm putting the jar in the wrong place.

---------------
HIBERNATE VERSION: 2.1.3
DATABASE: Hypersonic provided with JBOSS 3.2.2

CONFIG FILE: hibernate.cfg.xml containing:

<hibernate-configuration>

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:comp/env/hibernate/SessionFactory">

<!-- properties -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost:1701</property>
<property name="connection.datasource">java:/DefaultDS</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>
<property name="show_sql">false</property>
<property name="use_outer_join">false</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="cglib.use_reflection_optimizer">false</property>

<!-- specifies the cache provider-->
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>

<!-- mapping files -->
<mapping resource="HibernateTestValueImpl.hbm.xml"/>

<!-- specifies the cache provider-->
<class-cache class="com.ni2.core.HibernateTestValueImpl" usage="read-only"/>

</session-factory>

</hibernate-configuration>

FULL STACK TRACE OF THE EXCEPTION:
15:00:36,751 ERROR [LogInterceptor] Unexpected Error:
java.lang.NoClassDefFoundError: org/jboss/cache/TreeCache
at net.sf.hibernate.cache.TreeCache.<init>(TreeCache.java:40)
at net.sf.hibernate.cache.TreeCacheProvider.buildCache(TreeCacheProvider.java:14)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1107)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:767)
at com.ni2.core.persist.PersistenceManager.init(PersistenceManager.java:42)
at com.ni2.core.JVTHelperHibernateCompany.getManagedEntitiesByType(JVTHelperHibernateCompany.java:768)
at com.axone.ejb.common.impl.JVTHelperGroup.getManagedEntitiesByType(JVTHelperGroup.java:394)
at com.axone.ejb.common.impl.JVTExtendedSessionBean.getManagedEntitiesByType(JVTExtendedSessionBean.java:172)
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.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
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.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 07, 2004 3:11 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Has to be in the same classloader than the one loading Hibernate2.jar

_________________
Emmanuel


Top
 Profile  
 
 Post subject: java.lang.NoClassDefFoundError: org/jboss/cache/TreeCache
PostPosted: Mon May 10, 2004 12:48 pm 
Newbie

Joined: Tue May 04, 2004 3:32 pm
Posts: 16
Location: Iowa
I am having the same problem. I put the jbosscache.jar, hibernate2 jar and other hibernate related jars into the same sar file. The sar is in an ear file.
I still got "java.lang.NoClassDefFoundError: org/jboss/cache/TreeCache"

If it is because of classloader problem, how jboss found Hibernate jar, though.

Please help.

Thanks.

Richard


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 8:54 am 
Newbie

Joined: Fri May 07, 2004 8:02 am
Posts: 3
Location: Luxembourg
In my configuration, I have jboss-cache.jar in the same folder as hibernate2.jar but JBoss still don't find the caching classes.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 10:05 am 
Newbie

Joined: Tue May 04, 2004 3:32 pm
Posts: 16
Location: Iowa
I got it finally working by put both jboss-cache.jar and jgroups.jar into deployment's lib (I missed the jgroups.jar). I think if I include these two into my .sar or .ear it should work too. jgroups is not in the hiberbate lib, but you can find it from jbosscache 1.0 release.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 8:29 am 
Newbie

Joined: Thu Oct 09, 2003 1:53 pm
Posts: 4
I have 2 questions regarding JBoss TreeCache usage with Hibernate

1. I'm trying to turn on caching for one of my objects and the following message appears in the log file

ERROR [org.jgroups.blocks.RpcDispatcher] exception=java.io.NotSerializableException: org.digijava.kernel.request.Site

This class is not serializable. Is it required to implement java.io.Serializable interface for Hibernate-persisted classes?

2. As I can see from the source of net.sf.hibernate.cache.TreeCache class, each item in the cache has its own FQN, while key for the object in the cache is a string "item", defined by the constant. here is the example:
Code:
   public Object get(Object key) throws CacheException {
      try {
         return cache.get( new Fqn( new Object[] { regionName, key } ), ITEM );
      }
      catch (Exception e) {
         throw new CacheException(e);
      }
   }


I'm wondering, what are the benefits of this method in comparision with the following:

Code:
   public Object get(Object key) throws CacheException {
      try {
         return cache.get( regionFqn , key );
      }
      catch (Exception e) {
         throw new CacheException(e);
      }
   }


where regionFqn = new Fqn(regionName) assignment happens in the constructor?

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 9:13 am 
Newbie

Joined: Thu Oct 09, 2003 1:53 pm
Posts: 4
Sorry, I think I've just found the reason why #1 happens.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 1:02 pm 
Beginner
Beginner

Joined: Tue Feb 01, 2005 5:26 pm
Posts: 24
Location: dallas
hey mikheil, can you tell us why #1 is happening


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