Using Hibernate annotations in a managed environment

If you are using Hibernate JPA annotations from within JBoss AS, the approach is much simpler. You don't need to pack any library along with your Web application, since JBoss AS ships already with Hibernate and Logging libraries.

Just include the hibernate.cfg.xml file in a place visible to the Web application classpath (for example under WEB-INF/classes ):

HibernateExample.war
?   index.jsp
?
????WEB-INF
?          web.xml
?
????classes
?          hibernate.cfg.xml
?
????hibernate
?   ????objects
?             Application.class
?
????sample
?             ExampleAnnotation.class
?
????util
              HibernateUtil.class
0
0
0
s2smodern