1. glassfish
  2. GLASSFISH-19789 Deployment of applications to multi-cluster domain fails if custom resource adapter not deployed to all clusters in domain.


    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      GF Multi-clustered domain.


      1. Create a 2 cluster domain
      2. Deploy a custom resource adapter to cluster1.
      3. Deploy an application containing an EJB with a @Resource annotation to the cluster2 and an NPE is thrown when evaluating the appInfo.getMetaData expression:

      if (isRAConnectionFactory(type, appInfo.getMetaData(Application.class)))

      from the following method:

          public static boolean isRAConnectionFactory(Habitat habitat, 
              String type, Application thisApp) {
              // first check if this is a connection factory defined in a resource
              // adapter in this application
              if (isRAConnectionFactory(type, thisApp)) {
                  return true;
              // then check if this is a connection factory defined in a standalone 
              // resource adapter
              Applications applications = habitat.getComponent(Applications.class);
              if (applications != null) {
                  List<com.sun.enterprise.config.serverbeans.Application> raApps = applications.getApplicationsWithSnifferType(com.sun.enterprise.config.serverbeans.Application.CONNECTOR_SNIFFER_TYPE, true);
                  ApplicationRegistry appRegistry = habitat.getComponent(ApplicationRegistry.class);
                  for (com.sun.enterprise.config.serverbeans.Application raApp : raApps) {
                      ApplicationInfo appInfo = appRegistry.get(raApp.getName());
                      if (isRAConnectionFactory(type, appInfo.getMetaData(Application.class))) {   
                          return true;
              return false; 

      The code assumes that the appInfo is available on all clusters but this does not appear to be the case for cluster where the custom RA is deployed.

      My work around has been to deploy the custom RA to target all clusters in the domain so that the required info is available to prevent the NPE from arising. An alternative is to put a null-check is the condition but I was not sure if this should be fixed further up stack, or if there would be side-effects to doing so.


        There are no comments yet on this issue.


          • Assignee:
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: