This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes s:excelExport Exception in PhaseListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "s:excelExport Exception in PhaseListener" Watch "s:excelExport Exception in PhaseListener" New topic
Author

s:excelExport Exception in PhaseListener

Farhan Khan
Greenhorn

Joined: Nov 04, 2008
Posts: 1
Hi!

I'm using richfaces1.1.7 with sandbox. My web.xml looks like

======================================================================

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!-- <context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
-->
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>
net.sf.jasperreports.j2ee.servlets.ImageServlet
</servlet-class>

</servlet>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/image</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>100m</param-value>

</init-param>

</filter>

<!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
<servlet-name>FacesServlet</servlet-name>
</filter-mapping>

<context-param>
<param-name>
com.sun.faces.enableRestoreView11Compatibility
</param-name>
<param-value>true</param-value>
</context-param>



<!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/billing</res-ref-name>
<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>
</resource-ref>

<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>classic</param-value>
</context-param>

<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>

<context-param>
<param-name>
org.apache.myfaces.CHECK_EXTENSIONS_FILTER
</param-name>
<param-value>false</param-value>
</context-param>

<context-param>
<param-name>
org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER
</param-name>
<param-value>true</param-value>
</context-param>

<filter>
<display-name>RichFacesFilter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>

</init-param>
</filter>

<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>FacesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter>
<description>
For ensuring that user accesses the application after proper
login.
</description>
<display-name>sessionTrackingFilter</display-name>
<filter-name>sessionTrackingFilter</filter-name>
<filter-class>
ngi.web.session.SessionTimeoutFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sessionTrackingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<!--
<listener>
<listener-class>
ngi.web.session.MySessionListener
</listener-class>
</listener>



<filter>
<filter-name>SessionTimeoutFilter</filter-name>
<filter-class>
ngi.web.session.SessionTimeoutFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>SessionTimeoutFilter</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>SessionTimeoutFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>-->

<session-config>
<session-timeout>10</session-timeout>
</session-config>
</web-app>
=======================================================================

I receive the following error

2008-11-04 12:40:10,625 ERROR [org.apache.myfaces.lifecycle.PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW 1 afterPhase
java.lang.NullPointerException
at org.apache.myfaces.custom.excelexport.ExcelExportPhaseListener.generateExcel(ExcelExportPhaseListener.java:116)
at org.apache.myfaces.custom.excelexport.ExcelExportPhaseListener.afterPhase(ExcelExportPhaseListener.java:59)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:107)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
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:177)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)

=========================================================================

Help is appreciated.
Thanks
Farhan !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: s:excelExport Exception in PhaseListener