0 Replies Latest reply on Aug 16, 2006 5:29 PM by jamestang

    JBoss 4.0.4GA HA-JNDI not working with EJB3

    jamestang

      I have a very simple SLSB written in EJB3. The packaged EAR file is copied to "all/deploy" directory in two JBoss 4.0.4GA instances on two machines, n1 and n2. These two JBoss instances form a cluster within one subnet with same out-of-box configurations. The SLSB has annotation @Clustered. When looking up the SLSB, according to the JBoss clustering manual, the application client uses HA-JNDI:

      props.put(Context.PROVIDER_URL, "n1:1100,n2:1100")

      The app client worked fine.

      To simulate the failover, I undeployed myapp.ear from n1 by deleting it from "all/deploy" on n1 machine. At this time, both JBoss instances are running, but only n2 has my app deployed. Now executing the same app client, it hangs for about 30 seconds, then prints out "JNDI lookup fail" error.

      If I use:
      props.put(Context.PROVIDER_URL, "n2:1100")

      the app client works.

      If I stopped n1 instance, let the n2 instance running. The app client works with
      props.put(Context.PROVIDER_URL, "n1:1100,n2:1100")



      Before and after undeploying myapp.ear from n1, I looked at JMX console of the cluster. Clicked on the jboss:service=DefaultPartition MBean. A list of IP addresses for the cluster members (n1 and n2) is shown in the CurrentView field. So I think JGroup is working fine here.

      Are there any other configurations need to be changed?

      Thanks,
      James