Issue Details (XML | Word | Printable)

Key: CONF-11795
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Fennie Ng [Atlassian]
Votes: 14
Watchers: 10
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Confluence

Export With {toc} Causes NullPointerException

Created: 12/May/08 07:48 AM   Updated: 18/Nov/08 07:33 PM
Component/s: Export Page / Space, Macros - Table of Contents, PDF Generation, Plugins
Affects Version/s: 2.8, 2.8.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: None
Image Attachments:

1. Export-Fine-PDF.jpg
(37 kB)

2. export2word.jpg
(76 kB)

3. RTF Export error.PNG
(13 kB)

4. Wiki-Content.jpg
(41 kB)
Issue Links:
Duplicate
 

Participants: Agnes Ro [Atlassian], Anatoli Kazatchkov [Atlassian], Andreas Remsperger, Björn Feustel, Dennis Dörr, Don Willis [Atlassian], Fennie Ng [Atlassian], J Narayana, Matt Ryall [Atlassian], Pam Cole and UCF RC IT
Since last comment: 3 weeks ago
Internal Complexity: 4
Internal Value: 8
Labels: qa-manual


 Description  « Hide
When exporting Page (that contains TOC macro) to Word, we get this message in the exported file:

Error formatting macro: toc: java.lang.NullPointerException

If we attempt to export the same page as a PDF, the resulting PDF file will have the proper table of contents.

Please see attached screen short for better clarification.

http://developer.atlassian.com/jira/browse/TOC-75



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dennis Dörr added a comment - 12/Jun/08 05:06 AM - edited
Same way on using PDF export. Instead of the ToC a NullPointer will be displayed.

@Additional: This happends only when using the "export space" function.

Im not sure but this should be the StackTrace produced by this error:

java.lang.NullPointerException
at net.customware.confluence.plugin.toc.AbstractTOCMacro.execute(AbstractTOCMacro.java:567)
at org.randombits.confluence.support.ConfluenceMacro.execute(ConfluenceMacro.java:54)
at com.atlassian.renderer.v2.macro.ResourceAwareMacroDecorator.execute(ResourceAwareMacroDecorator.java:45)
at com.atlassian.renderer.v2.components.MacroRendererComponent.executeMacro(MacroRendererComponent.java:297)
at com.atlassian.renderer.v2.components.MacroRendererComponent.processMacro(MacroRendererComponent.java:255)
at com.atlassian.renderer.v2.components.MacroRendererComponent.makeMacro(MacroRendererComponent.java:151)
at com.atlassian.renderer.v2.components.WikiContentRendererHandler.handleMacro(WikiContentRendererHandler.java:18)
at com.atlassian.renderer.v2.WikiMarkupParser.makeMacro(WikiMarkupParser.java:126)
at com.atlassian.renderer.v2.WikiMarkupParser.makeMacro(WikiMarkupParser.java:114)
at com.atlassian.renderer.v2.WikiMarkupParser.handlePotentialMacro(WikiMarkupParser.java:99)
at com.atlassian.renderer.v2.WikiMarkupParser.parse(WikiMarkupParser.java:60)
at com.atlassian.renderer.v2.components.MacroRendererComponent.render(MacroRendererComponent.java:47)
at com.atlassian.renderer.v2.V2Renderer.render(V2Renderer.java:53)
at com.atlassian.renderer.v2.plugin.PluggableV2Renderer.render(PluggableV2Renderer.java:30)
at com.atlassian.renderer.v2.V2RendererFacade.convertWikiToXHtml(V2RendererFacade.java:57)
at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
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:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy46.convertWikiToXHtml(Unknown Source)
at com.atlassian.confluence.renderer.DefaultWikiStyleRenderer.convertWikiToXHtml(DefaultWikiStyleRenderer.java:19)
at com.atlassian.confluence.importexport.impl.WikiExporter.exportWikiToXHtml(WikiExporter.java:132)
at com.atlassian.confluence.importexport.impl.WikiExporter.exportWikiToXHtml(WikiExporter.java:90)
at sun.reflect.GeneratedMethodAccessor1541.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.Template.merge(Template.java:254)
at com.atlassian.confluence.util.TemplateSupport.processTemplate(TemplateSupport.java:70)
at com.atlassian.confluence.importexport.impl.HtmlExporter.doExportEntity(HtmlExporter.java:195)
at com.atlassian.confluence.importexport.impl.HtmlExporter.exportPage(HtmlExporter.java:107)
at com.atlassian.confluence.importexport.impl.HtmlExporter.exportSpace(HtmlExporter.java:120)
at com.atlassian.confluence.importexport.impl.AbstractRendererExporterImpl.doExport(AbstractRendererExporterImpl.java:83)
at com.atlassian.confluence.importexport.impl.HtmlExporter.doExport(HtmlExporter.java:46)
at com.atlassian.confluence.importexport.DefaultImportExportManager.exportAs(DefaultImportExportManager.java:112)
at sun.reflect.GeneratedMethodAccessor1213.invoke(Unknown Source)
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:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy58.exportAs(Unknown Source)
at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask$1.doInTransactionWithoutResult(ExportSpaceLongRunningTask.java:87)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
at com.atlassian.confluence.importexport.actions.ExportSpaceLongRunningTask.runInternal(ExportSpaceLongRunningTask.java:58)
at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21)
at java.lang.Thread.run(Thread.java:619)


Anatoli Kazatchkov [Atlassian] added a comment - 29/Jun/08 11:21 PM - edited
Dennis,

What version of confluence do you use? The original bug report seems to suggest that pdf export works fine with a toc macro.

Anatoli.


Dennis Dörr added a comment - 30/Jun/08 04:02 AM - edited
Hi, we use 2.8.0. Yes you're right it works fine, but only if you export a single page using the pdf button in the right top corner. If you use the export space function you get the error as described above.

Dennis


Andreas Remsperger added a comment - 09/Jul/08 09:52 AM
Hi,

the same issue is raising within our Confluence installation. Currently we are using Confuence 2.6.1 Build:#916.

Greetings
Andy


UCF RC IT added a comment - 09/Jul/08 10:47 AM - edited
We are having the same issue. Our Word version is 2007. Our Confluence version is 2.8.1. It would be nice if others who are experiencing this problem state the version of Word they are using as well as Confluence version.

Björn Feustel added a comment - 16/Jul/08 02:16 AM - edited
We do have the same problem when exporting a space to HTML. We are using Confluence 2.8.1. The exported content (HTML-page) does contain following snippet instead of rendered toc:
<div class="error"><span class="error">Error formatting macro: toc: java.lang.NullPointerException</span> </div>

Logfile shows same NPW as shown above.

BTW: This does not happen when exporting to XML.


Björn Feustel added a comment - 21/Jul/08 10:59 AM
NPE seems to have the same cause

J Narayana added a comment - 21/Jul/08 09:59 PM - edited
This is a critical issue for me too. Even a PDF export causes this exception, along with Word and HTML space export; on my Confluence 2.8.1. Please see attachment 'RTF Export Error'.

Implore you to kindly fix it ASAP.

Many thanks in advance,
-Nani


Pam Cole added a comment - 11/Aug/08 03:40 PM - edited
I am having this same issue when exporting to Word. However, it works fine with PDF. I am using ver. 2.7. Getting this error actually output in the Word Document: Error formatting macro: toc: java.lang.NullPointerException

Agnes Ro [Atlassian] added a comment - 11/Aug/08 06:47 PM
Updating title.

Matt Ryall [Atlassian] added a comment - 18/Aug/08 08:26 PM
This bug is not caused by, or related to, CONF-6919. It will be fixed in the TOC macro, as part of this bug:

http://developer.atlassian.com/jira/browse/TOC-70

I'll leave this issue open in Confluence to track it, but remove the link to CONF-6919.


Pam Cole added a comment - 19/Aug/08 12:05 PM
We are using Confluence. 2.7. However, it does seem that this problem started when we upgraded the TOC macro to 2.4.7.

Don Willis [Atlassian] added a comment - 10/Nov/08 10:47 PM
Should be fixed by TOC-70 according to comments there and on TOC-75