-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate2 and JBoss 3.2.2RC2
PostPosted: Thu Aug 28, 2003 2:26 pm 
Newbie

Joined: Thu Aug 28, 2003 2:22 pm
Posts: 5
I'm trying to launch Hibernate2 as an MBean under JBoss. I have Hibernate2.jar in my server/default/lib directory, and the jboss-service.xml in my hibernate.sar is:

<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,
name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=ConnectionFactoryDeployer</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">mappings/TJdoTest.hbm.xml,
mappings/TBundle.hbm.xml,
mappings/TMaterial.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:jdbc/SybaseDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.SybaseDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">false</attribute>
<attribute name="UserTransactionName">java:/UserTransaction</attribute>
</mbean>
</server>

When I start JBoss, it barfs when trying to deploy my MBean with the following message:

------------------

2003-08-28 09:54:29,701 DEBUG [org.jboss.deployment.SARDeployer] create operation failed for package file:/c:/my/project/deploy/hibernate.sar

org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)

at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:143)

-----------------

The actual cause of the UndeclaredThrowable is:

----------------

Caused by: java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
at java.lang.Class.getConstructor0(Class.java:1762)
at java.lang.Class.getConstructor(Class.java:1002)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:850)

---------------------

So, the SARDeployer is finding net.sf.hibernate.jmx.HibernateService but once it's inside, trying to instantiate that class, it is unable to find net.sf.hibernate.HibernateException, which is in the classpath. I've tried taking hibernate2.jar out of the classpath altogether and the error is different (can't find the HibernateService class) but fully expected.

I'm am flummoxed. Has anyone encountered this before, or gotten Hibernate2 to work with 3.2.2RC2?

Thanks,
Ken


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 29, 2003 9:25 am 
Newbie

Joined: Tue Aug 26, 2003 6:01 pm
Posts: 3
Ken,

I too had some problems getting hibernate deployed as a service under
JBoss 3.2.1. I also (yesterday) deployed StrutsCX and ran into
similar problems.

The issues always involve libraries and where they are/are not found.

There is a doc called "Using Hibernate with JBoss" (http://www.hibernate.org/66/html) that includes a list of libs that
are required for hibernate. Make doubly sure these are available.
I think they should be placed in ...server/default/lib, assuming you
are using the default configuration.

I am not sure exactly how JBoss gets its classpath or finds libs.
Anyway, that's a question for another forum.

_________________
John Goyer


Top
 Profile  
 
 Post subject: Re-installed and happy
PostPosted: Fri Aug 29, 2003 5:47 pm 
Newbie

Joined: Thu Aug 28, 2003 2:22 pm
Posts: 5
Well (and this is why I posted to the newbie forum) it would appear that I had a couple of JARs out of line. Or, more precisely, I had the same (or conflicting) JARs in multiple places. I re-installed JBoss and everything works fine.

Cheers to the Hibernate crew! I'm trying to get it signed off for a standard-setting project at work...


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