-->
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.  [ 2 posts ] 
Author Message
 Post subject: Different version of Hibernate
PostPosted: Fri Sep 24, 2004 8:24 am 
Beginner
Beginner

Joined: Fri Sep 24, 2004 8:18 am
Posts: 24
Hi,

Anybody know the difference between hibernate2.jar (and other jars) which part of Hibernate2.1.6 and
hibernate2.jar (and other jars) which part of JBoss-4.0.0 ?

My jboss-service.xml has the following code :

Code:
...
    <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=myHibernateFactory">
        <depends>jboss.jca:service=RARDeployer</depends>

        <attribute name="MapResources">mappings/xxx.hbm.xml</attribute>
       
        <attribute name="JndiName">java:/yyyHibernateFactory</attribute>
        <attribute name="Datasource">java:/OracleDS</attribute>
        <attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
       
        <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
        <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
        <attribute name="ShowSql">true</attribute>

        <attribute name="UserTransactionName">UserTransaction</attribute>
    </mbean>
...



When I build a .sar with the above jboss-service, deploy it into JBoss-4.0.0RC1, it works OK.
But if I deploy it into JBoss-4.0.0, I got the following error :

...
13:43:05,560 DEBUG [example.db.nusa] === Exception in nusa() : net.sf.hibernate.LazyInitializationException => Hibernate lazy instantiation problem

13:43:05,840 INFO [STDOUT] net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem

at net.sf.hibernate.jmx.SessionFactoryStub.getImpl(SessionFactoryStub.java:77)

at net.sf.hibernate.jmx.SessionFactoryStub.openSession(SessionFactoryStub.java:62)

... 10 more
Caused by: net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.ehcache.hibernate.Provider

at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:134)

at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)

at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)

at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:176)

at net.sf.hibernate.jmx.SessionFactoryStub.getImpl(SessionFactoryStub.java:74)

... 17 more

Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: net.sf.ehcache.hibernate.Provider

at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)

at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:463)

at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:374)

at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:141)

at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)

at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:131)

... 21 more

...

It looks that ehcache.jar ( part of Hibernate-2.1.6 ) must be deployed.
But why it's not part of JBoss-4.0.0 ?

Is there any relationship between the HibernateService as defined in net.sf.hibernate.jmx.HibernateService ( part of Hibernate-2.1.6 )
with hibernate-service.xml ( part of JBoss-4.0.0 ) ?

Thanks,
nusa.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 3:28 pm 
Newbie

Joined: Tue Nov 11, 2003 5:25 pm
Posts: 17
Location: Milwaukee, Wi
Hibernate, by default, uses EHCache as it's second level cache. If you're using it, you've got to deploy it with your ear/war/sar/rar/etc.

Another option is to put it in the JBoss lib directory of the server configuration that you're using.

Yet another option is to use the jboss-cache (aka TreeCache) that comes with JBoss. For this you'll need to do a little configuration to enable it.

-- Damien


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