7 Replies Latest reply on Mar 18, 2008 6:52 AM by Adrian Brock

    Registering listener on KernelEventManager

    Scott Stark Master

      I'm looking at providing a better startup notification as the current one from the ServerImpl occurs just at the end of the bootstrap phase. I'm trying to test out an example listener, but the following

      <deployment xmlns="urn:jboss:bean-deployer:2.0">
       <bean name="StartupMonitor"
       class="org.jboss.test.profileservice.lib.startup.StartupMonitor">
       <install bean="jboss.kernel:service=KernelEventManager" method="registerListener">
       <!-- registerListener(Object name, KernelEventListener listener, KernelEventFilter filter, Object handback) -->
       <parameter>jboss.kernel:service=KernelEventManager</parameter>
       <parameter><this/></parameter>
       <parameter><null/></parameter>
       <parameter><null/></parameter>
       </install>
       </bean>
      </deployment>
      


      fails with an error like:
      15:38:32,904 ERROR [AbstractKernelController] Error installing to Installed: name=StartupMonitor state=Start
      java.lang.IllegalArgumentException: Cannot install, context BeanKernelRegistryEntry@56d0a8c{target=org.jboss.kernel.plugins.event.AbstractEventManager@39cf701c} does not implement InvokeDispatchContext
       at org.jboss.kernel.plugins.dependency.InstallAction.installActionInternal(InstallAction.java:79)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:69)
       at org.jboss.system.deployers.TempBeanMetaDataDeployer.deploy(TempBeanMetaDataDeployer.java:48)
       at org.jboss.system.deployers.TempBeanMetaDataDeployer.deploy(TempBeanMetaDataDeployer.java:35)
      


      Why wouldn't the event mgr have an InvokeDispatchContext implementation?