glassfish
  1. glassfish
  2. GLASSFISH-542

WAR from an EAR as default webapp no more working after stop/start

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: other
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      542
    • Status Whiteboard:
      Hide

      fixed-9.0peur1

      Show
      fixed-9.0peur1

      Description

      Configuring the default webapp to an EAR's WAR and stop/start of the server from
      CLI will result in the default GF webapp to appear ! This means, even when it is
      working it is not persistent config.

      Note : this is a fork from issue 141, please see the 141 thread for the issue
      history.

        Activity

        Hide
        jluehe added a comment -

        After updating my ws with Binod's changes (which I had wrongly assumed had made
        it into b32), I still see a timing issue:

        The method that tries to initialize default web module, and fails to look up
        classloader from registry, has this stacktrace:

        at
        com.sun.enterprise.web.VirtualServer.findWebModuleInJ2eeApp(VirtualServer.java:745)
        at
        com.sun.enterprise.web.VirtualServer.getDefaultContextPath(VirtualServer.java:520)
        at com.sun.enterprise.web.PEWebContainer.createHost(PEWebContainer.java:531)
        at
        com.sun.enterprise.web.PEWebContainer.createHosts(PEWebContainer.java:453)
        at com.sun.enterprise.web.PEWebContainer.init(PEWebContainer.java:213)
        at
        com.sun.enterprise.web.PEWebContainer.createInstance(PEWebContainer.java:735)
        at
        com.sun.enterprise.web.PEWebContainerLifecycle.onInitialization(PEWebContainerLifecycle.java:57)
        at
        com.sun.enterprise.server.ApplicationServer.onInitialization(ApplicationServer.java:240)
        at
        com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:93)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:316)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)

        The method that adds the required classloader to the registry later during
        startup has this stacktrace:

        at
        com.sun.enterprise.server.ApplicationRegistry.addAppId2ClassLoader(ApplicationRegistry.java:172)
        at
        com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:430)
        at
        com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:183)
        at
        com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113)
        at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:208)
        at
        com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
        at
        com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
        at
        com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)

        Show
        jluehe added a comment - After updating my ws with Binod's changes (which I had wrongly assumed had made it into b32), I still see a timing issue: The method that tries to initialize default web module, and fails to look up classloader from registry, has this stacktrace: at com.sun.enterprise.web.VirtualServer.findWebModuleInJ2eeApp(VirtualServer.java:745) at com.sun.enterprise.web.VirtualServer.getDefaultContextPath(VirtualServer.java:520) at com.sun.enterprise.web.PEWebContainer.createHost(PEWebContainer.java:531) at com.sun.enterprise.web.PEWebContainer.createHosts(PEWebContainer.java:453) at com.sun.enterprise.web.PEWebContainer.init(PEWebContainer.java:213) at com.sun.enterprise.web.PEWebContainer.createInstance(PEWebContainer.java:735) at com.sun.enterprise.web.PEWebContainerLifecycle.onInitialization(PEWebContainerLifecycle.java:57) at com.sun.enterprise.server.ApplicationServer.onInitialization(ApplicationServer.java:240) at com.sun.enterprise.server.ondemand.OnDemandServer.onInitialization(OnDemandServer.java:93) at com.sun.enterprise.server.PEMain.run(PEMain.java:316) at com.sun.enterprise.server.PEMain.main(PEMain.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272) The method that adds the required classloader to the registry later during startup has this stacktrace: at com.sun.enterprise.server.ApplicationRegistry.addAppId2ClassLoader(ApplicationRegistry.java:172) at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:430) at com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:183) at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113) at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:208) at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204) at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332) at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112) at com.sun.enterprise.server.PEMain.run(PEMain.java:326) at com.sun.enterprise.server.PEMain.main(PEMain.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
        Hide
        jluehe added a comment -

        With Binod's latest changes applied, disabling QuickStartup does not make any
        difference and produces the same stack traces as above.

        Show
        jluehe added a comment - With Binod's latest changes applied, disabling QuickStartup does not make any difference and produces the same stack traces as above.
        Hide
        binod added a comment -

        Just to be sure, in 9.1, even in older builds where my recent changes are not
        in, QuickStartup doesnt make any difference to the "white page syndrome". I
        tested b27 and confirmed that it is the case.

        Show
        binod added a comment - Just to be sure, in 9.1, even in older builds where my recent changes are not in, QuickStartup doesnt make any difference to the "white page syndrome". I tested b27 and confirmed that it is the case.
        Hide
        jluehe added a comment -

        Binod, looks like the "blank page after restart if default-web-app is bundled in
        EAR" syndrom has been caused by my fix for

        https://glassfish.dev.java.net/issues/show_bug.cgi?id=1024
        ("Avoid treating a virtual server's default-web-module as a separate web
        application")

        which causes a virtual server's default-web-module to be initialized before the
        referenced web module has been loaded after a restart.

        I have a fix to delay the default-web-module initialization to when the web
        container is being started:

        at
        com.sun.enterprise.web.VirtualServer.findWebModuleInJ2eeApp(VirtualServer.java:745)
        at
        com.sun.enterprise.web.VirtualServer.getDefaultContextPath(VirtualServer.java:520)
        at
        com.sun.enterprise.web.WebContainer.loadDefaultWebModules(WebContainer.java:1011)
        at com.sun.enterprise.web.WebContainer.start(WebContainer.java:848)
        at
        com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:742)
        at
        com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:71)
        at
        com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
        at
        com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)

        at com.sun.enterprise.web.WebContainer.start(WebContainer.java:848)
        at
        com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:742)
        at
        com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:71)
        at
        com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
        at
        com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)

        I am going to add a unit test for this issue. Thank you for helping me look into
        this!

        Show
        jluehe added a comment - Binod, looks like the "blank page after restart if default-web-app is bundled in EAR" syndrom has been caused by my fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=1024 ("Avoid treating a virtual server's default-web-module as a separate web application") which causes a virtual server's default-web-module to be initialized before the referenced web module has been loaded after a restart. I have a fix to delay the default-web-module initialization to when the web container is being started: at com.sun.enterprise.web.VirtualServer.findWebModuleInJ2eeApp(VirtualServer.java:745) at com.sun.enterprise.web.VirtualServer.getDefaultContextPath(VirtualServer.java:520) at com.sun.enterprise.web.WebContainer.loadDefaultWebModules(WebContainer.java:1011) at com.sun.enterprise.web.WebContainer.start(WebContainer.java:848) at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:742) at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:71) at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332) at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112) at com.sun.enterprise.server.PEMain.run(PEMain.java:326) at com.sun.enterprise.server.PEMain.main(PEMain.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272) at com.sun.enterprise.web.WebContainer.start(WebContainer.java:848) at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:742) at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:71) at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332) at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112) I am going to add a unit test for this issue. Thank you for helping me look into this!
        Hide
        jluehe added a comment -

        Fixed:

        Checking in PEWebContainer.java;
        /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v
        <-- PEWebContainer.java
        new revision: 1.84; previous revision: 1.83
        done
        Checking in WebContainer.java;
        /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/WebContainer.java,v
        <-- WebContainer.java
        new revision: 1.75; previous revision: 1.74
        done

        Added unit test under:
        appserv-tests/devtests/web/virtualServerEarWrappedDefaultWebModuleRestart

        Show
        jluehe added a comment - Fixed: Checking in PEWebContainer.java; /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v <-- PEWebContainer.java new revision: 1.84; previous revision: 1.83 done Checking in WebContainer.java; /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/WebContainer.java,v <-- WebContainer.java new revision: 1.75; previous revision: 1.74 done Added unit test under: appserv-tests/devtests/web/virtualServerEarWrappedDefaultWebModuleRestart

          People

          • Assignee:
            jluehe
            Reporter:
            bjb
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: