[Management, JMX/JBoss] - dependency problem between MBean and EJB...
by flios
Hi there,
I'm creating a sample J2EE application with JBoss, with some EJBs and some MBeans.
What I would like is simple : the "create" callback of my MBean sould call a method from a session bean.
I saw that in the FAQ : http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanAnMBeanDependOnASessionBean
I made what was written : putting the dependency in the jboss.service.xml ; but it doesn't work... The problem may be that the MBean and the EJBs are in the same jar file. So I tried to organize differently my .ear file :
| mySample.ear
| - META-INF
| - application.xml
| - jboss-app.xml
| - mySampleMBeans.jar
| - ...
| - Toto.class <- the MBean implementation
| - TotoMBean.class <- the MBean interface
| - ...
| - myEJBs.jar
| - META-INF
| - persistence.xml
| - ...
| - myFacade.class <- the Session Bean implementation
| - myFacadeRemote.class <- the Session Bean interface
| - ...
| - mySampleMBeans.sar
| - META-INF
| - jboss-service.xml
|
I put in jboss-service.xml :
| <?xml version="1.0"?>
| <server>
| <mbean code="com.xxx.yyy.jmx.Toto" name="XXXX:service=Toto">
| <depends>
| jboss:service=Naming
| </depends>
| <depends>
| jboss.j2ee:module=myEJBs.jar,service=EjbModule
| </depends>
| </mbean>
| </server>
|
The result is that the Toto MBean is never started... (this means that the dependency exists, but not on the good module !!)
Any idea ?
Thx !!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035790#4035790
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035790
19 years
[Beginners Corner] - Re: JSPs in JBoss
by AggressiveFish
Thanks again Peter. I guess the layout is similar to JRun with the war and WEB-INFO directories. Couple of really stupid questions now:
when entering localhost:8080/ what path does that go to? The reason why I'm asking this is because the directory(ies) I thought i would lead to doesn't appear to. I tried to look at the document's properties for JBoss to get a filename or something but nothing in the properties gave much of a clue. I was trying to experiment with a simple JSP I had put it into the jmx-console.war but I wasn't sure if the errors I was getting was related to URL problems or with the setup of the JSP. Thanks again for any help/info you can spare.
AF
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035785#4035785
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035785
19 years
[JBoss Seam] - Re: Changes not persisted using EntityHome
by gzoller
It seems like overkill--and its a bit hard to describe w/o seeing it or the following struggles I've had trying to accomplish this very simple operation.
In a nutshell if I do it exactly like the tutorial I get an java.lang.UnsupportedOperationException. This is because my list comes from my entity's list, which happens to be a Hibernate PersistentBag. While PersistentBag does implement remove(), whatever AbstractList that happens to be used internally within PersistentBag when my program runs does not, so I get this exception. (If PersistenBag always used a backing List that supported remove() then I think I'd be ok here.)
Rather than use the Hibernate-generated list directly if I make a copy of this list into an ArrayList then I get exceptions about trying to em.remove() a detached object when I go to delete it. So to fix that I use the entityHome object to find a new (attached) copy but then I get this exception when I remove it: javax.persistence.EntityNotFoundException: deleted entity passed to persist. I have no idea what its complaining about here and started feeling I was beating my head against a wall.
So my solution seems like overkill but it does indeed work. I wish a simpler solution worked, but so far I haven't found one.
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035784#4035784
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035784
19 years