[JBoss AOP] - Re: AOP configuration in AS
by ekobir
Hi All
Is it right to think assumption at below?
Whenever a war file is deployed, JBoss application server's class loader loads the class which implements ServletContext then trigger the ServletContextEvent.
Before all operation above, I assume that all configurations(web.xml, jboss-aop.xml, application.xml or vs) are read.
Therefore AOP advices/interceptions even on ServletContext implementation will be vlid as firstly config is read then initialization is done.
What could happen if more than web applications are deployed on same jboss instance? Would Class file of ServletContext implementation be loaded per class loader assigned to war file or same loaded class be used every war file? (What kind of class loading hierarchy is there??)
Thanks a lot for your help...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185247#4185247
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185247
17 years, 6 months
[Management, JMX/JBoss] - jxm stop ear application, including war
by smpub2000
Regarding the jmx api to start/stop an ear application using the MBeans: When the corresponding MBean stop() is invoked on url for the ear in the jboss.j2ee domain, it stops the EJBSs, but not the war application that is contained with the EAR.
I see that the war MBean is listed separately under jboss.web domain, but it does not list the EAR name, so you can't know dynamically which EAR file its in, and therefore if it should be stopped as part of the EAR application stop. I would appreciate any ideas on how, given an EAR application name, you can lookup all its components (including WAR, etc) and start/stop all of them.
Thanks.
SM.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185239#4185239
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185239
17 years, 6 months
[Installation, Configuration & DEPLOYMENT] - Re: No active transaction
by areian
Hey again.
I Found a solution: It works if I manually inject an EntityManager using the EntityManagerFactory. I was just under the impression that it was supposed to do that automatically in a container mannaged environment.
The revised code for the session bean follows:
| package sm.comm.frontend2.beans.sessions;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.EntityManagerFactory;
| import javax.persistence.PersistenceContext;
| import javax.persistence.PersistenceUnit;
| import sm.beans.entities.Employee;
| import sm.comm.frontend2.dtos.assemblers.EmployeeAssembler;
| import sm.comm.frontend2.dtos.assemblers.SkillAssembler;
| import sm.comm.frontend2.dtos.DetailEmployeeDTO;
| import sm.comm.frontend2.dtos.SkillDTO;
|
| @Stateless
| public class F2FacadeBean implements F2FacadeRemote {
| @PersistenceUnit
| private EntityManagerFactory em;
|
| public DetailEmployeeDTO EmployeeDTO(int id) {
| Employee emp = em.createEntityManager().find(Employee.class, id);
| return EmployeeAssembler.createDetailEmployeeDTO(emp);
| }
|
| public void persistSkill(SkillDTO skill) {
| System.out.println(skill.getName());
| System.out.println(em.createEntityManager().isOpen());
| em.createEntityManager().persist(SkillAssembler.createSkill(skill));
| }
|
| public String hello() {
| return "Hello World!";
| }
|
| }
|
It contains some debugging code, but the idea should be clear.
I just got brain wave. Am I right in thinking that if I want to directly inject the EntityManager I should use @PersistenceContext, and if I use @PersistenceUnit I need to use the factory?
Thanks a lot for the time taken to help out with this
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185235#4185235
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185235
17 years, 6 months