Details
-
Bug
-
Resolution: Fixed
-
Medium
-
2.6-dr1, 2.6.0
-
CAC
Description
This problem is raised from the support issue - https://support.atlassian.com/browse/CSP-11863
The initial problem was a failure during PDF export which looked like -
2007-10-03 21:26:09,006 ERROR [Export Space task] [core.task.longrunning.AbstractLongRunningTask] doInTransactionWithoutResult Error during export -- url: /spaces/doexportspace.action | userName: pcurren | action: doexportspace com.atlassian.confluence.importexport.ImportExportException: java.lang.NullPointerException at com.atlassian.confluence.importexport.impl.PdfExporter.generateXslFo(PdfExporter.java:178) at com.atlassian.confluence.importexport.impl.PdfExporter.doExportEntity(PdfExporter.java:97) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.exportSpace(AbstractRendererExporterImpl.java:127) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.doExport(AbstractRendererExporterImpl.java:109) at com.atlassian.confluence.importexport.impl.PdfExporter.doExport(PdfExporter.java:63) at com.atlassian.confluence.importexport.DefaultImportExportManager.exportAs(DefaultImportExportManager.java:112) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy49.exportAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask$2.doInTransactionWithoutResult(ExportSpaceLongRunningTask.java:8 5) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:114) at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask.runInternal(ExportSpaceLongRunningTask.java:61) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at com.caucho.server.connection.AbstractHttpRequest.getContextPath(AbstractHttpRequest.java:506) at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:108) at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:108) at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:108) at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:108) at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:108) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:403) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:350) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.exportResource(AbstractRendererExporterImpl.java:208) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.exportImages(AbstractRendererExporterImpl.java:151) at com.atlassian.confluence.importexport.impl.PdfExporter.generateXslFo(PdfExporter.java:174) ... 22 more
This is due to the HttpServletRequest instance being stored within the ThreadLocal and accessed by the LongRunningTask thread as it performed the export. When resin returns the HttpServletRequest to the pool some internal details are nulled (such as the context).
This was worked around by wrapping the request in a compatible class which takes a copy of the necessary data.
The ServletContextHoldingRequest also needed to be modified. It was returning an HttpSession instance anonymous class which resin was later trying to cast to it's own SessionImpl class. (ServletContextHoldingRequest was modified to hold the HttpSession instance from the real request.)
Once this was all hacked around, a new problem was being exposed -
2007-10-08 13:26:57,004 ERROR [Export Space task] [core.task.longrunning.AbstractLongRunningTask] doInTransactionWithoutResult Error during export -- url: /spaces/doexportspace.action | userName: pcurren | action: doexportspace com.atlassian.confluence.importexport.ImportExportException: Error while generating PDF! at com.atlassian.confluence.importexport.impl.PdfExporter.foToPdf(PdfExporter.java:137) at com.atlassian.confluence.importexport.impl.PdfExporter.doExportEntity(PdfExporter.java:98) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.exportSpace(AbstractRendererExporterImpl.java:127) at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.doExport(AbstractRendererExporterImpl.java:109) at com.atlassian.confluence.importexport.impl.PdfExporter.doExport(PdfExporter.java:63) at com.atlassian.confluence.importexport.DefaultImportExportManager.exportAs(DefaultImportExportManager.java:112) 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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy49.exportAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask$2.doInTransactionWithoutResult(ExportSpaceLongRunningTask.java:87) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:114) at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask.runInternal(ExportSpaceLongRunningTask.java:63) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at java.lang.Thread.run(Thread.java:613) Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///Users/pcurren/Atlassian/data/confluence/cac/temp/export_10082007_131342/CONF256-20071008-13_13_42.fo:16961:0: Error(16961/0): fo:list-block is missing child elements. Required Content Model: marker* (list-item)+ at com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:61) at com.atlassian.confluence.importexport.impl.PdfExporter.foToPdf(PdfExporter.java:132) ... 22 more Caused by: org.apache.fop.fo.ValidationException: file:///Users/pcurren/Atlassian/data/confluence/cac/temp/export_10082007_131342/CONF256-20071008-13_13_42.fo:16961:0: Error(16961/0): fo:list-block is missing child elements. Required Content Model: marker* (list-item)+ at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:408) at org.apache.fop.fo.flow.ListBlock.endOfNode(ListBlock.java:105) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:379) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:195) at com.caucho.xml.XmlParser.addElement(XmlParser.java:2608) at com.caucho.xml.XmlParser.parseElement(XmlParser.java:641) at com.caucho.xml.XmlParser.parseNode(XmlParser.java:367) at com.caucho.xml.XmlParser.parseInt(XmlParser.java:242) at com.caucho.xml.AbstractParser.parse(AbstractParser.java:633) at com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:59) ... 23 more
At this point, I've decided to resolved the support request in a different way, and gift these three problems to the bug fix team
Attachments
Issue Links
- blocks
-
CLOV-56 Upload Clover 2.0 docs in PDF, XML & HTML formats
- Closed
- is caused by
-
CONFSERVER-7601 Images produced by macro plugins like Gliffy are not generated into .doc or .html exports
- Closed
- is related to
-
CONFSERVER-9693 Exporting a space that is associated to a SpaceGroup causes an error (lazy init exception)
- Closed
-
CONFSERVER-8280 Export code fails when executed in non-servlet context
- Closed
-
CONFSERVER-9771 NullPointerException when exporting space on Websphere and JBoss
- Closed
-
CONFSERVER-9896 Rework the Space Export functionality - broken by 2.6 changes.
- Closed
- relates to
-
CONFSERVER-8600 Exporting a Space sometimes fails, throwing a Nullpointer-Exception
- Closed
-
CONFSERVER-9764 CLONE -Exporting a Space sometimes fails, throwing a Nullpointer-Exception
- Closed
-
CONFSERVER-12932 Exporting a Space gives errors. How to change the lazy setting in 2.8.1?
- Closed