glassfish
  1. glassfish
  2. GLASSFISH-1426

DAS fails to start up when a referred resource is missing

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,426
    • Status Whiteboard:
      Hide

      fixed-pwc12

      Show
      fixed-pwc12

      Description

      A resource that was present at time of deployment is later deleted.
      The app that was successfully deployed is now missing a necessary
      resource. However, the missing resource should prevent only the
      affected applications from loadning. Preently PE/DAS will fail
      to start up. This prevents me from going in and fixing the issue.

      See stack trace.

      [#|2006-11-01T15:42:56.390-0800|SEVERE|sun-appserver-pe9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;_RequestID=1ace306c-05b4-49fa-9e36-326142afd4e7;|CORE5071:
      An error occured during initialization
      java.lang.RuntimeException: java.lang.RuntimeException:
      javax.naming.NameNotFoundException: sample not found
      at
      com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits(WebModuleListener.java:177)
      at
      com.sun.enterprise.web.WebModuleListener.lifecycleEvent(WebModuleListener.java:152)
      at
      org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:130)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4673)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:317)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1095)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:924)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1095)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:920)
      at com.sun.enterprise.web.WebContainer.start(WebContainer.java:814)
      at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:764)
      at
      com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:72)
      at
      com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
      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)
      Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException:
      sample not found
      at
      com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(PersistenceUnitInfoImpl.java:261)
      at
      com.sun.enterprise.server.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:96)
      at
      com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:167)
      at
      com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:106)
      at
      com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits(WebModuleListener.java:174)
      ... 21 more
      Caused by: javax.naming.NameNotFoundException: sample not found
      at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
      at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:175)
      at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:179)
      at
      com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
      at
      com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:98)
      at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at
      com.sun.enterprise.connectors.ConnectorResourceAdminServiceImpl.lookup(ConnectorResourceAdminServiceImpl.java:178)
      at
      com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:1066)
      at
      com.sun.enterprise.server.PersistenceUnitInfoImpl._getJtaDataSource(PersistenceUnitInfoImpl.java:256)

        Activity

        Hide
        jluehe added a comment -

        Webcontainer needs to catch and log any web module related exceptions that occur
        during restart, and mark the corresponding web modules as unavailable.

        Show
        jluehe added a comment - Webcontainer needs to catch and log any web module related exceptions that occur during restart, and mark the corresponding web modules as unavailable.
        Hide
        Sanjeeb Sahoo added a comment -

        I think the current bug is caused when
        https://glassfish.dev.java.net/issues/show_bug.cgi?id=566 was fixed. Please take
        a look at the old bug while fixing this issue.

        – Sahoo

        Show
        Sanjeeb Sahoo added a comment - I think the current bug is caused when https://glassfish.dev.java.net/issues/show_bug.cgi?id=566 was fixed. Please take a look at the old bug while fixing this issue. – Sahoo
        Hide
        jluehe added a comment -

        Yes, Sahoo, you're correct.

        Notice that my proposed fix for this (#1426) issue will not affect the fix for
        https://glassfish.dev.java.net/issues/show_bug.cgi?id=566, that is, the user
        will continue to receive an error at deployment time, which is what they were
        asking for.

        However, we must guard the container against any webapps that fail to start
        during a server restart, which is what this issue is about. For this, we need to
        catch and log any exceptions that occur during restart. The code path during a
        restart is different from the code path during deployment, which means that any
        exception thrown by

        com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits()

        will continue to be propagated if thrown during deployment, but will be caught
        and logged if thrown during a server restart.

        Show
        jluehe added a comment - Yes, Sahoo, you're correct. Notice that my proposed fix for this (#1426) issue will not affect the fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=566 , that is, the user will continue to receive an error at deployment time, which is what they were asking for. However, we must guard the container against any webapps that fail to start during a server restart, which is what this issue is about. For this, we need to catch and log any exceptions that occur during restart. The code path during a restart is different from the code path during deployment, which means that any exception thrown by com.sun.enterprise.web.WebModuleListener.loadPersistenceUnits() will continue to be propagated if thrown during deployment, but will be caught and logged if thrown during a server restart.
        Hide
        jluehe added a comment -

        Checking in ContainerBase.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java,v
        <-- ContainerBase.java
        new revision: 1.14; previous revision: 1.13
        done
        Checking in LocalStrings.properties;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties,v
        <-- LocalStrings.properties
        new revision: 1.12; previous revision: 1.11
        done

        Show
        jluehe added a comment - Checking in ContainerBase.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java,v <-- ContainerBase.java new revision: 1.14; previous revision: 1.13 done Checking in LocalStrings.properties; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties,v <-- LocalStrings.properties new revision: 1.12; previous revision: 1.11 done
        Hide
        kmeduri added a comment -

        Merged the fix to PWC12Dev_Branch:

        Checking in appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java,v
        <-- ContainerBase.java
        new revision: 1.6.12.3; previous revision: 1.6.12.2
        done
        Checking in
        appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties,v
        <-- LocalStrings.properties
        new revision: 1.11.10.1; previous revision: 1.11
        done

        Show
        kmeduri added a comment - Merged the fix to PWC12Dev_Branch: Checking in appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ContainerBase.java,v <-- ContainerBase.java new revision: 1.6.12.3; previous revision: 1.6.12.2 done Checking in appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/LocalStrings.properties,v <-- LocalStrings.properties new revision: 1.11.10.1; previous revision: 1.11 done

          People

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

            Dates

            • Created:
              Updated:
              Resolved: