1 Reply Latest reply on Oct 7, 2003 5:59 PM by Adrian Brock

    How to auto instantiate SLSB upon server startup?

    Winston Ng Newbie

      Is there a way to specify in the configuration file to instantiate an instance of a SLSB upon the startup of Jboss server?

      I need at least one SLSB to register its listener with my MBean so that the MBean can start broadcasting events to the SLSB(s). Without this auto-instantiation, events could pile up at the MBean while its waiting for an SLSB to be instantiated by some client.

      One solution I tried was to have the MBean lookup the SLSB via JNDI and call it directly to send the event. This requires that I package the SLSB's interfaces in the MBean jar. However, upon redeploying SLSB the server would fail to deploy it properly. I'd have to restart the server to have the same jarfile deployed correctly. (Not sure if this has to do with conflicting classloading issues...)

      Please advise. Thanks!
      Kai

        • 1. Re: How to auto instantiate SLSB upon server startup?
          Adrian Brock Master

          You are doing it wrong.

          An SLSB should not have points of entry that are outside
          the control of the container.

          You should write a notification listener that invokes the SLSB
          through the local interface.

          Redeploying dependent applications has been discussed
          many times before. The mechanism depends upon
          your contraints.
          Keywords to research:
          russian doll
          sar inside ejb jar
          ejb jar inside sar

          LoaderRepository
          ByValueInvokerInterceptor
          UnifiedClassLoader
          ClassCastException

          Regards,
          Adrian