facebook

How to create hiberate archive [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #224484 Reply

    patrickyip
    Member

    There is a lot of confusion as to how to properly create a hibernate archive. I tried without success. Can someone give a hello world type of example here to deploy it in Jboss 4.x. Thanks!

    #224486 Reply

    Riyad Kalla
    Member

    1) Create a new Java Project, name it “Something.har”
    2) Put your hib files in there
    3) Make this project a dependency of another project (Web or Enterprise)
    4) Deploy the project, ME will package the project into Something.har and deploy it for you.

    #224533 Reply

    patrickyip
    Member

    Thanks for your reply. However, I’m not sure how to set the dependency of the .har project to the web project?
    I went in the properties and marked the check box for for Project References of my web project. But it doesn’t package the .har project with my web project? Can you let me know where the dependency should be set?
    Thanks,
    -Patrick

    #224544 Reply

    Riyad Kalla
    Member

    Open your project properties back up, go to Java BUild Path and the Projects tab, and be sure to add your HAR project to the Build Path of your WEb Project.

    #224593 Reply

    patrickyip
    Member

    I managed to add the har project to the build path of the web project. Then I deployed it and noticed that the .har is packaged inside the /web-inf/lib directory. JBoss however, does not do create the MBean according to the .har project. My question is: How should the .har project be packaged so the JBoss can see it as .har project and trigger the creation of the MBean for Hibernate service?
    Thanks again for your great support.
    -Patrick

    #224600 Reply

    Riyad Kalla
    Member

    Patrick,
    IIRC I think JBoss wants you to deploy a EAR that has the WARs and HARs in the root level, and from there it will unpack them won’t it? If it does, setup a new Enterprise Project from MYEclipse, and make your Web and Java projects modules of it, then deploy THAT to JBoss.

    #224625 Reply

    patrickyip
    Member

    Hi Riyad,
    According to Jboss document, a HAR can be deployed standalone.
    I just hope to get a simple Har to deploy with no luck.
    Here is what I have in the content of test.har
    meta/inf/ hibernate-service.xml
    meta/inf/Manifest.mf
    com/icg/Message.hbm.xml
    com/icg/Message.class

    I dropped the test.har into the default server deploy directory and getting the following error:
    [hibernate] Starting failed jboss.har:service=Hibernate
    java.lang.NullPointerException
    at org.jboss.hivernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:567)…

    Can idea?
    Thanks,
    -Patrick

    #224645 Reply

    patrickyip
    Member

    Hi Riyad,

    I found the problem. It was a stupid typo in my hibernate-service.xml that caused the hibernate service to fail. After I fixed the typo, I was able to deploy the har project as standalone and the Hibernate MBean got created sucessful which allows my web application to use the service to create hibernate session using jndi lookup. Thank again very much for your help.
    -Patrick

    #224647 Reply

    Riyad Kalla
    Member

    I’m glad you got it working.

    #225783 Reply

    Paulo Neves
    Member

    @support-rkalla wrote:

    I’m glad you got it working.

    Patrick,

    I have the same problem, what’s the stupid typo ? Perhaps, I’ve the same one.

    Paulo

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: How to create hiberate archive [Closed]

You must be logged in to post in the forum log in