[jboss-user] [JBoss Seam] - Re: Help: Seam PDF NPE??

Premheiko do-not-reply at jboss.com
Sat Mar 24 10:22:25 EDT 2007


Hi.,
 I debugged inside Seam code and found that in DocumentStorePhaseListener documentData is NULL


  |   DocumentData documentData = DocumentStore.instance).getDocumentData(contentId);
  |   byte[] data = documentData.getData();
  | 


Here's my web.xml file


  | <?xml version="1.0" encoding="UTF-8"?>
  | <web-app>   
  |       
  |     <context-param>      
  |       <param-name>javax.faces.CONFIG_FILES</param-name>      
  |       <param-value>/WEB-INF/navigation.xml</param-value>   
  |     </context-param>	   
  |     
  |     <!-- Ajax4jsf (must come first!) -->		   
  |     <filter>     
  |       <display-name>Ajax4jsf Filter</display-name>     
  |       <filter-name>ajax4jsf</filter-name>     
  |       <filter-class>org.ajax4jsf.Filter</filter-class>   
  |     </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> 
  |     <context-param>     
  |       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>     
  |       <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>        
  |     </context-param>        
  |     
  |     <!-- Seam -->           
  |     <listener>              
  |       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>        
  |     </listener>    
  | <!--  -->
  |     <filter>
  |       <filter-name>Seam Filter</filter-name>
  |       <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
  |     </filter>
  | 
  |     <filter-mapping>
  |       <filter-name>Seam Filter</filter-name>
  |       <url-pattern>/*</url-pattern>
  |     </filter-mapping>
  |     
  |     
  |     
  |     <servlet>
  |       <servlet-name>Seam Resource Servlet</servlet-name>
  |       <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
  |     </servlet>
  |     
  |     <servlet-mapping>
  |       <servlet-name>Seam Resource Servlet</servlet-name>
  |       <url-pattern>/seam/resource/*</url-pattern>
  |     </servlet-mapping>     
  |    
  |     
  |     <!-- Faces Servlet -->    
  |     <servlet>              
  |       <servlet-name>Faces Servlet</servlet-name>              
  |       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>              
  |       <load-on-startup>1</load-on-startup>        
  |     </servlet>    
  |     <!-- Faces Servlet Mapping -->    
  |     <servlet-mapping>              
  |       <servlet-name>Faces Servlet</servlet-name>              
  |       <url-pattern>*.seam</url-pattern>        
  |     </servlet-mapping>
  |     <!-- SEAM PDF -->
  |     
  |      <filter>
  |         <filter-name>Seam Servlet Filter</filter-name>
  |         <filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
  |     </filter>
  | 
  |     <filter-mapping>
  |         <filter-name>Seam Servlet Filter</filter-name>
  |         <url-pattern>*.pdf</url-pattern>
  |     </filter-mapping>
  |     
  |        <filter>
  |         <filter-name>Seam Redirect Filter</filter-name>
  |         <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
  |     </filter>
  |     
  |     <filter-mapping>
  |         <filter-name>Seam Redirect Filter</filter-name>
  |         <url-pattern>*.seam</url-pattern>
  |     </filter-mapping>
  |     
  |     
  |     
  |      <servlet>
  |         <servlet-name>Document Store Servlet</servlet-name>
  |         <servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
  |     </servlet>
  | 
  |     <servlet-mapping>
  |         <servlet-name>Document Store Servlet</servlet-name>
  |         <url-pattern>*.pdf</url-pattern>
  |     </servlet-mapping>
  |     
  |     <!-- JSF parameters -->  
  |     <context-param>              
  |       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>              
  |       <param-value>client</param-value>        
  |     </context-param>    
  |     <context-param>        
  |       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>        
  |       <param-value>.xhtml</param-value>    
  |     </context-param>    
  |     <context-param>        
  |       <param-name>facelets.DEVELOPMENT</param-name>        
  |       <param-value>true</param-value>    
  |     </context-param>  
  |     
  |      <welcome-file-list>
  | 		<welcome-file>index.jsp</welcome-file>
  | 	</welcome-file-list>
  | 	
  |     <!-- MyFaces -->    
  |     <listener>        
  |       <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>    
  |     </listener>     
  |     
  |     
  |       <!-- For Tomahawk  -->
  |     <context-param>
  | 		<param-name>facelets.LIBRARIES</param-name>
  | 		<param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
  | 	</context-param>
  | 	
  | 	
  | 	<!-- Extensions Filter -->
  | 	<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>20m</param-value>
  | 		</init-param>
  | 	</filter>
  | 
  | 	
  | 	<filter-mapping>
  | 		<filter-name>MyFacesExtensionsFilter</filter-name>
  | 		<servlet-name>Faces Servlet</servlet-name>
  | 	</filter-mapping>
  | 
  | 
  | 
  | 	<!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
  | 	<filter-mapping>
  | 		<filter-name>MyFacesExtensionsFilter</filter-name>
  | 		<url-pattern>/seam/myFacesExtensionResource/*</url-pattern>
  | 	</filter-mapping>
  | 
  | 
  | 	<filter-mapping>
  | 		<filter-name>MyFacesExtensionsFilter</filter-name>
  | 		<url-pattern>*.seam</url-pattern>
  | 	</filter-mapping>
  | 	
  | 	<!-- 
  | 		<context-param>
  | 		<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
  | 		<param-value>true</param-value>
  | 		</context-param>
  | 	-->
  | 
  | 
  | 	<context-param>
  | 		<description>
  | 			If true, rendered HTML code will be formatted, so that it is
  | 			"human readable". i.e. additional line separators and
  | 			whitespace will be written, that do not influence the HTML
  | 			code. Default: "true"
  | 		</description>
  | 		<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
  | 		<param-value>true</param-value>
  | 	</context-param>
  |     
  | </web-app>
  | 

In previous project we used JasperReports and now we want to use all features of SEAM. I don't want to go back to jasperreports. I think its just a silly config problem. 

Please help me.

Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031286#4031286

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031286



More information about the jboss-user mailing list