-
1. Re: JBoss CMP Clustering
budworth Nov 21, 2003 8:10 PM (in response to raman2072)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