Hi,
I don’t know anything about this code snippet provided by a contributor but I can tell you
why the NPE happens.
This code seems to be calling Utils.getContextComponentManager() before calling
Utils.setComponentManager(…) to set the component manager to use.
note that this code is really not clean/nice and it would benefit if someone would develop
a Filter Stream converter extension for jspwiki as it’s been done for confluence, see:
*
http://extensions.xwiki.org/xwiki/bin/view/Extension/Filter+Application
*
http://extensions.xwiki.org/xwiki/bin/view/Extension/Filter+Confluence+XML+…
Hope it helps,
-Vincent
On 7 May 2015 at 22:21:26, Khjintcorp (khjintcorp(a)gmail.com) wrote:
Sent from my iPhone
Hi Vincent
I am trying to convert JSPwiki pages to Xwiki pages.For that I used the code which is in
the link
http://extensions.xwiki.org/xwiki/bin/view/Extension/JSPWiki+To+XWiki+Conve…
After I fixed all jar issues in classpath then I ran the program, JspWikiImporter I got
the null pointer exception.
I saw people posted the same messages in this group. I don’t see the answers for this
matter. Do you have any update for the issue?
java.lang.NullPointerException
at com.xpn.xwiki.web.Utils.getContextComponentManager(Utils.java:695)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:752)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:781)
at
com.xpn.xwiki.XWikiCompatibilityAspect.ajc$interFieldInit$com_xpn_xwiki_XWikiCompatibilityAspect$com_xpn_xwiki_XWiki$defaultReferenceEntityReferenceResolver(XWikiCompatibilityAspect.aj:87)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:6450)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:6441)
at JspWikiImporter.export(JspWikiImporter.java:72)
at JspWikiImporter.main(JspWikiImporter.java:62)
Exception in thread "main" java.lang.RuntimeException: Export failed
at JspWikiImporter.export(JspWikiImporter.java:99)
at JspWikiImporter.main(JspWikiImporter.java:62)
Caused by: java.lang.NullPointerException
at com.xpn.xwiki.web.Utils.getContextComponentManager(Utils.java:695)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:752)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:781)
at
com.xpn.xwiki.XWikiCompatibilityAspect.ajc$interFieldInit$com_xpn_xwiki_XWikiCompatibilityAspect$com_xpn_xwiki_XWiki$defaultReferenceEntityReferenceResolver(XWikiCompatibilityAspect.aj:87)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:6450)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:6441)
at JspWikiImporter.export(JspWikiImporter.java:72)
... 1 more
Thanks
Ken Liang
Contractor
Unisys
Office: 571-468-2782