Announcement Announcement Module
Collapse
No announcement yet.
Spring MBean Deregister Exception in OC4J Undeploy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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!

      Comment

      Working...
      X