java.lang.NullPointerException

Atlassian JIRA | Kenny MacLeod | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The {{PageIncludeMacro}} can fail with a NullPointerException. Here's an example stack trace: {noformat} 2014-07-30 22:10:19,521 ERROR [catalina-exec-32] [xhtml.view.macro.ViewMacroMarshaller] marshalInternal Error rendering macro: include -- url: /display/DOC/Exporting+Confluence+Pages+and+Spaces+to+PDF | page: 139527 | userName: anonymous | referer: https://www.google.com/ | action: viewpage java.lang.NullPointerException at com.atlassian.confluence.plugins.macros.advanced.DefaultPageProvider.resolve(DefaultPageProvider.java:48) at com.atlassian.confluence.plugins.macros.advanced.PageIncludeMacro.execute(PageIncludeMacro.java:97) at sun.reflect.GeneratedMethodAccessor830.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:225) at com.sun.proxy.$Proxy2247.execute(Unknown Source) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:113) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:68) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:30) at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:31) at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:153) at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:129) at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:44) at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:41) at com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:51) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:80) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:68) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:58) at com.atlassian.confluence.content.render.xhtml.DeviceTypeAwareRenderer.render(DeviceTypeAwareRenderer.java:42) at com.atlassian.confluence.pages.actions.ViewPageAction.getXHtmlComments(ViewPageAction.java:299) {noformat} The NPE comes about from a null {{link}} parameter. The code needs to account for that properly. Updated by [~ple] The log above is for rendering comments and the log below is for rendering page {noformat} 2014-07-31 00:49:26,521 ERROR [catalina-exec-32] [xhtml.view.macro.ViewMacroMarshaller] marshalInternal Error rendering macro: include -- url: /display/CONFKB/Does+Confluence+Support+DIGEST+MD5/ | page: 229180140 | userName: anonymous | action: viewpage java.lang.NullPointerException at com.atlassian.confluence.plugins.macros.advanced.DefaultPageProvider.resolve(DefaultPageProvider.java:48) at com.atlassian.confluence.plugins.macros.advanced.PageIncludeMacro.execute(PageIncludeMacro.java:97) at sun.reflect.GeneratedMethodAccessor830.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:225) at com.sun.proxy.$Proxy2247.execute(Unknown Source) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:113) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:68) at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:30) at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:31) at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:153) at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:129) at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:44) at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:41) at com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:51) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:80) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:68) at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:58) at com.atlassian.confluence.content.render.xhtml.DeviceTypeAwareRenderer.render(DeviceTypeAwareRenderer.java:42) at com.atlassian.confluence.pages.actions.ViewPageAction.execute(ViewPageAction.java:261) {noformat}

    Atlassian JIRA | 3 years ago | Kenny MacLeod
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.confluence.plugins.macros.advanced.DefaultPageProvider.resolve()
    2. com.atlassian.confluence
      PageIncludeMacro.execute
      1. com.atlassian.confluence.plugins.macros.advanced.DefaultPageProvider.resolve(DefaultPageProvider.java:48)
      2. com.atlassian.confluence.plugins.macros.advanced.PageIncludeMacro.execute(PageIncludeMacro.java:97)
      2 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor830.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:606)
      3 frames
    4. com.atlassian.confluence
      XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke
      1. com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:225)
      1 frame
    5. com.sun.proxy
      $Proxy2247.execute
      1. com.sun.proxy.$Proxy2247.execute(Unknown Source)
      1 frame
    6. com.atlassian.confluence
      ViewPageAction.getXHtmlComments
      1. com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:113)
      2. com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:68)
      3. com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:30)
      4. com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:31)
      5. com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:153)
      6. com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:129)
      7. com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:44)
      8. com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:41)
      9. com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:51)
      10. com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:80)
      11. com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:68)
      12. com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:58)
      13. com.atlassian.confluence.content.render.xhtml.DeviceTypeAwareRenderer.render(DeviceTypeAwareRenderer.java:42)
      14. com.atlassian.confluence.pages.actions.ViewPageAction.getXHtmlComments(ViewPageAction.java:299)
      14 frames