0 Replies Latest reply on May 19, 2015 12:13 PM by b1102

    Increase ejb receivers number

    b1102

      Hello, I have distributed application, where client is Swing desctop client and server side is jBoss 7. The Swing client lookups ejb beans by this code:


      public Object lookUpBean(String serviceName,Class serviceClass)throws BusinessException{

       

        Object docomueBean;

        setRemoteProperties();

         try{

             LOG.debug("Look up the remote bean for the service: "+serviceName);

             EJBLocator locator;

              if(STATEFUL_SERVICES_NAMES.contains(serviceName)){

                  locator=EJBClient.createSession(serviceClass,DOCOMUE_APPLICATION_NAME,DOCOMUE_SERVICES_JAR_NAME,serviceName+BEAN_POSTFIX,"");

             }else{

                  locator=new StatelessEJBLocator(serviceClass,DOCOMUE_APPLICATION_NAME,DOCOMUE_SERVICES_JAR_NAME,serviceName+BEAN_POSTFIX,"");

        }

             docomueBean=EJBClient.createProxy(locator);

        }catch(Exception ex){

              throw new BusinessException(BusinessException.CREATE_SESSIONBEAN_FEHLGESCHLAGEN,errmsg,ex);

        }

           return docomueBean;

        }


      private void setRemoteProperties(){

           Properties clientProp=new Properties();

           clientProp.put(PROP_ENDP_NAME,"client-endpoint");

           clientProp.put(PROP_SSL_ENABLED,"false");

           clientProp.put(PROP_CONNECTIONS,"default");

           clientProp.put(PROP_PORT,System.getProperty(PROP_PORT));

           clientProp.put(PROP_HOST,System.getProperty(PROP_HOST));

           clientProp.put(PROP_USERNAME,System.getProperty(PROP_USERNAME));

           clientProp.put(PROP_PASSWORD,System.getProperty(PROP_PASSWORD));

           clientProp.put(PROP_SASL_POLICY_NOANONYMOUS,"false");

           EJBClientConfiguration cc=new PropertiesBasedEJBClientConfiguration(clientProp);

           final ContextSelector<EJBClientContext>selector=new ConfigBasedEJBClientContextSelector(cc);

           EJBClientContext.setSelector(selector);

        }

       

      After few minutes of the application working, the Swing client crashes with the "No ejb receiver ..." exception, so my question is there way to increase this number of ejb receivers?