You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Simon Kitching (JIRA)" <de...@myfaces.apache.org> on 2007/12/19 20:40:43 UTC

[jira] Created: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
---------------------------------------------------------------------------------------

                 Key: TOMAHAWK-1170
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: ExtensionsFilter
    Affects Versions: 1.1.7-SNAPSHOT
            Reporter: Simon Kitching


It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".

This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.

A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.

The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Kennard Consulting (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631600#action_12631600 ] 

Kennard Consulting commented on TOMAHAWK-1170:
----------------------------------------------

Thanks Leonardo, that appears to work.

Mind you, it sounds as if the default behaviour conflicts with itself unnecessarily, so perhaps that could be revisited?


> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Kennard Consulting (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632885#action_12632885 ] 

Kennard Consulting commented on TOMAHAWK-1170:
----------------------------------------------

Awesome. Thanks for the quick turn-around guys. Looking forward to the next release.


> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.8-SNAPSHOT
>
>         Attachments: TOMAHAWK-1170.patch
>
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631886#action_12631886 ] 

Leonardo Uribe commented on TOMAHAWK-1170:
------------------------------------------

The rule could be: If extensions filter checking is on, do not use TomahawkFacesContextWrapper, so the problem present dissapear.

Maybe is more user friendly this behavior.

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631597#action_12631597 ] 

Leonardo Uribe commented on TOMAHAWK-1170:
------------------------------------------

Tomahawk 1.1.7 has now a solution for avoid configure ExtensionsFilter using a TomahawkFacesContextWrapper. The best you can do is disable extensionsFilter checking and TomahawkFacesContextWrapper

  <context-param>
    <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
    <param-value>false</param-value>
  </context-param>

  <context-param>
    <param-name>org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER</param-name>
    <param-value>true</param-value>
  </context-param>

The default behavior is if ExtensionsFilter is not configured, it try to use TomahawkFacesContextWrapper as alternative, but since the checking of extensions filter is enabled by default it throws the exception when try to use it.

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved TOMAHAWK-1170.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.8-SNAPSHOT
         Assignee: Leonardo Uribe

Fixed as described before

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.8-SNAPSHOT
>
>         Attachments: TOMAHAWK-1170.patch
>
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Kennard Consulting (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631593#action_12631593 ] 

kennardconsulting edited comment on TOMAHAWK-1170 at 9/16/08 4:11 PM:
-----------------------------------------------------------------------

This is not intermittent for me - it happens every time.

I am mixing JBoss RichFaces and Tomahawk together. If you follow the advice given on the RichFaces page...

http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html_single/index.html#ApacheMyFaces

...which says "the RichFaces filter must be the first one among other filters", then the RichFaces filter gets hit first. It tries to get a FacesContext, which in turn triggers TomahawkFacesContextFactory.getFacesContext, and because the Tomahawk extensions filter hasn't been hit yet you get this error.

It would be okay if it was a warning, but as Tomahawk fails so hard it halts the entire filter chain.

See below. RichFaces (org.ajax4jsf.webapp.BaseFilter.doFilter) triggers Tomahawk (org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext) prematurely.

---

java.lang.IllegalStateException: ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.throwExtensionsFilterMissing(AddResourceFactory.java:389)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.checkEnvironment(AddResourceFactory.java:349)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:279)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextWrapper.<init>(TomahawkFacesContextWrapper.java:115)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext(TomahawkFacesContextFactory.java:85)
	at org.ajax4jsf.resource.InternetResourceService.getFacesContext(InternetResourceService.java:316)
	at org.ajax4jsf.resource.InternetResourceService.getResourceContext(InternetResourceService.java:250)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:159)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:500)



      was (Author: kennardconsulting):
    Sorry, I have that wrong.

The cause is not the <security-constraint>. The cause is I am mixing JBoss RichFaces and Tomahawk together. If you follow the advice given on the RichFaces page...

http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html_single/index.html#ApacheMyFaces

...which says "the RichFaces filter must be the first one among other filters", then the RichFaces filter gets hit first. It tries to get a FacesContext, which in turn triggers TomahawkFacesContextFactory.getFacesContext, and because the Tomahawk extensions filter hasn't been hit yet you get this error.

It would be okay if it was a warning, but as Tomahawk fails so hard it halts the entire filter chain.

See below. RichFaces (org.ajax4jsf.webapp.BaseFilter.doFilter) triggers Tomahawk (org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext) prematurely.

---

java.lang.IllegalStateException: ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.throwExtensionsFilterMissing(AddResourceFactory.java:389)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.checkEnvironment(AddResourceFactory.java:349)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:279)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextWrapper.<init>(TomahawkFacesContextWrapper.java:115)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext(TomahawkFacesContextFactory.java:85)
	at org.ajax4jsf.resource.InternetResourceService.getFacesContext(InternetResourceService.java:316)
	at org.ajax4jsf.resource.InternetResourceService.getResourceContext(InternetResourceService.java:250)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:159)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:500)


  
> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Kennard Consulting (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631593#action_12631593 ] 

Kennard Consulting commented on TOMAHAWK-1170:
----------------------------------------------

Sorry, I have that wrong.

The cause is not the <security-constraint>. The cause is I am mixing JBoss RichFaces and Tomahawk together. If you follow the advice given on the RichFaces page...

http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html_single/index.html#ApacheMyFaces

...which says "the RichFaces filter must be the first one among other filters", then the RichFaces filter gets hit first. It tries to get a FacesContext, which in turn triggers TomahawkFacesContextFactory.getFacesContext, and because the Tomahawk extensions filter hasn't been hit yet you get this error.

It would be okay if it was a warning, but as Tomahawk fails so hard it halts the entire filter chain.

See below. RichFaces (org.ajax4jsf.webapp.BaseFilter.doFilter) triggers Tomahawk (org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext) prematurely.

---

java.lang.IllegalStateException: ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.throwExtensionsFilterMissing(AddResourceFactory.java:389)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.checkEnvironment(AddResourceFactory.java:349)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:279)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextWrapper.<init>(TomahawkFacesContextWrapper.java:115)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext(TomahawkFacesContextFactory.java:85)
	at org.ajax4jsf.resource.InternetResourceService.getFacesContext(InternetResourceService.java:316)
	at org.ajax4jsf.resource.InternetResourceService.getResourceContext(InternetResourceService.java:250)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:159)
	at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:500)



> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631980#action_12631980 ] 

Leonardo Uribe commented on TOMAHAWK-1170:
------------------------------------------

The actual behavior is this:

Default:

org.apache.myfaces.CHECK_EXTENSIONS_FILTER is true
org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER is false

If no extensions filter is configured, TomahawkFacesContextWrapper is used. In portlet world, TomahawkFacesContextWrapper is always used.

The new default behavior is this

org.apache.myfaces.CHECK_EXTENSIONS_FILTER is true
org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER is true

If no extensions filter is configured, no alternative is used.

So the solution proposed is change the default value of org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER from false to true, and check this config param in portlet world, so there should be a way to disable it in portlet world too.

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Kennard Consulting (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631227#action_12631227 ] 

Kennard Consulting commented on TOMAHAWK-1170:
----------------------------------------------

It's not intermittent.

If your main page is called, say, 'index.jsf' but that's protected in the web.xml by a <security-constraint>, then the filter won't fire via the JSP route (you'll get bounced to, say, login.jsf) but it WILL fire via the javax.faces.webapp.FacesServlet.service...

11:29:24,484 http-127.0.0.1-8080-1 WARN  [FormAuthenticator] Unexpected error forwarding to login page
java.lang.IllegalStateException: ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.throwExtensionsFilterMissing(AddResourceFactory.java:389)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.checkEnvironment(AddResourceFactory.java:349)
	at org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:279)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextWrapper.<init>(TomahawkFacesContextWrapper.java:115)
	at org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory.getFacesContext(TomahawkFacesContextFactory.java:85)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:260)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

...and it'll always fail.

This check is a nice idea, but it might be better off being a warning in the logs rather than a hard error that stops the entire app.


> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631673#action_12631673 ] 

Simon Kitching commented on TOMAHAWK-1170:
------------------------------------------

Kennard's problem is simply that the advice on the referenced RichFaces site is wrong. They simply cannot insist on being the first filter in the list if they create their own FacesContext wrapper directly and then the rendered page uses tomahawk components. The ExtensionsFilter needs to be first in this case. Please report this as a bug in the RichFaces documentation.

Leonardo, I do think that there is a bug in the new tomahawk extensions code though. IMO, the TomahawkFacesContextWrapper should set the flag that the AddResourceFactory is checking for. The check is really to verify that the response is correctly wrapped, and so the flag should be set in the two places where the response can be wrapped: (a) the filter, and (b) the custom FacesContext.

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1170) Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load

Posted by "Mario Buonopane (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616377#action_12616377 ] 

Mario Buonopane commented on TOMAHAWK-1170:
-------------------------------------------

I alse have the same problem. I'm using version 1.1.5. 
My web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!-- 
	Copyright 2006 The Apache Software Foundation.
	
	Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at
	
	http://www.apache.org/licenses/LICENSE-2.0
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
	
	$Id: web.xml,v 1.3 2008/07/23 17:35:53 mbnpane Exp $
-->


<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee                               http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	version="2.4">

	<!-- Display name for this application -->
	<display-name>Accenture Claims</display-name>

	<!-- ADD THIS LINES TO CONFIGURE ACEGI AUTHENTICATION -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			/WEB-INF/applicationContext-acegi-security.xml
		</param-value>
	</context-param>

	<filter>
		<filter-name>Acegi Filter Chain Proxy</filter-name>
		<filter-class>
			org.acegisecurity.util.FilterToBeanProxy
		</filter-class>
		<init-param>
			<param-name>targetClass</param-name>
			<param-value>
				org.acegisecurity.util.FilterChainProxy
			</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>Acegi Filter Chain Proxy</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>

	<!-- *********************************************-->



	<!-- Select JSF State Saving Mode -->
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>

	<context-param>
		<description>
			Only applicable if state saving method is &quot;server&quot;
			(= default). Defines the amount (default = 20) of the latest
			views are stored in session.
		</description>
		<param-name>
			org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
		</param-name>
		<param-value>1</param-value>
	</context-param>

	<context-param>
		<description>
			Only applicable if state saving method is &quot;server&quot;
			(= default). If true (default) the state will be serialized
			to a byte stream before it is written to the session. If
			false the state will not be serialized to a byte stream.
		</description>
		<param-name>
			org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
		</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<description>
			Only applicable if state saving method is &quot;server&quot;
			(= default) and if
			org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (=
			default) If true (default) the serialized state will be
			compressed before it is written to the session. If false the
			state will not be compressed.
		</description>
		<param-name>
			org.apache.myfaces.COMPRESS_STATE_IN_SESSION
		</param-name>
		<param-value>false</param-value>
	</context-param>

	<!-- MyFaces Configuration Resources (comma-separated list) -->

	<context-param>
		<description>
			This parameter tells MyFaces if javascript code should be
			allowed in the rendered HTML output. If javascript is
			allowed, command_link anchors will have javascript code that
			submits the corresponding form. If javascript is not
			allowed, the state saving info and nested parameters will be
			added as url parameters. Default: &quot;true&quot;
		</description>
		<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
		<param-value>false</param-value>
	</context-param>
	<context-param>
		<description>
			If true, rendered HTML code will be formatted, so that it is
			&quot;human readable&quot;. i.e. additional line separators
			and whitespace will be written, that do not influence the
			HTML code. Default: &quot;true&quot;
		</description>
		<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<description>
			If true, a javascript function will be rendered that is able
			to restore the former vertical scroll on every request.
			Convenient feature if you have pages with long lists and you
			do not want the browser page to always jump to the top if
			you trigger a link or button action that stays on the same
			page. Default: &quot;false&quot;
		</description>
		<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<description>
			Validate managed beans, navigation rules and ensure that
			forms are not nested.
		</description>
		<param-name>org.apache.myfaces.VALIDATE</param-name>
		<param-value>true</param-value>
	</context-param>

	<!-- JSF Configuration Resources (comma-separated list) -->
	<context-param>
		<param-name>javax.faces.CONFIG_FILES</param-name>
		<param-value>/WEB-INF/adf-faces-config.xml</param-value>
	</context-param>

	<!-- Commons Chain Configuration Resources -->
	<context-param>
		<param-name>
			org.apache.commons.chain.CONFIG_WEB_RESOURCE
		</param-name>
		<param-value>/WEB-INF/chain-config.xml</param-value>
	</context-param>

	<!-- Tiles ViewHandler config file -->

	<context-param>
		<param-name>tiles-definitions</param-name>
		<param-value>/WEB-INF/tiles-config.xml</param-value>
	</context-param>


	<!-- Spring ApplicationContext Configuration (space separated list) -->
	<!--
		&lt;context-param&gt;
		&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
		&lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
		&lt;/context-param&gt;
	-->

	<!-- Extensions Filter -->
	<filter>
		<filter-name>extensionsFilter</filter-name>
		<filter-class>
			org.apache.myfaces.webapp.filter.ExtensionsFilter
		</filter-class>
		<init-param>
			<param-name>uploadMaxFileSize</param-name>
			<param-value>100m</param-value>
		</init-param>
		<init-param>
			<param-name>uploadThresholdSize</param-name>
			<param-value>100k</param-value>
		</init-param>
		<!--        &lt;init-param&gt;
			&lt;param-name&gt;uploadRepositoryPath&lt;/param-name&gt;
			&lt;param-value&gt;/temp&lt;/param-value&gt;
			&lt;description&gt;Set the path where the intermediary files will be stored.
			&lt;/description&gt;
			&lt;/init-param&gt;-->
	</filter>
	<!-- MyFaces Filter Mapping -->
	<filter-mapping>
		<filter-name>extensionsFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>extensionsFilter</filter-name>
		<url-pattern>*.faces</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>extensionsFilter</filter-name>
		<url-pattern>/faces/*</url-pattern>
	</filter-mapping>

	<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-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<!-- Shale Application Controller Filter -->
	<filter>
		<filter-name>shale</filter-name>
		<filter-class>
			org.apache.shale.application.faces.ShaleApplicationFilter
		</filter-class>
	</filter>


	<!-- Shale Application Controller Filter Mapping -->
	<filter-mapping>
		<filter-name>shale</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>

	<!-- Commons Chain Configuration Listener -->
	<listener>
		<listener-class>
			org.apache.commons.chain.web.ChainListener
		</listener-class>
	</listener>


	<!-- JavaServer Faces Servlet Configuration -->
	<servlet>
		<servlet-name>faces</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<!-- Tomahawk -->
	<servlet>
		<servlet-name>SourceCodeServlet</servlet-name>
		<servlet-class>
			org.apache.myfaces.shared_tomahawk.util.servlet.SourceCodeServlet
		</servlet-class>
	</servlet>

	<!-- JavaServer Faces Servlet Mapping -->
	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>*.faces</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>faces</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

	<!-- Tomahawk Servlet Mapping -->
	<servlet-mapping>
		<servlet-name>SourceCodeServlet</servlet-name>
		<url-pattern>*.source</url-pattern>
	</servlet-mapping>

	<!-- Welcome File List -->
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

</web-app>

> Resource mapping missing / throwExtensionsFilterMissing reported incorrectly under load
> ---------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1170
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1170
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: ExtensionsFilter
>    Affects Versions: 1.1.7-SNAPSHOT
>            Reporter: Simon Kitching
>
> It has been reported by two users that under load an application using Tomahawk intermittently throws an exception claiming "resource mapping missing".
> This message is meant to be thrown when a component in a request wants to register stuff for the extensions filter to output, but the current request never passed through the extensions filter. This is a sanity check to ensure that people that misconfigure the ExtensionsFilter get a helpful error message rather than just having tomahawk components that need additional resources acting weirdly.
> A workaround is to disable this safety check. The first reporter of this problem did disable the check and found the issue disappeared.
> The problem appears to be a race condition between multiple threads *reading* a map; at least that was the only piece of code I found that had any obvious thread race issues. I can't remember the exact piece of code for the moment, but will update this issue when I find it again.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.