glassfish
  1. glassfish
  2. GLASSFISH-20265

NPE were thrown out when deployed the invalid war application

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: 4.1
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Mac OS 10.8.3

      Description

      When I deployed the an invalid web application, Some NPE messages were thrown out as follows:

      [2013-04-10T23:45:20.084+0800] [glassfish 4.0] [SEVERE] [NCLS-ADMIN-00011] [javax.enterprise.system.tools.admin.security.authorization] [tid: _ThreadID=36 _ThreadName=admin-listener(5)] [timeMillis: 1365608720084] [levelValue: 1000] [[
        An unexpected exception occurred.
      java.lang.RuntimeException: java.lang.NullPointerException
      	at org.glassfish.deployment.admin.DeployCommand.preAuthorization(DeployCommand.java:314)
      	at com.sun.enterprise.admin.util.CommandSecurityChecker$1.run(CommandSecurityChecker.java:184)
      	at com.sun.enterprise.admin.util.CommandSecurityChecker$1.run(CommandSecurityChecker.java:180)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:356)
      	at com.sun.enterprise.admin.util.CommandSecurityChecker.authorize(CommandSecurityChecker.java:180)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1203)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
      	at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)
      	at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
      	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
      	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:217)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:231)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:227)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:275)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:257)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:227)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:191)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:819)
      	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:325)
      	at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:161)
      	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.NullPointerException
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:581)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:573)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.createEntryEnumeration(InputJarArchive.java:451)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:203)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.access$100(InputJarArchive.java:74)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$1.enumeration(InputJarArchive.java:166)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$CollectionWrappedEnumeration.<init>(InputJarArchive.java:724)
      	at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.getDirectories(InputJarArchive.java:161)
      	at org.glassfish.javaee.full.deployment.EarDetector.isEARFromIntrospecting(EarDetector.java:142)
      	at org.glassfish.javaee.full.deployment.EarDetector.handles(EarDetector.java:110)
      	at com.sun.enterprise.v3.server.ApplicationLifecycle.getArchiveHandler(ApplicationLifecycle.java:211)
      	at org.glassfish.deployment.admin.DeployCommand.preAuthorization(DeployCommand.java:246)
      	... 52 more
      ]]
      

      I think the deployment comp should offer an friendly messages instead of NPE.

        Activity

        Hide
        Hong Zhang added a comment -

        Jeremy: I like approach #2. We do want the empty jar case to continue working, and IOException will be more friendly than the NPE in the server.log. For the original test case (which you filed this issue for), will approach #2 give better behavior than what we have today also?

        Show
        Hong Zhang added a comment - Jeremy: I like approach #2. We do want the empty jar case to continue working, and IOException will be more friendly than the NPE in the server.log. For the original test case (which you filed this issue for), will approach #2 give better behavior than what we have today also?
        Hide
        Jeremy_Lv added a comment -

        For the original test case (which you filed this issue for), will approach #2 give better behavior than what we have today also?

        Yes, the original test case will be failed and throw out the IOException to the server log.

        I like approach #2. We do want the empty jar case to continue working, and IOException will be more friendly than the NPE in the server.log

        Ok, I will apply the approach #2 to the trunk and run the QL and deployment dev tests before I check in the changes.

        Show
        Jeremy_Lv added a comment - For the original test case (which you filed this issue for), will approach #2 give better behavior than what we have today also? Yes, the original test case will be failed and throw out the IOException to the server log. I like approach #2. We do want the empty jar case to continue working, and IOException will be more friendly than the NPE in the server.log Ok, I will apply the approach #2 to the trunk and run the QL and deployment dev tests before I check in the changes.
        Hide
        Jeremy_Lv added a comment -

        All of the deployment dev tests and QL tests passed!

        If it is fine, I will check in the changes when you have reviewed

        Show
        Jeremy_Lv added a comment - All of the deployment dev tests and QL tests passed! If it is fine, I will check in the changes when you have reviewed
        Hide
        Hong Zhang added a comment -

        Yeah please go ahead and check in. Thanks.

        Show
        Hong Zhang added a comment - Yeah please go ahead and check in. Thanks.
        Hide
        Jeremy_Lv added a comment -

        Fix has been checked in.

        Fix r62001

        Show
        Jeremy_Lv added a comment - Fix has been checked in. Fix r62001

          People

          • Assignee:
            Jeremy_Lv
            Reporter:
            Jeremy_Lv
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: