1 Reply Latest reply on Feb 2, 2004 11:27 PM by Ivelin Ivanov

    How to deploy servlets with dependency on a siglenton in a c

    naveen123 Newbie

      Question : How do I deploy my application such that
      the servlets contain a dependency clause on the
      MBean which is a singleton

      Problem explanation:
      My application is deployed as sar - namely ste.sar which
      declares few JMS queues and a MBean with declaration as follows


      jboss.mq.destination:service=Topic,name=parentConnection
      jboss.ejb:service=EJBDeployer
      jboss:service=Naming
      appstream/ste


      This sar also contains a ste.war. There a 3 servlets defined in this war that depend on the above mentioned MBean deployed and running.

      Now I am trying to device a failover/backup mechanism
      by deploying in a clustered environement similar to the
      Singleton Service pattern described in the article on clustering.
      http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html

      I want this "MBean and the servlets" to be controlled by HASingletonController such that it is active on one and only one instance of JBoss and "dormant" on the backup JBoss in the clustered environment, What more do I add to this declaration???


      jboss:service=DefaultPartition
      appstream.ste:service=StreamletEngine
      appstream.ste:service=StreamletEngine
      create
      stop


      The MBean behaves perfectly as a singleton and is active on one JBoss
      The servlets which reference the MBean JNDIName appstream/ste fails to start with this error
      13:50:01,417 INFO [Engine] StandardWrapper[/ste:invoker]: Loading container servlet invoker
      13:50:02,018 ERROR [STDERR] javax.naming.NameNotFoundException: appstream not bound
      13:50:02,018 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      13:50:02,028 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)

      Goal is not to achieve HTTP Session clustering and load balancing but just a secondary backup server which re-initializes and start when the Master goes down.

      naveen