3 Replies Latest reply on May 9, 2013 11:30 AM by rhusar

    Accessing a Cluster AS7 Servers from a POJO Client

    foutjo

      I currently have a cluster setup using a Domain controller to manage the cluster.

      My problem is I can't get my java client to connect to one of my clustered servers.

       

      Here is my current setup:

       

      Machine A - domain controller

       

      Machine B - host controller

          Server B

       

      Machine C - host controller

         Server C

       

       

      I have the following SLSB deployed on all servers:

       

      @Stateless

      @Remote(BGController_RemoteInf.class)

      @Clustered

      public class BGController implements BGController_RemoteInf

      {

      .

      .

       

      My client to access the clustered servers is NOT a JSP but rather a simple java program(POJO) running in its own JVM.

       

      Here is a snippit from my client code:

       

        try

            {

               final Hashtable<String,String> jndiProperties = new Hashtable<String, String>();

               jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

               final Context context = new InitialContext(jndiProperties);

               final String appName = "";

               final String moduleName = "LIDP_BGProcess";

               final String distinctName = "";

               final String beanName = "BGController";

               final String viewClassName = BGController_RemoteInf.class.getName();

               String bean = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

                       

               BGController_RemoteInf testBean = (BGController_RemoteInf) context.lookup(bean);

                testBean.process(load);       

              

            }

            catch (Exception e)

            {

                LOGGER.error("Exception /BGController");

                e.printStackTrace();

            }         

       

       

      Finally here is how jboss.ejb.client.properties is defined:

       

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

      remote.connections=default

      remote.connection.default.host=10.90.100.21

      remote.connection.default.port=4447

      remote.connection.default.username=xxxxx

      remote.connection.default.password=xxxx

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

      remote.connection.two.host=10.90.100.2

      remote.connection.two.port=4447

      remote.connection.two.username=xxxxx

      remote.connection.two.password=xxxx

      remote.connection.two.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

       

      When executing the client I get the following stacktrace:

       

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:LIDP_BGProcess, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@56f4defc

          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693)

          at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:177)

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161)

          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)

          at $Proxy0.process(Unknown Source)

          at com.lidp.main.StartBGProcess.<init>(StartBGProcess.java:43)

          at com.lidp.main.StartBGProcess.main(StartBGProcess.java:22)

       

       

      My thought is that I don't have the jboss.ejb.client.properties setup correctly.

      Any thoughts on what I might be doing wrong would be greatly appreciated.

       

      Thanks.

        • 1. Re: Accessing a Cluster AS7 Servers from a POJO Client
          wdfink

          How is your app deployed?

          If you deploy an ear you need to set appName and moduleName, if you deploy a jar file you need to set appNme empty.

          As you use a domain you need to post the host configuratin for the servers and the log where it is shown how the JNDI is bound.

           

          You might have a look to my quickstart where I use a domain to deploy several apps.

          In your case you the client is able to access both server, but is not using the cluster features autodetection. See the examples in the clients quickstart, you need to add a cluster section to the jboss-ejb-client.properties

          • 2. Re: Accessing a Cluster AS7 Servers from a POJO Client
            foutjo

            Thanks for your help Wolf.  I will take a look a the client quickstarts and see if I can get

            them to work.

             

            OT - I am also trying to get mod_cluster to work and I'm having some proplems.  I downloaded

                   the latest build from the jboss mod_cluster site for my windows x64 machine.  I unziped

                   the contents to my c: drive.  In all of the JBoss examples for setting mod_cluster they get to

                   a step that says start mod_cluster:

             

                  Now start your Apache httpd with the following command: ./opt/jboss/httpd/sbin/apachectl start

             

                  No where in my structure do I have that path or the file apachectl.   Would you know what I might be missing?

             

            Thanks again for your help.

            • 3. Re: Accessing a Cluster AS7 Servers from a POJO Client
              rhusar

              For mod_cluster question please open a new thread in the mod_cluster space.