0 Replies Latest reply on Oct 10, 2005 6:29 AM by mstacey

    HA-JNDI and resource archive

    mstacey

      Hi,

      Using JBoss 3.2.6 I started with the default config for our application. I want to split some of the deployed applications to two JBoss instances. I've taken cluster-service.xml (and jar files for jgroups) and deployed it to the two instances. The find each other on start up.

      The problem happens when I try to look up the JCA application from an MDB, both of them running in the different instances. From the MDB, I look up the JCA as follows:

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "jnp://localhost:1100"); // HA-JNDI port.
      InitialContext initialContext = new InitialContext(p);
      return initialContext.lookup("java:/RemoteJcaRAR");
      


      But I get the following exception:

      javax.naming.NameNotFoundException: RemoteJcaRAR not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:490)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:498)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:504)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:277)
       at org.jboss.ha.jndi.TreeHead.lookupLocally(TreeHead.java:273)
       at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:192)
       at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:131)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:187)
       at $Proxy151.lookup(Unknown Source)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
      


      On the second instance running the JCA resource archive application, I see the following from startup and from when the call is made to the initial context:

      10:21:50,147 INFO [ServiceBindingManager] Initializing store
      10:21:50,147 INFO [ServiceBindingManager] Using StoreURL: file:/C:/jboss-3.2.6/docs/examples/binding-manager/sample-bindings.xml
      10:21:50,866 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
      10:21:51,007 INFO [WebService] Using RMI server codebase: http://brian:8183/
      10:21:51,241 INFO [NamingService] Started jndi bootstrap jnpPort=1199, rmiPort=1198, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Se
      ver SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
      10:21:57,304 INFO [DefaultPartition] Initializing
      10:21:57,460 INFO [UDP] unicast sockets will use interface 192.168.0.12
      10:21:57,491 INFO [UDP] socket information:
      local_addr=brian:3860 (additional data: 17 bytes), mcast_addr=228.1.2.3:45566, bind_addr=/192.168.0.12, ttl=32
      sock: bound to 192.168.0.12:3860, receive buffer size=150000, send buffer size=800000
      mcast_recv_sock: bound to 192.168.0.12:45566, send buffer size=800000, receive buffer size=150000
      mcast_send_sock: bound to 192.168.0.12:3861, send buffer size=800000, receive buffer size=150000
      10:21:57,491 INFO [STDOUT]
      -------------------------------------------------------
      GMS: address is brian:3860 (additional data: 17 bytes)
      -------------------------------------------------------
      10:21:59,647 INFO [DefaultPartition] Number of cluster members: 2
      10:21:59,647 INFO [DefaultPartition] Other members: 1
      10:21:59,647 INFO [DefaultPartition] Fetching state (will wait for 60000 milliseconds):
      10:21:59,647 INFO [DefaultPartition] New cluster view for partition DefaultPartition: 1 ([192.168.0.12:1099, 192.168.0.12:1199] delta: 0)
      10:21:59,679 INFO [DefaultPartition] I am (null) received membershipChanged event:
      10:21:59,679 INFO [DefaultPartition] Dead members: 0 ([])
      10:21:59,679 INFO [DefaultPartition] New Members : 0 ([])
      10:21:59,679 INFO [DefaultPartition] All Members : 2 ([192.168.0.12:1099, 192.168.0.12:1199])
      10:22:00,069 INFO [HANamingService] Listening on /0.0.0.0:1200
      10:22:00,069 INFO [DetachedHANamingService$AutomaticDiscovery] Listening on /0.0.0.0:1102, group=230.0.0.4, HA-JNDI address=192.168.0.12:1200
      10:22:00,632 INFO [Embedded] Catalina naming disabled
      10:22:01,304 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-81
      10:22:01,382 INFO [Catalina] Initialization processed in 656 ms
      10:22:01,382 INFO [StandardService] Starting service jboss.web
      10:22:01,382 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.28
      10:22:01,398 INFO [StandardHost] XML validation disabled
      10:22:01,429 INFO [Catalina] Server startup in 47 ms
      10:22:01,538 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/jboss-3.2.6/server/jca/deploy/jbossweb-tomcat50.sar/ROOT.war/
      10:22:02,835 INFO [RemoteJcaRAR] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=NoTxCM,name=RemoteJcaRAR to JNDI
      name 'java:/RemoteJcaRAR'
      10:22:03,069 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss-3.2.6/server/jca/deploy/jmx-console.war/
      10:22:03,523 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/jboss-3.2.6/server/jca/deploy/management/web-console.war/
      10:22:04,288 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-81
      10:22:04,429 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8109
      10:22:04,429 INFO [JkMain] Jk running ID=0 time=0/16 config=null
      10:22:04,444 INFO [Server] JBoss (MX MicroKernel) [3.2.6 (build: CVSTag=JBoss_3_2_6 date=200410140106)] Started in 17s:438ms
      10:25:56,169 WARN [DefaultPartition] javax.naming.NameNotFoundException: RemoteJcaRAR not bound
      


      You can see that even though it claims RemoteJcaRAR is being bound to JNDI, when the DefaultPartition tries to look it up, it fails.

      Is it possible I'm missing a step in the configuration of my cluster, my JCA application or my lookup?

      thanks!

      Mark