glassfish
  1. glassfish
  2. GLASSFISH-19789

3.1.2.2 Deployment of applications to multi-cluster domain fails if custom resource adapter not deployed to all clusters in domain.

    Details

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

      GF 3.1.2.2 Multi-clustered domain.

      Description

      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.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            michael.y.chen
            Reporter:
            hopesea
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: