IReport + JSF

Caros,

estou desenvolvendo uma aplicação e estou com problemas ao gerar o relatório.

Meu método;


public void visualizarImpressao () throws JRException, IOException {
		
		Servidor servidor = new Servidor();
		servidorPojo = new ServidorPojo();
		List<ServidorPojo> listaServidorPojo = new ArrayList<ServidorPojo>();
		HttpServletResponse response =((HttpServletResponse)(FacesContext.getCurrentInstance().getExternalContext().getResponse()));
 		servidor = servidorPagedBean.getDataModel().getRowData();
	
		servidorPojo.setIdServidor(servidor.getIdServidor());
		servidorPojo.setFotos(servidor.getFotos());
		listaServidorPojo.add(servidorPojo);
		
		JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(listaServidorPojo);
		Map<String, Object> parameters = populaParametrosRelatorio(servidorPojo);
		
		if (listaServidorPojo != null && listaServidorPojo.size() >0){
			ds = new JRBeanCollectionDataSource(listaServidorPojo);
		}
		JasperPrint jp = JasperFillManager.fillReport(ConstantesContexto.getBasePath()+Constantes.CAMINHO_ARQUIVO_JASPER_CADASTRO, parameters, ds);
		
		response.setHeader("Content-dispositiion","attachment;filename = relatorio.pdf");
		response.setContentType("application/pdf");
		JasperExportManager.exportReportToPdfStream(jp, response.getOutputStream());
}

Link JSP:

<h:column>
	<h:commandLink id="teste" value="Visualizar impressão"      action="#servidorBean.visualizarImpressao}"/>
</h:column>		

erro:

SEVERE: Error Rendering View[/view/cadastro/servidor/listarServidor.xhtml]
java.lang.IllegalStateException: Servlet response already use stream, Writer not possible
	at org.ajax4jsf.webapp.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:226)
	at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:400)
	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:557)
	at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
	at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

Alguém pode ajudar??

humm

faz assim:

<h:commandButton value="Pdf" action="#{seuBean.rodarPdf}"/>

[code]public String rodarPdf(){
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
Map<String, String> parameters = new HashMap<String, String>();

    String arquivo = new UtilFaces().getServletContext().getRealPath("arquivo.jasper");
    File reportFile = new File(arquivo);
    byte[] bytes = null;
    try{
        bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, ds);
    }catch(JRException e){
        e.printStackTrace();
    }
    launchPdfShow(bytes,false,"none");
}[/code]

[code]private void launchPdfShow(byte[] bytes,boolean isDownload,String fileName){
HttpServletResponse response = new UtilFaces().getResponse();
if (bytes != null && bytes.length > 0) {
ServletOutputStream ouputStream = null;
try {
response.setContentType(“application/pdf”);

            if(isDownload)
                response.setHeader("Content-disposition", "attachment;filename="+fileName+".pdf");

            response.setContentLength(bytes.length);
            ouputStream = response.getOutputStream();
            ouputStream.write(bytes, 0, bytes.length);
            ouputStream.flush();
            ouputStream.close();
            new UtilFaces().getFacesContext().responseComplete();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
     }
}[/code]

abs

[quote=rbroz85]humm

faz assim:

<h:commandButton value="Pdf" action="#{seuBean.rodarPdf}"/>

[code]public String rodarPdf(){
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
Map<String, String> parameters = new HashMap<String, String>();

    String arquivo = new UtilFaces().getServletContext().getRealPath("arquivo.jasper");
    File reportFile = new File(arquivo);
    byte[] bytes = null;
    try{
        bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, ds);
    }catch(JRException e){
        e.printStackTrace();
    }
    launchPdfShow(bytes,false,"none");
}[/code]

[code]private void launchPdfShow(byte[] bytes,boolean isDownload,String fileName){
HttpServletResponse response = new UtilFaces().getResponse();
if (bytes != null && bytes.length > 0) {
ServletOutputStream ouputStream = null;
try {
response.setContentType(“application/pdf”);

            if(isDownload)
                response.setHeader("Content-disposition", "attachment;filename="+fileName+".pdf");

            response.setContentLength(bytes.length);
            ouputStream = response.getOutputStream();
            ouputStream.write(bytes, 0, bytes.length);
            ouputStream.flush();
            ouputStream.close();
            new UtilFaces().getFacesContext().responseComplete();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
     }
}[/code]

abs[/quote]

Beleza, funcionou em partes…

a imagem fficou preta no relatório…

ficou um quadrado preto…

hummm vc ta usando imagem ? que tip ode imagem ?
imagem gerada por grafico do ireport ? BD ? ou JPEG ?

se for JPEG tenta passar ela por parametros assim:

parameters.put(“IMAGE1”, new UtilFaces().getServletContext().getRealPath("/WEB-INF/classes/Imagens/image01.jpg"));

o codigo q eu te mandei… é pra executar seu relatorio somente !
qualquer problema q esteja dando… pode ser de como seu .jasper foi feito ou a fonte de dados que esta vindo

mas posta ai. se der problema eu te ajudo

[quote=rbroz85]hummm vc ta usando imagem ? que tip ode imagem ?
imagem gerada por grafico do ireport ? BD ? ou JPEG ?

se for JPEG tenta passar ela por parametros assim:

parameters.put(“IMAGE1”, new UtilFaces().getServletContext().getRealPath("/WEB-INF/classes/Imagens/image01.jpg"));

o codigo q eu te mandei… é pra executar seu relatorio somente !
qualquer problema q esteja dando… pode ser de como seu .jasper foi feito ou a fonte de dados que esta vindo

mas posta ai. se der problema eu te ajudo[/quote]

eu trago ela do banco… tem como converter um Image em BufferedImage?

vc ta carregando as informações e manda mostrar la, inclusive a imagem !
se for assim…
pega a imagem do seu banco e transforma pra java.awt.image
no relatorio vc adiciona um field do tipo imagem e poe o atributo do seu objeto e no classe de expressa ode imagem vc poe java.awt.imagem
deve funcionar assim !

[quote=rbroz85]vc ta carregando as informações e manda mostrar la, inclusive a imagem !
se for assim…
pega a imagem do seu banco e transforma pra java.awt.image
no relatorio vc adiciona um field do tipo imagem e poe o atributo do seu objeto e no classe de expressa ode imagem vc poe java.awt.imagem
deve funcionar assim ![/quote]

Consegui resolver. Foi só transformar em Image e jogar ele pro Jasper…

Ficou bacana.

Valeu pela ajuda!

bom dia

como é a clsse UtilFaces() de vcs sou novato e to apanhado para esse relatorio.

ola bom dia.

segue minha classe UtilFaces

public class UtilFaces {

    public UtilFaces() {
    }
    
    public FacesContext getFacesContext() {
        return FacesContext.getCurrentInstance();
    }
    public ExternalContext getExternalContext() {
        return getFacesContext().getExternalContext();
    }
    public HttpServletRequest getRequest() {
        return (HttpServletRequest) getExternalContext().getRequest();
    }
    public HttpServletResponse getResponse() {
        return (HttpServletResponse) getExternalContext().getResponse();
    }
    public HttpSession getHttpSession(){
        return (HttpSession) getFacesContext().getExternalContext().getSession(false);
    }
    public ServletContext getServletContext(){
        return (ServletContext) getExternalContext().getContext();
    }
    public void msg(String destination,String msg){
        FacesMessage message = new FacesMessage(msg);
        getFacesContext().addMessage(destination, message);
    }
    public static void addErrorMessage(Exception ex, String defaultMsg) {
        String msg = ex.getLocalizedMessage();
        if (msg != null && msg.length() > 0) {
            addErrorMessage(msg);
        } else {
            addErrorMessage(defaultMsg);
        }
    }

    public static void addErrorMessages(List<String> messages) {
        for (String message : messages) {
            addErrorMessage(message);
        }
    }

    public static void addErrorMessage(String msg) {
        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
        FacesContext.getCurrentInstance().addMessage(null, facesMsg);
    }

    public static void addSuccessMessage(String msg) {
        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
        FacesContext.getCurrentInstance().addMessage("successInfo", facesMsg);
    }

    public static void addWarnMessage(String msg) {
        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_WARN, msg, msg);
        FacesContext.getCurrentInstance().addMessage("warnInfo", facesMsg);
    }

    public static void addFatalMessage(String msg) {
        FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_FATAL, msg, msg);
        FacesContext.getCurrentInstance().addMessage("fatalInfo", facesMsg);
    }
}

espero que ajude… um abraço

Muito obrigado vo testa aqui

mais uma duvida

  1. public String rodarPdf(){
  2.     JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);  
    
  3.     Map<String, String> parameters = new HashMap<String, String>();  
    
  4.     String arquivo = new UtilFaces().getServletContext().getRealPath("arquivo.jasper");  
    
  5.     File reportFile = new File(arquivo);  
    
  6.     byte[] bytes = null;  
    
  7.     try{  
    
  8.         bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, ds);  
    
  9.     }catch(JRException e){  
    
  10.         e.printStackTrace();  
    
  11.     }  
    
  12.     launchPdfShow(bytes,false,"none");  
    
  13. }  
    

retorna uma string onde coloco esse retorno???

ola, essa String é para o redirecionamento de página caso existir.

caso nao queira que redirecione para outra pagina… coloque

return “”;

ou o nome da pagina atual;

abs

cara ele faz a consulta passa por todos os metos nao da erro mas tbm nao abre nada

quando acontece isso, normalmente é problema de bibliotecas

no ireport que vc gerou o .jasper

va na pasta do ireport e copie os .jar’s e adicione no seu projeto

lembrando que as versoes das libs do projeto tem que sempre as mesmas do ireport.

abs

ba ta feio aqui da uma se vc ver alguma coisa de muito irregular ai.

public String rodarPdf(){
       List<Pedido> list = pedidoService.listaPeidoImpresao(pedidoService.findById(2l));
		
		JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
        Map<String, String> parameters = new HashMap<String, String>();
        
        String arquivo = new UtilFaces().getServletContext().getRealPath("arquivo.jasper");
        File reportFile = new File(arquivo);
        byte[] bytes = null;
        try{
            bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, ds);
        }catch(JRException e){
            e.printStackTrace();
        }
        launchPdfShow(bytes,false,"none");
		return 	"/list/pedidoList.jsf";
    }

	private void launchPdfShow(byte[] bytes,boolean isDownload,String fileName){
        HttpServletResponse response = new UtilFaces().getResponse();
        if (bytes != null && bytes.length > 0) {
            ServletOutputStream ouputStream = null;
            try {
                response.setContentType("application/pdf");

                if(isDownload)
                    response.setHeader("Content-disposition", "attachment;filename="+fileName+".pdf");

                response.setContentLength(bytes.length);
                ouputStream = response.getOutputStream();
                ouputStream.write(bytes, 0, bytes.length);
                ouputStream.flush();
                ouputStream.close();
                new UtilFaces().getFacesContext().renderResponse();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
         }
    }

desde ja obrigado

ai me retorno esse erro
GRAVE: Error Rendering View[/list/pedidoList.xhtml]
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:626)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:215)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:105)
at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:719)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:854)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:357)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:626)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:215)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:105)
at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:719)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:854)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:357)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
01/06/2011 10:06:42 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/asgi] threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:626)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:215)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:105)
at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:719)
at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:410)
at com.sun.faces.context.PartialViewContextImpl.access$200(PartialViewContextImpl.java:72)
at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:545)
at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:111)
at org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:103)
at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:192)
at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:119)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

grato

qual jsf vc ta usando ? o 1.2 ou 2 ?
se for o 2
isso ta errado: return “/list/pedidoList.jsf”;
seria so return “pedidoList”;

se for o 1.2
tem que ta mapeado la no faces-config
return “nomemapeado”;

outra… faça um system.out.println em arquivo…
pra ver se o caminho ta certo.
o nome do seu jasper é arquivo.jasper mesmo ?

abs

to usando 2 jsf 2 o arquivo .jasper ta pegando correto.

obg

EEEEEEEE
RESOLVIDO APENAS PQ TAVA USANDO COMANDLINK MUDEI PARA COMANDBUTON FUNGO.

OBRIGADO PELA AJUDA