Hibernate v3.6.9 Integration

This sample demonstrates Hibernate integration through a simple phonebook Web application deployed to Liberty. The application uses Hibernate as the object-relational mapping layer to handle data persistence, and SpringMVC for presentation and business logic.

This sample can be installed onto runtime versions and later.

Installation Instructions

Online installation (requires or later):

  1. Install the sample by running the command below from the bin directory of your server installation:
    installUtility install HibernateSample

Any missing features required by the server will be installed for you.

Offline installation:

  1. Download the HibernateSample.jar using the download button at the top of the page and place it in the root of your server installation.
  2. Extract the sample into the Liberty installation by running the command below from the root of your server installation:
    java -jar HibernateSample.jar

Any missing features required by the server will need to be installed separately.

Running The Application

  1. Start the HibernateSample server by running the command 'bin/server run HibernateSample' from the root of the Liberty profile installation, and confirm the application started by looking in the console output:
    CWWKZ0001I: Application PhoneBookByHibernate started in XX.XX seconds.
  2. In your browser, enter the URL for the application: http://localhost:9103/PhoneBookByHibernate/ (where port 9103 assumes the httpEndpoint provided in the sample server.xml has not been modified).
  3. In your browser, you should see the phone book displayed.


This sample does not include the open source dependencies. The installer will provide a list of the open source pre-requisite libraries and where they can be downloaded from. To help obtaining these libraries, the installer provides the option to download them on your behalf.

Sample Structure

  • wlp
    • usr
      • servers
        • HibernateSample
          • Copyright.txt
          • apps
            • PhoneBookByHibernate-1.0.0.war
          • bootstrap.properties
          • lafiles
            • LA_en
            • LI_en
          • readme.html
          • server.xml
      • shared
        • config
          • HibernateSampleLibs.xml
        • resources
          • HibernateSampleLibs
            • antlr-2.7.6.jar
            • aopalliance-1.0.jar
            • asm-3.1.jar
            • cglib-2.2.jar
            • commons-collections-3.1.jar
            • commons-dbcp-1.4.jar
            • commons-logging-1.1.1.jar
            • commons-pool-1.6.jar
            • derby-all-
            • dom4j-1.6.1.jar
            • hibernate-commons-annotations-3.2.0.Final.jar
            • hibernate-core-3.6.9.Final.jar
            • hibernate-entitymanager-3.6.9.Final.jar
            • javassist-3.12.0.GA.jar
            • slf4j-api-1.6.1.jar
            • slf4j-nop-1.6.1.jar
            • spring-aop-3.0.5.RELEASE.jar
            • spring-asm-3.0.5.RELEASE.jar
            • spring-beans-3.0.5.RELEASE.jar
            • spring-context-3.0.5.RELEASE.jar
            • spring-context-support-3.0.5.RELEASE.jar
            • spring-core-3.0.5.RELEASE.jar
            • spring-expression-3.0.5.RELEASE.jar
            • spring-jdbc-3.0.5.RELEASE.jar
            • spring-orm-3.0.5.RELEASE.jar
            • spring-tx-3.0.5.RELEASE.jar
            • spring-web-3.0.5.RELEASE.jar
            • spring-webmvc-3.0.5.RELEASE.jar