0 Replies Latest reply on May 18, 2005 3:40 AM by Ashish Shankerdas

    JNDI lookup failing in clustered environment in JBoss-3.2.3

    Ashish Shankerdas Newbie

      Hi,
      I have trying, without success, since the past few days, to lookup a bean in a clustered environment. I am using JBoss-3.2.3
      Here is my scenario:
      There are 2 nodes in my cluster. Say node1 and node2
      I have a bean "MySampleBean" deployed on both the nodes and set the atttribute to "true".
      The bean is bound to jndi name "MySampleBean".

      I startup both the nodes. I have a standalone code on node1 which looks up "MySampleBean". I carry out the lookup as follows:

      Context ctx = new InitialContext();
      ctx.looup("MySampleBean");


      My jndi.properties file contains the following:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      I keep getting the following error:

      javax.naming.CommunicationException: Failed to retrieve stub from server 0.0.0.0:1100

      Sometimes i even get "ReceiveTimedOut" error.

      Can anyone suggest a solution for this?


      My cluster-service.xml is as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- ===================================================================== -->
      <!-- -->
      <!-- Sample Clustering Service Configuration -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <server>
      
       <classpath codebase="lib" archives="jbossha.jar"/>
      
       <!-- ==================================================================== -->
       <!-- Cluster Partition: defines cluster -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.framework.server.ClusterPartition"
       name="jboss:service=DefaultPartition">
      
       <!-- Name of the partition being built -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- Determine if deadlock detection is enabled -->
       <attribute name="DeadlockDetection">False</attribute>
       <!-- The JGroups protocol configuration -->
       <attribute name="PartitionConfig">
       <Config>
       <TCP start_port="7700" bind_addr="10.44.60.136"/>
      <TCPPING initial_hosts="10.44.60.131[7700]" port_range="1" timeout="3000"
      num_initial_members="1" up_thread="true" down_thread="true"/>
      <FD shun="true" up_thread="true" down_thread="true"
      timeout="2500" max_tries="5" />
      <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
      <pbcast.NAKACK gc_lag="100" retransmit_timeout="3000" up_thread="true" down_thread="true" />
      <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
      <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="false" print_local_addr="false" down_thread="true" up_thread="true" />
      <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
       </Config>
       </attribute>
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- HA Session State Service for SFSB -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
       name="jboss:service=HASessionState">
       <depends>jboss:service=DefaultPartition</depends>
       <!-- Name of the partition to which the service is linked -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- JNDI name under which the service is bound -->
       <attribute name="JndiName">/HASessionState/Default</attribute>
       <!-- Max delay before cleaning unreclaimed state.
       Defaults to 30*60*1000 => 30 minutes -->
       <attribute name="BeanCleaningDelay">0</attribute>
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- HA JNDI -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.ha.jndi.HANamingService"
       name="jboss:service=HAJNDI">
       <depends>jboss:service=DefaultPartition</depends>
       <!-- Name of the partition to which the service is linked -->
       <attribute name="PartitionName">DefaultPartition</attribute>
       <!-- bind address of HA JNDI RMI endpoint -->
       <attribute name="BindAddress">${jboss.bind.address}</attribute>
       <!-- RmiPort to be used by the HA-JNDI service
       once bound. 0 => auto. -->
       <attribute name="RmiPort">0</attribute>
       <!-- Port on which the HA-JNDI stub is made available -->
       <attribute name="Port">1100</attribute>
       <!-- Backlog to be used for client-server RMI
       invocations during JNDI queries -->
       <attribute name="Backlog">50</attribute>
      
       <!-- Multicast Address and Group used for auto-discovery -->
       <attribute name="AutoDiscoveryAddress">230.0.0.4</attribute>
       <attribute name="AutoDiscoveryGroup">1102</attribute>
      
       <!-- IP Address to which should be bound: the Port, the RmiPort and
       the AutoDiscovery multicast socket. -->
       <!-- Client socket factory to be used for client-server
       RMI invocations during JNDI queries -->
       <!--attribute name="ClientSocketFactory">custom</attribute-->
       <!-- Server socket factory to be used for client-server
       RMI invocations during JNDI queries -->
       <!--attribute name="ServerSocketFactory">custom</attribute-->
       </mbean>
      
       <mbean code="org.jboss.invocation.jrmp.server.JRMPInvokerHA"
       name="jboss:service=invoker,type=jrmpha">
       <attribute name="ServerAddress">${jboss.bind.address}</attribute>
       <!--
       <attribute name="RMIObjectPort">0</attribute>
       <attribute name="RMIClientSocketFactory">custom</attribute>
       <attribute name="RMIServerSocketFactory">custom</attribute>
       -->
       </mbean>
      
       <!-- ==================================================================== -->
       <!-- Distributed cache invalidation -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge"
       name="jboss.cache:service=InvalidationBridge,type=JavaGroups">
       <depends>jboss:service=DefaultPartition</depends>
       <depends>jboss.cache:service=InvalidationManager</depends>
       <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute>
       <attribute name="PartitionName">DefaultPartition</attribute>
       <attribute name="BridgeName">DefaultJGBridge</attribute>
       </mbean>
      
      </server>


      I am running JBoss under "all"

      Thank you.