Estou tentando fazer upload de vários arquivos utilizando o richfaces , porém está retornando este erro :
0/08/2010 11:50:19 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at javax.faces.webapp._ErrorPageWriter.writeVariables(_ErrorPageWriter.java:200)
at javax.faces.webapp._ErrorPageWriter.writeVariables(_ErrorPageWriter.java:176)
at javax.faces.webapp._ErrorPageWriter.debugHtml(_ErrorPageWriter.java:139)
at javax.faces.webapp._ErrorPageWriter.handleException(_ErrorPageWriter.java:348)
at javax.faces.webapp.FacesServlet.handleLifecycleException(FacesServlet.java:217)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:156)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:367)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
O web.xml está configurado assim:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>FTP</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<init-param>
<param-name>javax.faces.LIFECYCLE_ID</param-name>
<param-value>DEFAULT</param-value>
</init-param>
<load-on-startup>30</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<description>Set the size limit for uploaded files.
Format: 10 - 10
bytes 10k -
10 KB 10m -
10 MB
1g -
1 GB
</description>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>20000000</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
</web-app>
Página:
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>FTP</title>
</head>
<body>
<f:view>
<h:form id="frmAnexo" enctype="multipart/form-data">
<t:saveState value="ftpMB" />
<center><rich:panel header="FTP"
style=" width: 800px">
<t:inputFileUpload id="fileupload" value="#{ftpMB.arquivo}">
</t:inputFileUpload>
</br>
<rich:dataTable width="100%" value="#{ftpMB.listaArquivos}"
id="gridArquivos" rows="7" var="dataArquivos">
<f:facet name="header">
<rich:columnGroup>
<rich:column width="50%">
<h:outputText styleClass="headerText" value="Arquivos" />
</rich:column>
<rich:column width="30%">
<h:outputText styleClass="headerText" value="Download" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column width="40%">
<h:outputText value="#{dataArquivos.nome}" />
</rich:column>
<rich:column width="30%">
<h:outputLink title="Download" id="linkDownload"
value="#{dataArquivos.link}">
<h:graphicImage value="images/download.png" />
</h:outputLink>
</rich:column>
</rich:dataTable>
</rich:panel></center>
</h:form>
</f:view>
</body>
</html>
OBS: Estou utilizando JSF 1.2 com o RichFaces 3.3.3 , MyFaces 1.2.2 e Tomahawk-1.1.9 , Se eu fizer para um arquivo funciona.
Valeu pela ajuda!