glassfish
  1. glassfish
  2. GLASSFISH-20027

4.0 deployment performance - web ha module get loaded for a simple web app deployment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0_b81
    • Fix Version/s: 4.0_b82_EE7MS7
    • Component/s: web_container
    • Labels:
      None

      Description

      The web ha module get loaded for a simple web app deployment.

      After the intial deployment, the web-ha module is loaded and in active state.
      254|Active | 1|Web Container HA code (4.0.0.SNAPSHOT)

      The snippet of stack trace to trigger this module loading during initial deployment:

      org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
      org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:1639)
      org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:362)
      org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:1701)
      org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:898)
      org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:599)
      org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:584)
      com.sun.enterprise.web.WebContainer.getWebContainerFeatureFactory(WebContainer.java:3661)
      com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:709)
      org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:282)
      org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:329)
      org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
      org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:107)
      org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2203)
      org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
      org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:86)
      com.sun.enterprise.v3.server.ApplicationLifecycle.startContainers(ApplicationLifecycle.java:1008)
      com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:714)
      com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:374)

        Issue Links

          Activity

          Hide
          Hong Zhang added a comment -

          This is a regression from 3.1: http://java.net/jira/browse/GLASSFISH-17041

          Show
          Hong Zhang added a comment - This is a regression from 3.1: http://java.net/jira/browse/GLASSFISH-17041
          Hide
          Amy Roh added a comment - - edited

          When web container is started with a simple war deployment, the server-config contains the following in the domain.xml -

          <availability-service></availability-service>

          Since global availability-enabled is true by default and the server-config does not contain <web-container-availability>, WebContainer#getWebContainerFeatureFactory is returning WebContainerFeatureFactory for HA (HAWebContainerFeatureFactoryImpl).

          If I explicitly add availability-enabled="false" for web-container-availability, the correct PEWebContainerFeatureFactoryImpl gets loaded.

          <availability-service>
          <web-container-availability availability-enabled="false"></web-container-availability>
          </availability-service>

          In order to not load the web-ha module for simple web deployment,

          [1] The default value for web-container-availability availability-enabled=false in the domain.xml should be explicitly defined.

          or

          [2] Change implementation for ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig. Currently, if web-container-availability does not exist (null), getWebContainerAvailabilityEnabledFromConfig returns the global availability-enabled value which is true.

          ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig() {
          boolean globalAvailabilityEnabled = getAvailabilityEnabledFromConfig();
          WebContainerAvailability was = getWebContainerAvailability();
          if (was == null) {
          if (_logger.isLoggable(Level.FINEST))

          { _logger.log(Level.FINEST, WEB_CONTAINER_AVAILABILITY_NOT_DEFINED); }

          return globalAvailabilityEnabled; // we should return false if web-container-availability is null
          }

          if (was.getAvailabilityEnabled() == null)

          { return globalAvailabilityEnabled; }

          else

          { return toBoolean(was.getAvailabilityEnabled()); }

          }

          If we don't want to load web-ha module by default web container start when <web-container-availability> does not exist in the domain.xml, we should return false from ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig rather than using the global availability-enabled value which is true by default.

          Show
          Amy Roh added a comment - - edited When web container is started with a simple war deployment, the server-config contains the following in the domain.xml - <availability-service></availability-service> Since global availability-enabled is true by default and the server-config does not contain <web-container-availability>, WebContainer#getWebContainerFeatureFactory is returning WebContainerFeatureFactory for HA (HAWebContainerFeatureFactoryImpl). If I explicitly add availability-enabled="false" for web-container-availability, the correct PEWebContainerFeatureFactoryImpl gets loaded. <availability-service> <web-container-availability availability-enabled="false"></web-container-availability> </availability-service> In order to not load the web-ha module for simple web deployment, [1] The default value for web-container-availability availability-enabled=false in the domain.xml should be explicitly defined. or [2] Change implementation for ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig. Currently, if web-container-availability does not exist (null), getWebContainerAvailabilityEnabledFromConfig returns the global availability-enabled value which is true. ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig() { boolean globalAvailabilityEnabled = getAvailabilityEnabledFromConfig(); WebContainerAvailability was = getWebContainerAvailability(); if (was == null) { if (_logger.isLoggable(Level.FINEST)) { _logger.log(Level.FINEST, WEB_CONTAINER_AVAILABILITY_NOT_DEFINED); } return globalAvailabilityEnabled; // we should return false if web-container-availability is null } if (was.getAvailabilityEnabled() == null) { return globalAvailabilityEnabled; } else { return toBoolean(was.getAvailabilityEnabled()); } } If we don't want to load web-ha module by default web container start when <web-container-availability> does not exist in the domain.xml, we should return false from ServerConfigLookup#getWebContainerAvailabilityEnabledFromConfig rather than using the global availability-enabled value which is true by default.
          Hide
          Amy Roh added a comment -

          Fixed in 60898.

          Show
          Amy Roh added a comment - Fixed in 60898.

            People

            • Assignee:
              Amy Roh
              Reporter:
              Hong Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: