glassfish
  1. glassfish
  2. GLASSFISH-16888

Runtime exception from _get-deployment-configurations command

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1.1_b08
    • Fix Version/s: 3.1.1_b10, 4.0
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      OS : windows 2008 server
      Installer Bundle : glassfish-3.1.1-b08-windows.exe
      Browser : FF 3.6

      Description

      Create a Cluster with a local instance. Start the cluster and deploy an application to the cluster. Select the deployed application and click the "Descriptor" tab. The below error is thrown in Console:
      An error has occurred
      java.lang.RuntimeException: java.io.IOException: Stream closed java.io.IOException: Stream closed

      server.log has the below Stack:
      [#|2011-06-21T15:58:24.798-0700|SEVERE|glassfish3.1|javax.enterprise.system.too
      s.admin.com.sun.enterprise.v3.admin|_ThreadID=51;_ThreadName=Thread-1;|Exceptio
      in command execution : java.lang.RuntimeException: java.io.IOException: Stream
      closed
      java.lang.RuntimeException: java.io.IOException: Stream closed
      at org.glassfish.deployment.admin.GetDeploymentConfigurationsCommand.ex
      cute(GetDeploymentConfigurationsCommand.java:132)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunne
      Impl.java:355)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunne
      Impl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunne
      Impl.java:1045)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRun
      erImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execu
      e(CommandRunnerImpl.java:1244)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execu
      e(CommandRunnerImpl.java:1232)
      at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:2
      2)
      at org.glassfish.admin.rest.resources.TemplateExecCommand.executeComman
      (TemplateExecCommand.java:127)
      at org.glassfish.admin.rest.resources.TemplateCommandGetResource.proces
      Get(TemplateCommandGetResource.java:78)
      at sun.reflect.GeneratedMethodAccessor612.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaM
      thodInvokerFactory.java:60)
      at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMet
      odDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchP
      ovider.java:205)
      at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodD
      spatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMetho
      Rule.java:288)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocato
      Rule.java:134)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightH
      ndPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocato
      Rule.java:134)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightH
      ndPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocato
      Rule.java:134)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightH
      ndPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocato
      Rule.java:134)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightH
      ndPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(Resour
      eClassRule.java:108)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightH
      ndPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(
      ootResourceClassesRule.java:84)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleReq
      est(WebApplicationImpl.java:1469)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleReq
      est(WebApplicationImpl.java:1400)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequ
      st(WebApplicationImpl.java:1349)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequ
      st(WebApplicationImpl.java:1339)
      at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._servi
      e(GrizzlyContainer.java:182)
      at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.servic
      (GrizzlyContainer.java:147)
      at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.jav
      :178)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.jav
      :168)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.jav
      :117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(Containe
      Mapper.java:238)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:
      22)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFi
      ter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultPr
      tocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.ja
      a:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.ja
      a:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.jav
      :79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContext
      ask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask
      java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThread
      ool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPoo
      .java:513)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.io.IOException: Stream closed
      at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:14
      )
      at java.io.BufferedInputStream.reset(BufferedInputStream.java:414)
      at org.glassfish.internal.deployment.GenericSniffer.readDeploymentConfi
      (GenericSniffer.java:296)
      at org.glassfish.internal.deployment.GenericSniffer.getDeploymentConfig
      rations(GenericSniffer.java:233)
      at org.glassfish.deployment.admin.GetDeploymentConfigurationsCommand.ex
      cute(GetDeploymentConfigurationsCommand.java:109)
      ... 51 more

        Activity

        Hide
        Anissa Lam added a comment -

        sounds like a regression in the deployment code.
        Stacktrace:

        Caused by: java.io.IOException: Stream closed
        at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
        at java.io.BufferedInputStream.reset(BufferedInputStream.java:414)
        at org.glassfish.internal.deployment.GenericSniffer.readDeploymentConfig(GenericSniffer.java:296)
        at org.glassfish.internal.deployment.GenericSniffer.getDeploymentConfigurations(GenericSniffer.java:233)
        at org.glassfish.deployment.admin.GetDeploymentConfigurationsCommand.execute(GetDeploymentConfigurationsCommand.java:126)
        ... 25 more

        You can also reproduce the error using CLI.

        • start domain
        • deploy hello.war
        • run _get-deployment-configurations command

        ~ 2) asadmin _get-deployment-configurations hello
        remote failure: java.lang.RuntimeException: java.io.IOException: Stream closed
        java.io.IOException: Stream closed
        Command _get-deployment-configurations failed.

        transferring to 'deployment'.

        Show
        Anissa Lam added a comment - sounds like a regression in the deployment code. Stacktrace: Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145) at java.io.BufferedInputStream.reset(BufferedInputStream.java:414) at org.glassfish.internal.deployment.GenericSniffer.readDeploymentConfig(GenericSniffer.java:296) at org.glassfish.internal.deployment.GenericSniffer.getDeploymentConfigurations(GenericSniffer.java:233) at org.glassfish.deployment.admin.GetDeploymentConfigurationsCommand.execute(GetDeploymentConfigurationsCommand.java:126) ... 25 more You can also reproduce the error using CLI. start domain deploy hello.war run _get-deployment-configurations command ~ 2) asadmin _get-deployment-configurations hello remote failure: java.lang.RuntimeException: java.io.IOException: Stream closed java.io.IOException: Stream closed Command _get-deployment-configurations failed. transferring to 'deployment'.
        Hide
        Anissa Lam added a comment -

        Raising the priority and assign to Tim.
        This must be fixed in 3.1.1 because this looks really bad in GUI. And be able to look at deployment descriptor is one of the major feature in GUI.

        Show
        Anissa Lam added a comment - Raising the priority and assign to Tim. This must be fixed in 3.1.1 because this looks really bad in GUI. And be able to look at deployment descriptor is one of the major feature in GUI.
        Hide
        Tim Quinn added a comment -

        This is due to a Java SE bug. The XMLStreamReader.close method is documented as NOT closing the underlying input stream, but indeed it does. This might have worked earlier but not any more because the underlying archive implementation might have returned a different kind of stream before for which close is a no-op.

        See http://bugs.sun.com/view_bug.do?bug_id=6539065

        I am creating a workaround.

        Why fix this issue in 3.1.1?
        Regression, and it causes an ugly failure

        Which is the targeted build of 3.1.1 for this fix?
        b10

        Do regression tests exist for this issue?
        not known

        Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
        the minimal scenario Anissa described should verify the fix; the code changes should not affect other code paths

        Show
        Tim Quinn added a comment - This is due to a Java SE bug. The XMLStreamReader.close method is documented as NOT closing the underlying input stream, but indeed it does. This might have worked earlier but not any more because the underlying archive implementation might have returned a different kind of stream before for which close is a no-op. See http://bugs.sun.com/view_bug.do?bug_id=6539065 I am creating a workaround. Why fix this issue in 3.1.1? Regression, and it causes an ugly failure Which is the targeted build of 3.1.1 for this fix? b10 Do regression tests exist for this issue? not known Which tests should QA (re)run to verify the fix did not destabilize GlassFish? the minimal scenario Anissa described should verify the fix; the code changes should not affect other code paths
        Hide
        Tim Quinn added a comment -

        Fix checked in.

        3.1.1: 47715
        trunk: 47716

        Project: glassfish
        Repository: svn
        Revision: 47715
        Author: tjquinn
        Date: 2011-06-27 18:59:05 UTC
        Link:

        Log Message:
        ------------
        Fix for 16888

        Despite the JavaDoc which states that XMLEventReader#close does NOT close the underlying input stream, the Java code actually does. (This was reported some years ago as a bug against Java SE and closed as won't fix.)

        These changes work around that discrepancy by closing the event reader only after we are actually done processing the stream.

        Approved for 3.1.1: Sathyan
        Tests: QL, deployment devtests

        Revisions:
        ----------
        47715

        Modified Paths:
        ---------------
        branches/3.1.1/common/internal-api/src/main/java/org/glassfish/internal/deployment/GenericSniffer.java

        Show
        Tim Quinn added a comment - Fix checked in. 3.1.1: 47715 trunk: 47716 Project: glassfish Repository: svn Revision: 47715 Author: tjquinn Date: 2011-06-27 18:59:05 UTC Link: Log Message: ------------ Fix for 16888 Despite the JavaDoc which states that XMLEventReader#close does NOT close the underlying input stream, the Java code actually does. (This was reported some years ago as a bug against Java SE and closed as won't fix.) These changes work around that discrepancy by closing the event reader only after we are actually done processing the stream. Approved for 3.1.1: Sathyan Tests: QL, deployment devtests Revisions: ---------- 47715 Modified Paths: --------------- branches/3.1.1/common/internal-api/src/main/java/org/glassfish/internal/deployment/GenericSniffer.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved: