glassfish
  1. glassfish
  2. GLASSFISH-6545

regression: NPE thrown for directory deployment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: 4.0_b01
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      6,545
    • Status Whiteboard:
      Hide

      gfv3-prelude-excluded

      Show
      gfv3-prelude-excluded

      Description

      V3-prelude
      bld: b28a-promoted
      OS:Tested on Windows xp

      Admingui throws the following NPE while deploying directory for web application

      "An error has occurred
      Error during deployment : null : java.lang.NullPointerException"

      Server.log:
      ===========

      [#|2008-10-15T10:40:22.375-0700|WARNING|glassfish|javax.enterprise.system.core|_ThreadID=18;_ThreadName=Thread-3;|Failed
      to scan archive for annotationsnull|#]

      [#|2008-10-15T10:40:22.375-0700|SEVERE|glassfish|javax.enterprise.system.core|_ThreadID=18;_ThreadName=Thread-3;|Error
      during deployment : null
      java.lang.NullPointerException
      at
      com.sun.enterprise.deploy.shared.FileArchive.getListOfFiles(FileArchive.java:371)
      at com.sun.enterprise.deploy.shared.FileArchive.entries(FileArchive.java:170)
      at org.glassfish.persistence.jpa.JPASniffer.handles(JPASniffer.java:82)
      at com.sun.enterprise.v3.server.SnifferManager.getSniffers(SnifferManager.java:127)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:279)
      at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:297)
      at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
      at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
      at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
      at
      org.glassfish.admingui.common.util.LocalDeploymentFacility$LocalDFCommandRunner.run(LocalDeploymentFacility.java:140)
      at
      org.glassfish.deployment.client.AbstractDeploymentFacility.deploy(AbstractDeploymentFacility.java:243)
      at
      org.glassfish.admingui.common.util.DeployUtil.invokeDeploymentFacility(DeployUtil.java:93)
      at org.glassfish.admingui.common.util.DeployUtil.deploy(DeployUtil.java:70)
      at
      org.glassfish.admingui.handlers.DeploymentHandler.deploy(DeploymentHandler.java:152)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at
      com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:422)
      at
      com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:420)
      at
      com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:394)
      at
      com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:132)
      at
      com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:80)
      at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
      at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
      at javax.faces.component.UICommand.broadcast(UICommand.java:372)
      at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
      at
      com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at
      com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      at
      org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
      at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:370)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
      at
      org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
      at
      com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
      at
      com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
      at
      com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
      at
      com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
      at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
      at
      com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
      at
      com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at
      com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
      at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
      at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)

      #]

      PS: Client and serverside deployment works fine with the same .war file

      1. SimpleHello.war
        126 kB
        sujatha_chintalapati

        Activity

        Hide
        sueann added a comment -

        Listed in Release Notes Issues section, page 15.

        Show
        sueann added a comment - Listed in Release Notes Issues section, page 15.
        Hide
        kumara added a comment -

        Reclassifying as P4 because these issues are not must fix for prelude release.
        This issue will be scrubbed after prelude release and will be given the right
        priority for v3 final release.

        Show
        kumara added a comment - Reclassifying as P4 because these issues are not must fix for prelude release. This issue will be scrubbed after prelude release and will be given the right priority for v3 final release.
        Hide
        sujatha_chintalapati added a comment -

        I have verified the problem with V3Build:47d on windows.Didn't reproduce
        reported NPE anf directory permissions problems with
        attached "SimpleHello.war" .Directory deployment also works fine.
        drwxrwxrwx 1 Administrator None 0 May 26 15:09 META-INF
        drwxrwxrwx 1 Administrator None 0 May 26 15:09 WEB-INF
        -rwxrwxrwa 1 Administrator None 336 May 26 15:09
        greeting.html

        Note: But I can not "Launch" the deployed application "SimpleHello" and
        getting "404" status. Same application works fine with Glassfish2.1 Sailfin b15-
        promoted build.

        Show
        sujatha_chintalapati added a comment - I have verified the problem with V3Build:47d on windows.Didn't reproduce reported NPE anf directory permissions problems with attached "SimpleHello.war" .Directory deployment also works fine. drwxrwxrwx 1 Administrator None 0 May 26 15:09 META-INF drwxrwxrwx 1 Administrator None 0 May 26 15:09 WEB-INF -rwxrwxrwa 1 Administrator None 336 May 26 15:09 greeting.html Note: But I can not "Launch" the deployed application "SimpleHello" and getting "404" status. Same application works fine with Glassfish2.1 Sailfin b15- promoted build.
        Hide
        Anissa Lam added a comment -

        I saw this in the v3 release note and yes, this is still reproducible in 74b.
        Sounds like this was overlooked by the deployment team because this is a P4.
        You may want to move this back to P3 after v3.

        Show
        Anissa Lam added a comment - I saw this in the v3 release note and yes, this is still reproducible in 74b. Sounds like this was overlooked by the deployment team because this is a P4. You may want to move this back to P3 after v3.
        Hide
        Tim Quinn added a comment -

        Fix checked in.

        Project: glassfish
        Repository: svn
        Revision: 45276
        Author: tjquinn
        Date: 2011-02-25 20:59:01 UTC
        Link:

        Log Message:
        ------------
        Fix for 6545

        The FileArchive class implements the Archive interface for a directory tree (as opposed to a JAR for example). The method which finds all files within a directory could fail with an NPE because file.listFiles can return null (if the file is not a directory or, in this case, if file permissions prevented GlassFish from getting the list of files).

        These changes detect a null return from file.listFiles and logs a WARNING-level message before returning, thus avoiding the NPE.

        Tests: new unit test for inability to access directory; deployment devtests

        Revisions:
        ----------
        45276

        Modified Paths:
        ---------------
        trunk/v3/deployment/common/src/main/java/com/sun/enterprise/deploy/shared/FileArchive.java
        trunk/v3/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties
        trunk/v3/deployment/common/src/test/java/com/sun/enterprise/deploy/shared/FileArchiveTest.java

        Show
        Tim Quinn added a comment - Fix checked in. Project: glassfish Repository: svn Revision: 45276 Author: tjquinn Date: 2011-02-25 20:59:01 UTC Link: Log Message: ------------ Fix for 6545 The FileArchive class implements the Archive interface for a directory tree (as opposed to a JAR for example). The method which finds all files within a directory could fail with an NPE because file.listFiles can return null (if the file is not a directory or, in this case, if file permissions prevented GlassFish from getting the list of files). These changes detect a null return from file.listFiles and logs a WARNING-level message before returning, thus avoiding the NPE. Tests: new unit test for inability to access directory; deployment devtests Revisions: ---------- 45276 Modified Paths: --------------- trunk/v3/deployment/common/src/main/java/com/sun/enterprise/deploy/shared/FileArchive.java trunk/v3/deployment/common/src/main/resources/com/sun/logging/enterprise/system/tools/deployment/LogStrings.properties trunk/v3/deployment/common/src/test/java/com/sun/enterprise/deploy/shared/FileArchiveTest.java

          People

          • Assignee:
            Tim Quinn
            Reporter:
            sujatha_chintalapati
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: