Results 1 to 5 of 5

Thread: JBoss MBean Deployment

Hybrid View

  1. #1

    Default JBoss MBean Deployment

    I am new to working with Spring + JMX. I have created a sar with an applicationContext that wires my beans as described in the Spring reference. However, I do not see the MBean deploy. I am unsure as to what information to put in the jboss-service.xml, which I believe is required for MBean registration. The docs say that Spring will register the beans, but I do not see any loading or registration ocurring. Is there something more to deploying sars with Spring that is not mentioned in the reference?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Spring needs to be started somehow but the container you are working with. I don't know what the case for JBoss but for Tomcat there is the ContextListener (this can be used also in JBoss, ofc).
    However note that SARs are archives packed in JBoss specific format and JBoss should take care of deploying them. The mbeans are read and deployed by JBoss itself without the need of Spring.
    Ofc, you can still use Spring to deploy mbean inside the JMX server but for that, as I said you have to bootstrap Spring which means changing your archive from sar to a simple war cofigured with ContextLstener inside the web.xml file.
    Note that this will work on any container which provides a JMX server (be it Tomcat, Jboss or Weblogic and so on) while SARs are JBoss-specific.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    Thanks for your quick reply. I was hoping to wire my beans using Spring and deploy to JBoss. Since JBoss requires a specific bean to implement the MBean interface, and have that bean described in the jboss-service.xml deployment descriptor in order to deploy it, how shall I deploy a Spring managed POJO?

    I suppose I can create a business delegate, and use that to wire into JBoss, but will Spring get loaded in order for me to take advantage of the bean wiring in this case?

    Thanks

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    but will Spring get loaded in order for me to take advantage of the bean wiring in this case?
    Unless Spring it's bootstrapped there isn't much you can do. Your object have to be managed by somebody Spring or JBoss - I don't think there is a bridge to make Spring and JBoss work together (i.e. make JBoss ask Spring for objects). JBoss also uses some sort of IoC to manage the objects you deploy inside the application server so Spring is not able to perform any IoC on them because its not controling the objects.
    What you can do is create a war file and start Spring through a context listener and publish your object through Spring to JMX. However you should check out the reference documentation and the EJB forum - maybe there is a better solution for making JBoss and Spring play together nicely .
    I haven't used Spring in such an environment so I can't comment (I actually moved an app from JBoss/EJB to Tomcat/Spring).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Feb 2012
    Posts
    1

    Default

    Guys

    I am also trying to deploy an mbean to JBoss and it it not working.

    I wrote a class (call it class) that implements both the DynamicMBean and ServletContextListener interfaces. I also added the following to my web.xml file.


    <listener>
    <listener-class>class</listener-class>
    </listener>


    My mbean appears fine when I deploy to Tomcat but not when I deploy to JBoss.

    Any ideas what I might be doing wrong?

    Regards

    Patrick
    Last edited by zzpprk; Feb 22nd, 2012 at 04:16 AM.

Similar Threads

  1. Replies: 3
    Last Post: Sep 22nd, 2005, 10:14 AM
  2. JBoss 3.2.6 & Spring Deployment issues
    By difranr in forum Container
    Replies: 2
    Last Post: Sep 18th, 2005, 10:08 PM
  3. Replies: 2
    Last Post: Jul 14th, 2005, 03:56 AM
  4. Replies: 2
    Last Post: Jan 21st, 2005, 09:58 AM
  5. NameNotFoundException: ejb not bound
    By alesj in forum EJB
    Replies: 2
    Last Post: Oct 19th, 2004, 11:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •