You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Alexander Golubev (JIRA)" <de...@myfaces.apache.org> on 2006/02/07 10:25:57 UTC

[jira] Created: (MYFACES-1096) Error-page problem with ExtensionsFilter

Error-page problem with ExtensionsFilter
----------------------------------------

         Key: MYFACES-1096
         URL: http://issues.apache.org/jira/browse/MYFACES-1096
     Project: MyFaces
        Type: Bug
  Components: Tomahawk  
    Versions: 1.1.1    
 Environment: facelets 1.0.2, tomcat 5.5.12
    Reporter: Alexander Golubev


It is a problem with getting custom error-page definitions in web.xml
If I request URL "/blabla.html"
that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
called for this response" and in the end, the default Tomcat 404 page is
displayed. 

The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (TOMAHAWK-78) Error-page problem with ExtensionsFi

Posted by Freya <Fr...@howest.be>.
I have the same problem with MyFaces1.1.3 and Tomahawk1.1.2, could there be
any other problem?
(JSF version?)
--
View this message in context: http://www.nabble.com/-jira--Created%3A-%28MYFACES-1096%29-Error-page-problem-with-ExtensionsFilter-t1074854.html#a5053804
Sent from the My Faces - Dev forum at Nabble.com.


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Alexander Golubev (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366206 ] 

Alexander Golubev commented on MYFACES-1096:
--------------------------------------------

Now I have both filter mappings in the web.xml. But IllegalStateException still throws.

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Sukhada (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366208 ] 

Sukhada commented on MYFACES-1096:
----------------------------------

Try taking out "faces" from the url-pattern.

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

 If it doesn't work then if your page is under some directory then add that directory's name and map it.

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/foo/*</url-pattern>
  </filter-mapping>

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Alexander Golubev (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366216 ] 

Alexander Golubev commented on MYFACES-1096:
--------------------------------------------

I try out all casses but without success. if you look at the code of ExtensionsFilter ...
        // here we call next filter
        chain.doFilter(extendedRequest, extendedResponse);
        
        extendedResponse.finishResponse(); 
        
        if( ! AddResource.hasAdditionalHeaderInfoToRender(extendedRequest) ){              
            response.getOutputStream().write( extendedResponse.getBytes());
            return;
        }
        // Some headerInfo has to be added
-->        // here we add some header info even if there was an error (404) and there is no content 
        AddResource.writeWithFullHeader(extendedRequest, extendedResponse, (HttpServletResponse)response);


> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Sukhada (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366202 ] 

Sukhada commented on MYFACES-1096:
----------------------------------

I see in your code that you don't have following code. I have to have both filter mappings in the web.xml. Try adding that.


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

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-78) Error-page problem with ExtensionsFilter

Posted by "Jack Rudnick (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-78?page=comments#action_12459655 ] 
            
Jack Rudnick commented on TOMAHAWK-78:
--------------------------------------

I submit that this should be moved from "major" to "critical"

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>                 Key: TOMAHAWK-78
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-78
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>         Environment: facelets 1.0.2, tomcat 5.5.12
>            Reporter: Alexander Golubev
>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-78) Error-page problem with ExtensionsFilter

Posted by "Jon Harley (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-78?page=comments#action_12378950 ] 

Jon Harley commented on TOMAHAWK-78:
------------------------------------

I had this same problem when using MyFaces 1.1.1, but it has gone away with MyFaces core 1.1.3 + Tomahawk 1.1.2

Looks like the issue is fixed.


> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: TOMAHAWK-78
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-78
>      Project: MyFaces Tomahawk
>         Type: Bug

>   Components: ExtensionsFilter
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-78) Error-page problem with ExtensionsFilter

Posted by "Esteve (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-78?page=comments#action_12415678 ] 

Esteve commented on TOMAHAWK-78:
--------------------------------

Hi all,

I've found that using jsp  forwards like "<jsp:forward page="login.faces"/>" this error appears, but if you access directly to the page, passing through faces servlet all works find.

I know it doesn't add much value but it could help somebody. I've spended a pair of hours on this trick....

Bye 

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: TOMAHAWK-78
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-78
>      Project: MyFaces Tomahawk
>         Type: Bug

>   Components: ExtensionsFilter
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Alexander Golubev (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366191 ] 

Alexander Golubev commented on MYFACES-1096:
--------------------------------------------

I have no  eclipse or jbuilder.
All pages are myfaces pages.
web.xml contains
 <filter>
        <filter-name>ExtensionsFilter</filter-name>
        <filter-class>
            org.apache.myfaces.component.html.util.ExtensionsFilter
        </filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>50m</param-value>
        </init-param>
        <init-param>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
    </filter>
<filter-mapping>
        <filter-name>ExtensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>        
    </filter-mapping>
<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>*.jsf</url-pattern>
    </servlet-mapping>

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Sukhada (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12365774 ] 

Sukhada commented on MYFACES-1096:
----------------------------------

In your web.xml try changing your url-pattern. Because I was having the same problem but I fixed changing the url-patterns.

For e.g. 

for eclipse it worked with this code 

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
  </filter-mapping>


and for jbuilder I have different mapping.

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
  </filter-mapping>

If you your jsp page is under 'foo' folder then try url-pattern like 

<url-pattern>/foo/*</url-pattern>


Hope this will help.

Sukhada.



> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1096) Error-page problem with ExtensionsFilter

Posted by "Sukhada (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1096?page=comments#action_12366221 ] 

Sukhada commented on MYFACES-1096:
----------------------------------

Ok I tried in my program changing the mapping and that only gives me the error same like yours

12:30:07,832 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
	at org.apache.catalina.connector.Response.getWriter(Response.java:596)
.........
...........
.........




But if I add the following things in my project it works fine.


Which version of tomahawk jar do you have. I got the one from release of size-1019.8 KB
I have common-lang-2.1.jar of size-202.9 KB

I didn't change anything in extensionFilter. Just added the tomahawk tag <t:inputCalendar id="foo" ....................../>

and in my web.xml I have the following code

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
  </filter-mapping>  
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
  </filter-mapping>

thats it. I didn't add anything other than this and it works fine.

> Error-page problem with ExtensionsFilter
> ----------------------------------------
>
>          Key: MYFACES-1096
>          URL: http://issues.apache.org/jira/browse/MYFACES-1096
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.1
>  Environment: facelets 1.0.2, tomcat 5.5.12
>     Reporter: Alexander Golubev

>
> It is a problem with getting custom error-page definitions in web.xml
> If I request URL "/blabla.html"
> that doesn't exist, java.lang.IllegalStateException "getOutputStream() has already been
> called for this response" and in the end, the default Tomcat 404 page is
> displayed. 
> The problem is caused by the extensionsfilter that writes header information to the empty response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira