Hi,

you have to use the .har Deployer tool. Package your persistence layer 
containing all hibernate related stuff (.hbm.xml and the appropriate classes) 
together in the .har file and specify to load it in jboss-app.xml. place the 
jboss-app.xml file inside the .ear file or directory in the META-INF directory.

Here is the content of the jboss-app.xml file:

  | <jboss-app>
  |    <module>
  |       <har>hibernatestuff.har</har>
  |    </module>
  | </jboss-app>
  | 

Then you must name your deployment descriptor correctly. Before jboss version 
4.0.3RC2 it was hibernate-service.xml and after jboss-service.xml.
The hibernate-service.xml or jboss-service.xml must be placed in the META-INF 
directory of the .har file.

Here is the content of my jboss-service.xml:

  | <server>
  |     <mbean code="org.jboss.hibernate.jmx.Hibernate" 
name="jboss.har:service=Hibernate">
  |             <attribute name="DatasourceName">java:/DataSource</attribute>
  |             <attribute 
name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
  |             <attribute 
name="Dialect">org.hibernate.dialect.MySQLInnoDBDialect</attribute>
  |             <attribute 
name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
  |             <attribute name="Hbm2ddlAuto">update</attribute>
  |             <attribute name="ShowSqlEnabled">true</attribute>
  |     </mbean>
  | </server>
  | 

To use together with Spring you have to place the file applicationContext.xml 
of Spring inside of xxx.ear/xxx.war/WEB-INF containing the following lines to 
connect the Hibernate MBean:


  | <bean id="sessionFactory" 
class="org.springframework.jndi.JndiObjectFactoryBean">
  |         <property 
name="jndiName"><value>java:/hibernate/SessionFactory</value></property>
  |     </bean>
  | 

Don't forget to specify the datasource at first (inside xxx-ds.xml, where xxx 
stands for the specific database string e.g. mysql, mssql, ...).

Try these settings and tell me about further problems.

Best regards
Manuel Lamotte

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940168#3940168

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940168


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to