[ 
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.

Reply via email to