-->
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.  [ 7 posts ] 
Author Message
 Post subject: Is there a complete example of deploying Hibernate on JBoss
PostPosted: Fri Dec 09, 2005 2:28 am 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.x

JBoss ver 4.0.3

I am asking for a simple answer here. If yes, what is the link? If no, then I guess I am going to have to deal.

Please no links to partial examples. If someone knows the steps, post em here, heck get with me and email me the steps. I will be more then happy to post the steps on my site to share with everyone.

Thank you very much!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 4:08 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Did you see this:

http://caveatemptor.hibernate.org/

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 7:23 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There is nothing JBoss deployment specific in CaveatEmptor (well, the new Microcontainer stuff certainly). If you want to know how to deploy an application on JBoss AS, I recommend the JBoss AS documentation. There is even a Hibernate section in it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 12:34 pm 
Newbie

Joined: Mon Dec 05, 2005 4:22 pm
Posts: 8
steckemetz wrote:



Yes.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 12:42 pm 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
christian wrote:
There is nothing JBoss deployment specific in CaveatEmptor (well, the new Microcontainer stuff certainly). If you want to know how to deploy an application on JBoss AS, I recommend the JBoss AS documentation. There is even a Hibernate section in it.


Thank you Christian. I was goofing around with this lastnight. Was getting dependency errors though. I will play with it more this morning and see if I can fix them myself.

If not, I guess I will have to remain a newbie and come back groveling for more help :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 1:49 pm 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
Ok, just to clarify something.

If I were to use the Scanning method talked about in section 13.2.2 of the JBoss manual.

The typical deployment scenario for scanning is deploying inside of an EAR file. The Hibernate MBean would be defined in a *-service.xml file inside EAR file. A service file can be used from an EAR file by adding it to the EAR and adding a module/service entry referencing it to the jboss-app.xml deployment descriptor, as shown in the following example.

<jboss-app>
<module>
<service>hibernate-service.xml</service>
</module>
</jboss-app>

I would be creating a hibernate-service.xml file in the META-INF folder where the following mbean would be defined. (Changing the values as need)

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.adminguide:name=ExampleSessionFactory">
<attribute name="DatasourceName">java:/DefaultDS</attribute>
<attribute name="Dialect">
org.hibernate.dialect.HSQLDialect
</attribute>
<attribute name="SessionFactoryName">
java:/hibernate/ExampleSessionFactory
</attribute>

<attribute name="ScanForMappingsEnabled">true</attribute>
</mbean>
</server>

My POJO's and .hbm's would be packaged inside a seperate .har or would they be packaged in the same .ear as the above 2 files (jboss-app.xml and hibernate-service.xml) are?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 6:14 pm 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
Seems that I got it to deploy. There was a caveat though.

When I built my jboss-app.xml folder and used the module/service of hibernate-service.xml, upon deployment, JBoss complained about not being able to find hibernate-service.xml. Both files live in the same folder (META-INF). I found this to be odd.

So the approach I took was. I placed the MBean code in jboss-service.xml along with a application.xml file inside of META-INF. Created the ear, and deployed it.

JBoss appeared happy with deploying the ear. The JMX Bean does appear under jboss.j2ee in the web-console. (System-JMX MBeans-jboss.j2ee-jboss.j2ee:service=EARDeployment,url='myear.ear')

I am going to write a session bean that will attempt to use a hibernate session to persist some data.

If any of you experts out there can think of anything that I may have missed that would have caused the example in Chapter 13.2.2 of the JBoss manual to not work. I would appreciate the advice.


Thank you.


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