4 Replies Latest reply on Aug 25, 2005 10:02 AM by Vincent Gay

    Clustering EJB3 Tutorial Not Working

    Alan Ho Newbie

      I have installed in my Win XP PC with jboss-4.0.3RC1-installer.jar with selection deploy type ejb3. My testing with most ejb3 (without @Clustered annotation) works fine. I tried to test clustering using the example in the tutorial download from JBoss site and follow the steps accordingly. On performing ant run.stateless and an run.stateful , the below error messages appeared in the console. I check the deploy folder (all) which has the following:
      ejb3-deployer
      ejb3-clustered-sfsbcache-service.xml
      ejb3-entity-cache-service.xml
      ejb3-interceptors-aop.xml

      I noticed that cluster-service.xml was missing and I copied one over. I copied the jbossha.jar to all/deploy/lib as well but all these did not solve the problem. Are there anybody who has successfully tested the Clustering EJB3 tutorial example??


      Total time: 0 seconds
      C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering>ant
      Buildfile: build.xml

      prepare:
      [mkdir] Created dir: C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering\build
      [mkdir] Created dir: C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering\build\cl
      asses

      compile:
      [javac] Compiling 6 source files to C:\jboss-EJB-3.0_Beta\docs\tutorial\clus
      tering\build\classes

      ejbjar:
      [jar] Building jar: C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering\build\t
      utorial.ejb3
      [copy] Copying 1 file to C:\jboss-4.0.3RC1-AllPlusEJB3\server\default\deplo
      y
      [copy] Copying 1 file to C:\jboss-4.0.3RC1-AllPlusEJB3\server\test\deploy

      BUILD SUCCESSFUL
      Total time: 2 seconds
      C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering>ant run.stateless
      Buildfile: build.xml

      prepare:

      compile:

      ejbjar:

      run.stateless:
      [java] Exception in thread "main" javax.naming.NameNotFoundException: org.j
      boss.tutorial.clustering.bean.Session not bound
      [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)

      [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)

      [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      sorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      hodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:585)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
      a:294)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
      t.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
      ransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:595)
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
      r(StreamRemoteCall.java:247)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
      ll.java:223)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
      [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:61
      0)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:57
      2)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      [java] at org.jboss.tutorial.clustering.client.StatelessRun.main(Statel
      essRun.java:18)
      [java] Java Result: 1

      BUILD SUCCESSFUL
      Total time: 6 seconds
      C:\jboss-EJB-3.0_Beta\docs\tutorial\clustering>ant run.stateful
      Buildfile: build.xml

      prepare:

      compile:

      ejbjar:

      run.stateful:
      [java] Exception in thread "main" javax.naming.NameNotFoundException: org.j
      boss.tutorial.clustering.bean.StatefulRemote not bound
      [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)

      [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)

      [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      sorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      hodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:585)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
      a:294)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
      t.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
      ransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:595)
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
      r(StreamRemoteCall.java:247)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
      ll.java:223)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
      [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:61
      0)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:57
      2)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      [java] at org.jboss.tutorial.clustering.client.StatefulRun.main(Statefu
      lRun.java:18)
      [java] Java Result: 1

      BUILD SUCCESSFUL
      Total time: 4 seconds

        • 1. Re: Clustering EJB3 Tutorial Not Working
          Diego Parra Newbie

          Hi,

          I think your problem its the Jboss you installed, the jar installer only comes with the default configuration, and clustering needs an all conf.

          I did the following:

          - Downloaded the non-jar file for Windows
          - Extracted the contents
          - Downloaded the last EJB3 distribution, and applied them into my Jboss directory with the instructions in readme.txt (except the aop directory, because the names are different)
          - Compiled the clustering example from tutorial.
          - My clustering ejb works fine without errors, the only problem its that I haven´t able to see the load balancing or the failover working, the calls are always handled by a single jboss, and they never reach the other server, and if I shutdown my server, the calls never gets redirected to the other server, instead my client gets an error

          Does anyone knows how to make load balancing and fail over works ...

          this is my jndi.properties

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=dev-diegop:1100,dev-franciscor:1100


          • 2. Re: Clustering EJB3 Tutorial Not Working
            Alan Ho Newbie

            Using the JBoss installation procedure you recommended works for the clustering example. When I tried the other example, such as stateful session beans, the following errors appeared in the console. Seems like there is no one installation that works for all implementation yet.

            C:\jboss-EJB-3.0_Beta\docs\tutorial\stateful>ant
            Buildfile: build.xml

            prepare:

            compile:

            ejbjar:

            BUILD SUCCESSFUL
            Total time: 1 second
            C:\jboss-EJB-3.0_Beta\docs\tutorial\stateful>ant run
            Buildfile: build.xml

            prepare:

            compile:

            ejbjar:

            run:
            [java] Exception in thread "main" javax.naming.NameNotFoundException: org.j
            boss.tutorial.stateful.bean.ShoppingCart not bound
            [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)

            [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)

            [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
            [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
            sorImpl.java:39)
            [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
            hodAccessorImpl.java:25)
            [java] at java.lang.reflect.Method.invoke(Method.java:585)
            [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
            a:294)
            [java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
            [java] at java.security.AccessController.doPrivileged(Native Method)
            [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
            t.java:460)
            [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
            ransport.java:701)
            [java] at java.lang.Thread.run(Thread.java:595)
            [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
            r(StreamRemoteCall.java:247)
            [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
            ll.java:223)
            [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
            [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:61
            0)
            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:57
            2)
            [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
            [java] at org.jboss.tutorial.stateful.client.Client.main(Client.java:25
            )
            [java] Java Result: 1

            BUILD SUCCESSFUL
            Total time: 4 seconds
            C:\jboss-EJB-3.0_Beta\docs\tutorial\stateful>

            • 3. Re: Clustering EJB3 Tutorial Not Working
              shashi kanth boddula Newbie

              I am not able to fing the Clustering tutorial of EJB3 in Jboss site . Please anybody give the URL?