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.