Hibernate 3, Jboss 3.2.5
I am deploying Hibernate as an MBean. I see Hibernate register itself in JBoss
but when I try to get the SessionFactory by name, I get a
NameNotFoundException.
Has anyone else seen this? How did you resolve this? Hibernate works fine
outside an MBean, FWIW.
| try {
| sessionFactory =
(SessionFactory)ctx.lookup("java:comp/env/Hibernate/QSAdmin");
| }
| catch( NamingException e ) {
| logger.error( e.toString() );
| e.printStackTrace();
| }
|
-- jboss-service.xml --
| <mbean code="org.hibernate.jmx.HibernateService"
name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
|
| <!-- Required services -->
| <depends>jboss.jca:service=RARDeployer</depends>
| <depends>jboss.jca:service=LocalTxCM,name=RIT-DMS</depends>
|
| <!-- Bind the Hibernate service to JNDI -->
| <attribute name="JndiName">java:comp/env/Hibernate/QSAdmin</attribute>
|
| <!-- Datasource settings -->
| <attribute name="Datasource">java:/RIT-DMS</attribute>
| <attribute
name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
|
| <!-- Transaction integration -->
| <attribute
name="TransactionStrategy">org.hibernate.transaction.JTATransactionFactory</attribute>
| <attribute
name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
| <attribute name="FlushBeforeCompletionEnabled">true</attribute>
| <attribute name="AutoCloseSessionEnabled">true</attribute>
| <attribute name="UserTransactionName">UserTransaction</attribute>
|
| <!-- Fetching options -->
| <attribute name="MaximumFetchDepth">5</attribute>
|
| <!-- Second-level caching -->
| <attribute name="SecondLevelCacheEnabled">true</attribute>
| <attribute
name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
| <attribute name="QueryCacheEnabled">true</attribute>
|
| <!-- Logging -->
| <attribute name="ShowSqlEnabled">false</attribute>
| <!-- <attribute name="ShowStatistics">true</attribute> -->
|
| <!-- Mapping files -->
| <attribute name="MapResources">
| com/blah/dms/model/Taccount.hbm.xml
| </attribute>
| </mbean>
| </server>
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3892312#3892312
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3892312
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user