18 Ağustos 2011 Perşembe

hibernate on glassfish

A way of  powering glassfish with hibernate support (instead of toplink) is directly copying hibernate runtime.jar files under glassfish's domain1/lib folder. However, this forces all deployed applications to use the same hibernate version. Therefore, the best solution is packaging hibernate .jars with the application itself.

Here is a useful link which explains how to use hibernate JPA on glassfish: http://javafromthetrenches.wordpress.com/2011/01/15/using-hibernate-jpa-with-glassfish/

The following dependencies worked for me:

<dependency org="antlr"
name="antlr"
rev="2.7.6"/>

<dependency org="asm"
name="asm"
rev="1.5.3"/>

<dependency org="asm"
name="asm-attrs"
rev="1.5.3"/>

<dependency org="cglib"
name="cglib"
rev="2.2"/>

<dependency org="commons-collections"
name="commons-collections"
rev="2.1.1"/>

<dependency org="commons-logging"
name="commons-logging"
rev="1.1"/>

<dependency org="dom4j"
name="dom4j"
rev="1.6.1"/>

<dependency org="ehcache"
name="ehcache"
rev="1.2.3"/>

<dependency org="javax.transaction"
name="jta"
rev="1.1"/>

<dependency org="org.hibernate"
name="hibernate-tools"
rev="3.2.0.ga"/>

<dependency org="org.hibernate"
name="hibernate-annotations"
rev="3.3.1.GA"/>

<dependency org="org.hibernate"
name="hibernate-commons-annotations"
rev="3.3.0.ga"/>

<dependency org="org.hibernate"
name="hibernate-entitymanager"
rev="3.3.2.GA"/>

<dependency org="javassist"
name="javassist"
rev="3.4.GA"/>

<dependency org="org.hibernate"
name="ejb3-persistence"
rev="3.3.2.Beta1"/>

<-- if hibernate cloning api beanlib is going to be used -->
<dependency org="net.sf.beanlib"
name="beanlib"
rev="5.0.2beta"/>

<-- if hibernate cloning api beanlib is going to be used -->
<dependency org="net.sf.beanlib"
name="beanlib-hibernate"
rev="5.0.2beta"/>

<!-- if postgresql driver is going to be used -->
<dependency org="it.cnr.isti.domoware"
name="org.postgresql.jdbc4"
rev="8.3-603"/>


The listed dependencies are not latest version of hibernate, however it is a working hibernate runtime set of jars. Here is an ongoing discussion about the topic: http://www.java.net/forum/topic/glassfish/glassfish/updating-support-hibernate-glassfish-need-communitys-help

Hiç yorum yok:

Yorum Gönder