- This topic has 9 replies, 3 voices, and was last updated 19 years, 10 months ago by Paulo Neves.
-
AuthorPosts
-
patrickyipMemberThere 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!
Riyad KallaMember1) 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.
patrickyipMemberThanks 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
Riyad KallaMemberOpen 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.
patrickyipMemberI 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
Riyad KallaMemberPatrick,
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.
patrickyipMemberHi 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.classI 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
patrickyipMemberHi 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
Riyad KallaMemberI’m glad you got it working.
Paulo NevesMember@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
-
AuthorPosts