Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:19:59+00:00 2026-06-07T20:19:59+00:00

I am using my-faces 2.1.5 primefaces 3.2 and WebLogic Server Version: 10.3.2.0 While I

  • 0

I am using my-faces 2.1.5 primefaces 3.2 and WebLogic Server Version: 10.3.2.0

While I am generating files and trying to download them via p:fileDownload I get the following error message:

java.lang.IllegalStateException: strict servlet API: cannot call getWriter() after getOutputStream()
at weblogic.servlet.internal.ServletResponseImpl.getWriter(ServletResponseImpl.java:309)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.getResponseOutputWriter(ServletExternalContextImpl.java:185)
at org.apache.myfaces.renderkit.ErrorPageWriter.handle(ErrorPageWriter.java:469)
at org.apache.myfaces.context.MyFacesExceptionHandlerWrapperImpl.handle(MyFacesExceptionHandlerWrapperImpl.java:301)
at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:64)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

I don’t know if it’s a bug in the weblogic or perhaps it’s a bug in my code ?

This message is the only reference that I got and I don’t have any clue how to solve this issue

The jsf file:

<p:commandButton id="genButton" value="Generate Files" disabled="#{bean.disableButton}" actionListener="#{bean.generate}" onclick="PrimeFaces.monitorDownload(showStatus, hideStatus)" ajax="false" style="width:200px" icon="ui-icon-shuffle">
        <p:fileDownload value="#{bean.zipfile}"/>  
        </p:commandButton> 

The bean:

     File zip = File.createTempFile(selectedCode, "zip");  

            ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zip.getPath()));  
            for (File file : adapter.listFiles) {  
                addFileToZip(file, zos);  
            }  

            InputStream in = new FileInputStream(zip);  
            file = new DefaultStreamedContent(in, "zip", selectedCode + ".zip");  
            adapter.listFiles.clear();  
            zos.flush();  
            zos.close(); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:20:00+00:00Added an answer on June 7, 2026 at 8:20 pm

    It’s look like i found the solution 🙂

    in case the list is empty then …

      else {
                if (streamedContent != null) {
                    streamedContent.getStream().close();
                    streamedContent = null;
                }
            }
    

    Thanks for the help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build simple web app using primefaces 3.0.M2 version. I am
I have a Java based web-application using Java Server Faces and Facelets. I am
I am currently looking in to some file uploading using Java Server Faces. I've
Using jsf2 (see maven dependencies ) <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.10</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId>
I'm trying to handle a ViewExpiredException exception on an ajax call using primefaces 2.2.1
I am trying to register different converter instances in the faces-config, using a standard
I'm trying to filter a dataTable using Primefaces much like this example . (In
I have correctly set up a Push server using PrimeFaces p:push component (using a
I'm trying to iterate over a collection of entity objects using ui:repeat tags. While
I am trying to jumpstart my Primefaces 3.2 development using Eclipse 3.6 and Glassfish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.