0 Replies Latest reply on Aug 3, 2015 8:12 AM by Klaus Pilz

    multiple ejb receiver for remote invocation

    Klaus Pilz Newbie

      I have an issue to connect to an identical remote EJB deployed on two seperate Jboss server instances (no cluster).

      The bean DragonBackendMgmtBean!com.durr.ecoemos.dragon.backend.interfaces.DragonBackendRemoteMgmt is deployed there, coming up with different results.

      I need a union for all registered pages on each server..

       

      I configured two receivers and the according entries in standalone.xml

      Each EJB call works perfect, if i only a single ejb receiver is present in jboss-ejb-client.xml.

      My problem is: How call i determine the correct receiver to be used during my lookup ?

      I tried to change the receiver, using a ConfigBasedEJBClientContextSelector, but this is blocked by security.

      Any ideas ? I invested serveral hous of investigation, but found no solution for that issue.

       

      This is my jboss-ejb-client.xml:

      <jboss-ejb-client xmlns="urn:jboss:ejb-client:1.0">

          <client-context>

              <ejb-receivers>

                  <remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection"/>

                  <remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection2"/>

              </ejb-receivers>

          </client-context>

      </jboss-ejb-client>

       

      This is my remote ejb call: (Where can i set the receiver for the lookup ? Any Properties ? Callbacks ?  )

       

                  final Hashtable props = new Hashtable();

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

                  final Context context = new javax.naming.InitialContext(props);

       

                  PageProvider pp = (PageProvider) context.lookup("ejb:/dragon-backend-6//DragonBackendMgmtBean!com.durr.ecoemos.dragon.backend.interfaces.DragonBackendRemoteMgmt");

                  for (Page p : pp.getRegisteredPages()) {

                      registeredPagesMap.put(p.getId(), p);

                  }

                  LOGGER.info("... RegisteredPages =" + registeredPagesMap.size());