14 Replies Latest reply on Oct 15, 2008 3:56 PM by Nick Belaevski

    Problem starting my app

    César Pérez Newbie

      I have a problem starting my application, I get an exception and I dont know why. It runs perfectly fine in tomcat but I am having a roblem with weblogic.

      I am using richfaces but also woodstock components from netbeans. I don't have a problem in my development machine so what could be the problem in weblogic or are they just incompatible?

      Possible Source of Error:
      Class Name: org.ajax4jsf.webapp.FilterServletResponseWrapper
      File Name: FilterServletResponseWrapper.java
      Method Name: getWriter
      Line Number: 226

      org.ajax4jsf.webapp.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:226)
      com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:186)
      com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:320)
      org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
      com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:106)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
      weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
      weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
      weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
      weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
      weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
      weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3368)
      weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      weblogic.security.service.SecurityManager.runAs( Unknown Source )
      weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117)
      weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023)
      weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
      weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
      weblogic.work.ExecuteThread.run(ExecuteThread.java:172)


        • 1. Re: Problem starting my app
          Nick Belaevski Master

          What RichFaces/Weblogic versions do you use?

          • 2. Re: Problem starting my app
            César Pérez Newbie

            I have:

            - JSF 1.2 (latest release)
            - Bea Weblogic 10 and Oracle Weblogic 10gR3
            - Richfaces 3.2.1.GA

            I have tried older versions of RF but it is the same problem.

            Thanks

            • 3. Re: Problem starting my app
              César Pérez Newbie

              mmm no edit button

              I also created an empty project with just one JSP + Richfaces and it failed to open it too with the same error.

              As I said before it works in Tomcat and Glassfish so I dont know what's wrong. I read a PDF that said it was supposed to happen with MyFaces but Im not using it.

              • 4. Re: Problem starting my app
                César Pérez Newbie

                Anyone?

                I really wanted to use richfaces but looks like we will have to drop it and use another library as the chosen AS is Weblogic.

                It's a shame that RF is not tested against this AS considering is a popular one and widely used.

                • 5. Re: Problem starting my app
                  Nick Belaevski Master

                  Hi,

                  I've just deployed 3.2.1.GA richfaces-demo project under WL 10.3 and it's working perfectly. Is it possible to obtain runnable WAR file you have problems with to ivestigate the problem? Thank you in advance!

                  • 6. Re: Problem starting my app
                    César Pérez Newbie

                    But this is using Facelets isn't it? I am using JSP for my view.

                    I will try to deploy the demo and get back the results. I will also try to get a WAR for you.

                    Thanks

                    • 7. Re: Problem starting my app
                      Nick Belaevski Master

                      I've downloaded standard Woodstock application and added RichFaces 3.2.1 there, then deployed to WL 10.3. Working ok also.

                      • 8. Re: Problem starting my app
                        César Pérez Newbie

                        Really? I cant seem to get it working, the richfaces demo works without problems here but it is using Facelets.

                        Can you post the web.xml and faces-config.xml ? Also have you created a JSP with woodstock and another with RF?

                        Or maybe an step by step guide? I just cant get it working and I have been trying since 2 days ago. Also which JARs are you using?

                        I really want to use RF because it has some features that I need and are ready out of the box.

                        Thanks

                        • 9. Re: Problem starting my app
                          César Pérez Newbie

                          Eclipse -> New Dynamic Web project

                          Added all the jars from the demo. How do you add the JSF jars? in the WEB-INF/lib?

                          faces-config.xml is empty

                          jsp

                          <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
                          <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
                          <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
                          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                          <html>
                          <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                          <title>Insert title here</title>
                          </head>
                          <body>
                          <f:view>
                           <h:outputText value="hello" />
                          </f:view>
                          </body>
                          </html>


                          web.xml
                          <?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>Fixed</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>
                          
                           <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>server</param-value>
                           </context-param>
                          
                           <filter>
                           <display-name>RichFaces Filter</display-name>
                           <filter-name>richfaces</filter-name>
                           <filter-class>org.ajax4jsf.Filter</filter-class>
                           </filter>
                          
                           <filter-mapping>
                           <filter-name>richfaces</filter-name>
                           <servlet-name>Faces Servlet</servlet-name>
                           <dispatcher>REQUEST</dispatcher>
                           <dispatcher>FORWARD</dispatcher>
                           <dispatcher>INCLUDE</dispatcher>
                           </filter-mapping>
                          
                           <listener>
                           <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                           </listener>
                          
                           <servlet>
                           <servlet-name>Faces Servlet</servlet-name>
                           <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                           <load-on-startup>1</load-on-startup>
                           </servlet>
                           <servlet-mapping>
                           <servlet-name>Faces Servlet</servlet-name>
                           <url-pattern>/faces/*</url-pattern>
                           </servlet-mapping>
                          </web-app>
                          



                          ADVERTENCIA: executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@3ea75e) threw exception
                          java.lang.IllegalStateException: Servlet response already use stream, Writer not possible
                           at org.ajax4jsf.webapp.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:226)
                           at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:186)
                           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
                           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
                           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
                           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
                           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                           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:42)
                           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
                           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
                           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
                           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
                           at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
                           at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:159)
                           at jsp_servlet.__index._jspService(__index.java:72)
                           at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
                           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.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
                           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
                           at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
                           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
                           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
                           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
                           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
                           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
                           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                          7/09/2008 12:33:50 PM org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter
                          GRAVE: Exception in the filter chain
                          javax.servlet.ServletException: Servlet response already use stream, Writer not possible
                           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                           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:42)
                           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
                           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
                           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
                           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
                           at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
                           at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:159)
                           at jsp_servlet.__index._jspService(__index.java:72)
                           at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
                           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.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
                           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
                           at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
                           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
                           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
                           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
                           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
                           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
                           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
                           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                          Caused by: java.lang.IllegalStateException: Servlet response already use stream, Writer not possible
                           at org.ajax4jsf.webapp.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:226)
                           at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:186)
                           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
                           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
                           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
                           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
                           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                           ... 33 more
                          


                          • 10. Re: Problem starting my app
                            César Pérez Newbie

                            Tried the same empty app but instead of using JSP for the view I changed it to facelets and guess what? It worked so it is an issue with JSP but I cant seem to find the reason or how to fix it.

                            I like facelets but the project Im working on is only JSP and the decision to move it to facelets is not mine.

                            BTW This forum should have an edit button.

                            • 11. Re: Problem starting my app
                              César Pérez Newbie

                              I have uploaded a Sample project that does not work for me in Weblogic 10gR3.

                              It contains two pages: one is a facelets xhtml file that works and the other one is a JSP that does not work and throws the exception I mentioned before.

                              In weblogic I created a new domain with the default options and deployed it through Eclipse. I also tried creating a WAR and an EAR but the exception is the same.

                              http://rapidshare.com/files/143462248/RichfacesErrorProject.zip.html

                              • 12. Re: Problem starting my app
                                César Pérez Newbie

                                I opened a ticket in JIRA and added more information
                                https://jira.jboss.org/jira/browse/RF-4415

                                • 13. Re: Problem starting my app
                                  Thomas Delhoménie Newbie

                                  I have exactly the same problem.
                                  I have to use MyFaces and WebLogic 10gR3.
                                  During the development, I can modify the jar file to not throw the exception but I don't want to put this in production, so I really need the fix.
                                  Do you think this bug will be fixed in 3.3 ? And when the 3.3 version will be released ?

                                  • 14. Re: Problem starting my app
                                    Nick Belaevski Master

                                    Hi,

                                    You can use RI or wait until 3.3.0. If the bug is caused by RichFaces and not MyFaces, then I think we'll fix it.