1 Reply Latest reply on Nov 21, 2003 8:10 PM by budworth

    JBoss CMP Clustering

    raman2072

      Hi,
      I have two JBoss Server instances running on two different WIN-2K boxes. I have a WEB-APP(jsps) accessing CMPbeans on each instance. Now, I have clustered the CMPs alone and the cluster setup is fine since I see a log in both the servers recognizing the nodes each other.

      Now the scenario is I undeploy the CMP alone in one instance only(so the other node and CMP should still be fine!). Now when I access the jsp page in this scenario, I always get a message saying the reqd. CMP beans are not bound! Why are the jsps from this machine not able to pick up the CMPs from the other cluster?

        • 1. Re: JBoss CMP Clustering
          budworth

          Make sure you are looking in HAJNDI for the ejbs

          In your JSP, rather than doing
          InitialContext ic = new InitialContext();

          you need to do
          Properties p = new Properties();
          p.put("java.naming.provider.url",":1100");
          InitialContext ic = new InitialContext(p);


          The difference is, local JNDI wont look in HAJNDI when performing the lookup. So the EJB bound on the other server isn't found. The second method connects you to HAJNDI to perform the lookup.

          It will work the same if you have a locally deployed EJB as HAJNDI first checks the local jndi before looking at other servers in the cluster. So HAJNDI lookups will always return the local instance of the EJB home (I believe) which is a good thing for performance reasons.

          Also, remember that EJBLocal type EJBs can't be used remotely from your JSP. So make sure you expose remote interfaces for your ejbs.

          -david