Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-6416

Double Close in com.atlassian.jira.action.admin.DataExport

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 3.0.2
    • Linux 2.4.21-226-smp
      Tomcat/4.1.31
      MSIE 6.0.2900.2180

    Description

      On startup , tomcat reports a Java exception :

      > bin/catalina.sh run
      Using CATALINA_BASE: /home/jira/jira/jakarta-tomcat-4.1.31
      Using CATALINA_HOME: /home/jira/jira/jakarta-tomcat-4.1.31
      Using CATALINA_TMPDIR: /home/jira/jira/jakarta-tomcat-4.1.31/temp
      Using JAVA_HOME: /usr/lib/java
      [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on http-8443
      Starting service Jira
      Apache Tomcat/4.1.31
      [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
      [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
      [INFO] PropertyMessageResources - -Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
      [INFO] StdSchedulerFactory - -Quartz scheduler 'JiraQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
      [INFO] StdSchedulerFactory - -Quartz scheduler version: 1.0.7
      [INFO] QuartzScheduler - -Scheduler JiraQuartzScheduler_$_NON_CLUSTERED started.
      [Filter: profiling] Using parameter [jira_profile]
      [Filter: profiling] defaulting to off [autostart=false]
      [Filter: profiling] Turning filter off [jira_profile=off]
      [WARN] ServletDispatcher - -Unable to find 'webwork.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
      [INFO] ServletDispatcher - -Action dispatcher initialized
      [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on http-8443
      2005-04-14 10:39:01,917 WARN [service.services.export.ExportService] Exception running export service: Error in action: com.atlassian.jira.action.admin.DataExport@23551c, result: null: Stream closed
      java.io.IOException: Stream closed
      at java.util.zip.ZipOutputStream.ensureOpen(ZipOutputStream.java:41)
      at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:281)
      at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:131)
      at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:307)
      at com.atlassian.jira.action.admin.DataExport.execute(DataExport.java:209)
      at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131)
      at com.atlassian.core.action.DefaultActionDispatcher.execute(DefaultActionDispatcher.java:34)
      at com.atlassian.jira.service.services.export.ExportService.run(ExportService.java:90)
      at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:53)
      at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:147)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:387)
      rethrown as
      com.atlassian.core.AtlassianCoreException: Error in action: com.atlassian.jira.action.admin.DataExport@23551c, result: null: Stream closed
      at com.atlassian.core.action.ActionUtils.checkForErrors(ActionUtils.java:49)
      at com.atlassian.jira.service.services.export.ExportService.run(ExportService.java:91)
      at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:53)
      at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:50)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:147)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:387)

      The exception is thrown due to a call to java.util.zip.ZipOutputStream.close() at com.atlassian.jira.action.admin.DataExport.execute(DataExport.java:209) .
      According to Sun Java documentation (http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintWriter.html#close()) , the stream has already been closed by the previous call to java.io.PrintWriter.close() at line 207 .
      The exception is not caught at this level (lines 210 or 213 , resp.) , so it appears on the screen .

      The file is closed correctly by line 207 , so I assume the backup file can be used .
      The call to .getResult() (l. 212) is not executed , so the backup task is not completed .

      Possible solution : One could catch the exception on line immediately , on l. 210 .

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              69a8040e56ea G.Beilhack
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified