cancel
Showing results for 
Search instead for 
Did you mean: 

Hit NullPointerException while using parseXMLDocuments

shmu80
Champ in-the-making
Champ in-the-making
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.
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
This class is not part of the public Alfresco API (http://wiki.alfresco.com/wiki/Alfresco_JavaDoc) and therefore shouldn't be used in custom webapp code.  In fact the Javadoc makes it pretty clear that this is an internal (private) utility class that's intended for use by the Alfresco webapp and the virtualisation server:


/**
* Common implementation of functions called in the context of FormDataRenderers.
* This uses AVMRemote rather than AVMService so that in can be used in the context
* of both the alfresco webapp and the virtualization server.
*
* @author Ariel Backenroth
*/
Cheers,
Peter

jak-wei
Champ in-the-making
Champ in-the-making
I have the same problem too . The Class is a internal private  Class . but  I want to accomplish the same purpose , how to  do it ?