AnsweredAssumed Answered

Hit NullPointerException while using parseXMLDocuments

Question asked by shmu80 on Jan 2, 2008
Latest reply on Jul 28, 2008 by jak-wei
Hi,

I using eclipse to deploy a war project and run it inside tomcat, but i hit NullPointerException, below is my error message.

—————————————————-
Jan 2, 2008 10:49:11 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
   at org.alfresco.web.forms.FormDataFunctions.parseXMLDocuments(FormDataFunctions.java:93)
   at org.alfresco.web.forms.ServletContextFormDataFunctionsAdapter.parseXMLDocuments(ServletContextFormDataFunctionsAdapter.java:78)
at abc.com.test.Article.getArticle(Article.java:61)
——————————————————

This is my code:

———————————————–
public static List getArticle(PageContext pageContext)
       throws Exception
   {
       FormDataFunctions ef = new ServletContextFormDataFunctionsAdapter(pageContext.getServletContext());
       Map entries = ef.parseXMLDocuments("Article", "/article");
       System.out.println("entries.size() -> " + entries.size());
       List result = new ArrayList(entries.size());
       java.util.Map.Entry entry;
       for(Iterator i$ = entries.entrySet().iterator(); i$.hasNext(); result.add(loadArticle((Document)entry.getValue(), (String)entry.getKey())))
       {
           entry = (java.util.Map.Entry)i$.next();
       }
   
       return result;
   }
———————————————-

the docRoot for my war project is like below:

\WebRoot\article\

and inside article folder has 2 files 1 is index.jsp and another 1 is Article.xml (which I create manually inside this folder).

May I know is it something else I need to do?

Please advise.

Thank you.

Outcomes