-->
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.  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: JBoss Hibernate integration resources
PostPosted: Fri Aug 05, 2005 11:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The first place to look for information regarding the integration between JBoss AS and Hibernate is the wiki page maintained on jboss.org:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHibernate

You may also want to check out the example app maintained in JBoss cvs as part of the AS documentation:
http://cvs.sourceforge.net/viewcvs.py/jboss/jboss-docs/gettingstarted/code/examples/hibernate/?only_with_tag=HEAD


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 1:00 pm 
Beginner
Beginner

Joined: Mon Sep 08, 2003 10:56 am
Posts: 35
Is it my imagination, or is the only "application" code in the example, a scriptlet that looks up the hibernate session and executes a query?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 8:14 pm 
Newbie

Joined: Tue Aug 02, 2005 12:14 pm
Posts: 11
Is there an example application that uses JBossCache as the Hibernate second cache?

Using HashtableCacheProvider is not recommended for improved performance/production systems.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 2:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
test suites are your friends guys...

http://anoncvs.forge.jboss.com/viewrep/~br=Branch_4_0/JBoss/jbosstest/src/resources/hibernate/har-deployment/jboss-service.xml?r=1.1.2.1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 12:24 pm 
Newbie

Joined: Mon Apr 18, 2005 5:53 pm
Posts: 6
I have read all documentation about Hibernate + JBoss
I could get the little "hibenate example" application work. I've noticed my JDNI object "hibernate/SessionFactory" is working properly inside the Container and its VM.

I have an outside application in swing/java and I'd like it to use the SessionFactory created inside JBoss via JNDI lookup. How can I do it?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 31, 2006 6:25 pm 
Regular
Regular

Joined: Thu Jul 29, 2004 11:55 pm
Posts: 75
I would recommend having your swing/java app communicate with the app server and have the app server perform the database work (3-tier application where the swing/java app is just another client).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 6:46 am 
Beginner
Beginner

Joined: Fri May 21, 2004 5:22 am
Posts: 24
Ok, by follow the example the JBoss server loaded correctly, but how do I write my Spring applicationContext.xml file so that it "points" the SessionFactory created?

Below are my configuration of JBoss:

Code:
<mbean code="org.jboss.hibernate.jmx.Hibernate"
           name="jboss.har:service=Hibernate">
      
      <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
   
       <!-- Datasource settings -->
       <attribute name="DatasourceName">java:jdbc/emsConnectionPool</attribute>
       <attribute name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
      
       <!-- Caching -->
       <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
   
       <!-- Logging -->
       <attribute name="ShowSqlEnabled">true</attribute>
   
</mbean>


How do I write applicationContext in Spring to make use of this SessionFactory? Also how does the mapping of HBM files work?

Thanks


Top
 Profile  
 
 Post subject: hibernate 3.2 versus websphere 6.1
PostPosted: Fri Oct 27, 2006 9:00 am 
Newbie

Joined: Fri Oct 20, 2006 5:47 am
Posts: 3
Location: Europe
Are there any resources how to integrate hibernate 3.2 with websphere 6.1? And how to get work it...?


Top
 Profile  
 
 Post subject: duplilcate import error - deployed hibernate har file jboss
PostPosted: Wed Nov 01, 2006 4:45 pm 
Newbie

Joined: Wed Jul 26, 2006 11:48 am
Posts: 2
Location: New York, NY
Hi,

I have put together an xxxxx.har file containing my hibernate session mbean definition, all my xxx.hbm.xml files and all the compiled classes generated using hibernate synchronizer.

When i put in my jboss 4.0.5 deploy directory I see the server try to read, parse and deploy. However I get:

[Mappings] duplicate import: com.xxxxxx.hibernate.blog.Advice->com.xxxxx.hibernate.blog.Advice

It seems to me that it is trying to parse my mappings twice. It first went through all my mappings, Advice being the first. Then at the end it tries to parse Advice again. Any suggestions on how to fix?

-Steve



13:22:45,781 INFO [Configuration] Searching for mapping documents in jar: xxxxx.har
13:22:45,781 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/blog/Advice.hbm.xml
13:22:45,921 INFO [HbmBinder] Mapping class: com.aa.hibernate.blog.Advice -> advice
13:22:45,937 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/blog/BlogComments.hbm.xml
13:22:45,953 INFO [HbmBinder] Mapping class: com.aa.hibernate.blog.BlogComments -> blog_comments
13:22:46,031 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/blog/Blogs.hbm.xml
13:22:47,031 INFO [HbmBinder] Mapping class: com.aa.hibernate.lookup.State -> state
13:22:47,031 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/lookup/Status.hbm.xml
13:22:47,031 INFO [HbmBinder] Mapping class: com.aa.hibernate.lookup.Status -> status
13:22:aa031 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/lookup/Zodiac.hbm.xml
13:22:47,046 INFO [HbmBinder] Mapping class: com.aa.hibernate.lookup.Zodiac -> zodiac
13:22:47,046 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/misc/UserSuggestion.hbm.xml
13:22:47,046 INFO [HbmBinder] Mapping class: com.aa.hibernate.misc.UserSuggestion -> suggestion
13:22:47,046 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/people/Blocks.hbm.xml
13:22:47,062 INFO [HbmBinder] Mapping class: com.aa.hibernate.people.Blocks -> blocks
13:22:47,062 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/people/Favorites.hbm.xml
13:22:47,062 INFO [HbmBinder] Mapping class: com.aa.hibernate.people.Favorites -> favorites
13:22:47,062 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/people/Friends.hbm.xml
13:22:47,078 INFO [HbmBinder] Mapping class: com.aa.hibernate.people.Friends -> friends

... Many other mapping files

13:22:47,156 INFO [Configuration] Found mapping document in jar: com/a/hibernate/pim/UserBulletins.hbm.xml
13:22:47,203 INFO [HbmBinder] Mapping class: com.aa.hibernate.pim.UserBulletins -> user_bulletin
13:22:47,203 INFO [Configuration] Found mapping document in jar: com/aa/hibernate/blog/Advice.hbm.xml
13:22:47,218 INFO [Mappings] duplicate import: com.aa.hibernate.blog.Advice->com.aa.hibernate.blog.Advice
13:22:47,218 INFO [Mappings] duplicate import: com.aa.hibernate.blog.Advice->Advice
13:22:47,218 INFO [HbmBinder] Mapping class: com.aa.hibernate.blog.Advice -> advice
13:22:47,218 WARN [ServiceController] Problem starting service jboss.har:service=Hibernate
org.hibernate.InvalidMappingException: Could not read mapping documents from jar: a.har
at org.hibernate.cfg.Configuration.addJar(Configuration.java:582)
at org.jboss.hibernate.jmx.Hibernate.handleMappings(Hibernate.java:318)
at org.jboss.hibernate.jmx.Hibernate.buildConfiguration(Hibernate.java:208)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:228)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:155)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy6.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.aa.hibernate.blog.Advice
at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:145)
at org.hibernate.cfg.Configuration.add(Configuration.java:424)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:465)
at org.hibernate.cfg.Configuration.addJar(Configuration.java:579)
... 97 more
13:22:47,390 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
13:22:47,921 ERROR [URLDeploymentScanner] Incomplete Deployment listing:


Last edited by srockny05 on Sat Nov 11, 2006 3:38 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 5:39 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
When you use HibernateSychronizer it might be that it is building a SessionFactory inside JBoss now when JBoss tries to deploy the MappingFiles you might get this Exception. I'm not quit sure if this behaviour still exists, because I encountered it 2 years ago. May be investigation in this direction helps.
Hint: Their should be a line Configuration.buildSessionFactory in the generated code of HibernateSychronizer.

_________________
regards

Olaf

vote if it helped


Top
 Profile  
 
 Post subject: Mapping being read twice
PostPosted: Thu Nov 02, 2006 9:15 am 
Newbie

Joined: Wed Jul 26, 2006 11:48 am
Posts: 2
Location: New York, NY
I definitely have these lines in my hibernate synchronizer generated code: Configuration.buildSessionFactory. So jboss tries to build a session factory itself? What would be the approach to remove this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 10:09 am 
Regular
Regular

Joined: Mon Jun 12, 2006 5:33 am
Posts: 63
Hi srockny05,

just a question. I'm trying to integrate hibernate to JBoss. You wrote
Quote:
I have put together an xxxxx.har file containing my hibernate session mbean definition, all my xxx.hbm.xml files and all the compiled classes generated using hibernate synchronizer.

How do you specify the .hbm.xml files? Also in the hibernate.service.xml file?
Thanks for your help

chucky


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 6:19 pm 
Newbie

Joined: Sun Jan 14, 2007 2:52 pm
Posts: 19
Are these resources still relevant/current for JBoss 4.2 and later? The page does not seem to have changed since 2005 and there is little mention of the Hibernate Deployer in the EAP 4.2 documentation.


Top
 Profile  
 
 Post subject: Re: hibernate 3.2 versus websphere 6.1
PostPosted: Fri Nov 23, 2007 7:25 am 
Newbie

Joined: Thu May 17, 2007 3:10 am
Posts: 1
janod wrote:
Are there any resources how to integrate hibernate 3.2 with websphere 6.1? And how to get work it...?

Jayasimha wrote:
This article in IBM developer works might be of help to you. It talks about how to integrate Spring and hibernate with WAS. http://www.ibm.com/developerworks/websp ... lcott.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 26, 2007 9:21 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:20 am
Posts: 74
somehow I doubt janod will read your message. He's not been seen since the day he asked his question (which is inappropriate in this thread as well as over a year ago).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 17 posts ]  Go to page 1, 2  Next

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.