Results 1 to 3 of 3

Thread: Spring MBean Deregister Exception in OC4J Undeploy

  1. #1
    Join Date
    Dec 2005
    Location
    Boulder, Colorado, USA
    Posts
    6

    Default Spring MBean Deregister Exception in OC4J Undeploy

    Hi,

    I am getting a Spring 1.2.1 exception when I undeploy my .ear in OC4J. Here's what happens:

    1. When I undeploy, OC4J deregisters all my MBean instances that were configured and registered at startup via Spring.

    2. Our ContextLoaderListener receives a contextDestroyed() event (which we do not override). Inside the default destroyed handler a series of bean destroys occur, including ones to destroy/deregister our MBeans.

    3. Since our MBeans have already been deregistered by OC4J, Spring can't find the MBeans when it requests them from the MBeanServer. Spring throws an InstanceNotFoundException for each MBean we originally created via Spring.

    Note, this only happens when using undeploy. A pure OC4J shutdown works fine (perhaps because OC4J does not itself deregister MBeans in shutdown).

    Also, it seems not to be a problem. But as you know, false positives can confuse things. What can we do to prevent this?

    Thanks much!

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

    Default

    You can probably raise an issue so that the on destroy, the factory bean doesn't have to unregister the beans. I haven't seen this behavior on other servers mainly because any cleanup (like local jmx server destruction) happens after the application has been shutdown not before.
    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
    Join Date
    Dec 2005
    Location
    Boulder, Colorado, USA
    Posts
    6

    Default

    Quote Originally Posted by Costin Leau
    You can probably raise an issue so that the on destroy, the factory bean doesn't have to unregister the beans. I haven't seen this behavior on other servers mainly because any cleanup (like local jmx server destruction) happens after the application has been shutdown not before.
    Ok, I will create an issue.

    Another problem I am seeing is when an MBean attempts to load rulesets into Drools (via the JSR-94 API). As you probably know, Drools uses an abstract rule schema (XSD) and then derives concrete schemas for each rule semantic language from the abstract. When I load rulesets through an MBean loaded by Spring, I see errors that various schema elements have duplicate definitions, a number of them like this:

    <Line 4, Column 31>: XML-24509: (Error) Duplicated definition for: 'rule-set'

    When I load rulesets via the same MBeans, but not registered via Spring, I never see these errors.

    Thanks!

Posting Permissions

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