-->
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.  [ 12 posts ] 
Author Message
 Post subject: Hibernate as MBean
PostPosted: Thu Feb 19, 2004 4:09 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 11:59 am
Posts: 24
I'm trying to set up Hibernate as an MBean in JBoss for the first time. I've followed the instructions in http://www.hibernate.org/66.html and I can get the SAR to deploy. The problem I'm having is that there is no entry in JNDI for "java:/HibernateFactory". Is the jboss-service.xml supposed to add this entry or do I have to do something else that's not mentioned in http://www.hibernate.org/66.html?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 4:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Do you have the <attribute name="JndiName">java:/HibernateFactory</attribute> in the jboss-service.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 4:20 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 11:59 am
Posts: 24
Yes, I do. This is what I have in my jboss-service.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
   <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=Hibernate">
      <depends>jboss.jca:service=RARDeployer</depends>
      <depends>jboss.jca:name=OHC2DS,service=XATxCM</depends>
      <attribute name="MapResources">mapping/MyObject.hbm.xml</attribute>
      <attribute name="JndiName">java:/HibernateFactory</attribute>
      <attribute name="Datasource">java:/OHC2DS</attribute>
      <attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
      <attribute name="UseOuterJoin">true</attribute>
      <attribute name="ShowSql">false</attribute>
      <attribute name="UserTransactionName">UserTransaction</attribute>
      <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
      <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
   </mbean>
</server>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 4:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Take a look at the log, there should be something like this if everything works correctly:

Code:
[SessionFactoryObjectFactory] Factory name: java:/HibernateFactory
[SessionFactoryObjectFactory] Bound factory to JNDI name: java:/HibernateFactory


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 6:46 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 11:59 am
Posts: 24
Thanks for your help. I found where the error was (dependencies) and I got it working. As usual, great work by the Hibernate developers, wiki writers, and forum readers. :)


Top
 Profile  
 
 Post subject: no JNDI for me, either
PostPosted: Fri Mar 05, 2004 1:10 pm 
Newbie

Joined: Thu Mar 04, 2004 9:10 pm
Posts: 6
michael wrote:
Take a look at the log, there should be something like this if everything works correctly:

Code:
[SessionFactoryObjectFactory] Factory name: java:/HibernateFactory
[SessionFactoryObjectFactory] Bound factory to JNDI name: java:/HibernateFactory


I'm not seeing this. I can't see any errors, either!
$ egrep 'ERROR|SessionFactoryObjectFactory|FATAL|WARN' default/log/server.log
2004-03-05 10:47:21,557 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@1e1962d
2004-03-05 10:47:27,723 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@9f0d
2004-03-05 10:47:32,044 WARN [org.jboss.jmx.adaptor.snmp.agent.Heartbeat] Heartbeat disabled
2004-03-05 10:47:51,690 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@24c672
2004-03-05 10:47:55,643 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@1ca5df9
2004-03-05 10:48:04,109 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@f62eba

_________________
THIS IS MY SIGNATURE


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 1:23 pm 
Newbie

Joined: Thu Mar 04, 2004 9:10 pm
Posts: 6
err, nevermind, my postgres service wasnt installed

_________________
THIS IS MY SIGNATURE


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 9:07 am 
Newbie

Joined: Mon Mar 22, 2004 9:05 am
Posts: 3
Quote:
Thanks for your help. I found where the error was (dependencies) and I got it working. As usual, great work by the Hibernate developers, wiki writers, and forum readers. :)


Could you please explain in detail, how you got it working? I am having the exact same problem. Thanx.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 12:31 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Post your log output.

Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 7:24 pm 
Newbie

Joined: Mon Mar 22, 2004 9:05 am
Posts: 3
Seems like JBoss running "within" Eclipse (3M7, myEclipse Plugin) cannot resolve the JNDI name of the hibernate service.
When I am running JBoss from the shell, it works.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 12:48 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Launching JBoss in the JBoss IDE works fine.


Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 4:05 am 
Newbie

Joined: Mon Mar 22, 2004 9:05 am
Posts: 3
Yeah. Works fine.


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