-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: jboss 4 rc2 - har deployer uses
PostPosted: Thu Sep 09, 2004 5:20 am 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
hi all
im a bit perplexed ...
about the deployment in jboss 4 rc2 ++ /hibernate 2.1.6
after reading the jboss wikis and hibernate/66.html (concerning the 3.2.x versions)

first question is weather the issues in the docs concerning the
configuration of the container and mbean apply for jboss4. as well?

after all the libraries were placed in rc2,

all i have to do is to hotdeploy a .HAR :

---->metainf
---------->hibernate-service.xml

---->project
--------->files
------------>class1.hbm.xml
------------>class1.class


and then just :

Session session =
org.......SessionContext.getSession("java:/hibernate/SessionFactory")

thats it ??


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 09, 2004 7:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
first question is weather the issues in the docs concerning the
configuration of the container and mbean apply for jboss4. as well?

Not sure what you mean by this. You must configure the MBean (in hibernate-service.xml) and either a filter (for webapps) or ejb-interceptor (for ejbs), if thats what you are asking.

Quote:
all i have to do is to hotdeploy a .HAR :

As for the packaging, a HAR is just an archive. In terms of classloading of your classes think of it just like a JAR. So as long as your class1.class defines a class which is part of the "project.files" package, then that would be the correct setup.

Quote:
and then just :

Session session =
org.......SessionContext.getSession("java:/hibernate/SessionFactory")

Sure as long as "java:/hibernate/SessionFactory" is the namespace to which you asked the MBean to bind its session factory.


Top
 Profile  
 
 Post subject: thanx
PostPosted: Thu Sep 09, 2004 11:55 am 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
first - thank u for your quick answer -
i kinda got it together....

just making sure now, i deployed the .har
with the hibernate-service.xml
the hbm.xml's and the classes.

and i got the mbean -

added the :
Code:
<container-configuration extends="Standard Stateless SessionBean">
<container-name>Hibernate Stateless SessionBean</container-name>......
.......ejb interceptors stuff
.....


to the standartjboss

and used initialContext like :
Code:
SessionFactory factory;
              Context ctx = new InitialContext();
            factory = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
              Session sess = factory.openSession();
   ..........      
   User user= new User();
   sess.saveOrUpdate(seller);
   sess.close();


and....it worked!! my question is if im doing it right ?
and if i want to deploy another app - can i just add the mappings to the har
and redeploy it ? or its better to deploy a new one with another hiber-svc.xml ?

thankx


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 09, 2004 2:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
and if i want to deploy another app - can i just add the mappings to the har
and redeploy it ? or its better to deploy a new one with another hiber-svc.xml ?

Up to you. Might make sense if they share a lot of the same classes.

Note that you can also embed the har within an ear as a nested deployment.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.