On Thu, Feb 19, 2009 at 11:11 AM, Matthias Wessendorf <[email protected]> wrote:
> Bart,
>
>>> I'd check what's really going inside here:
>>> javax.faces.FacesException: Cannot find FacesContext.
>>> at
>>> com.sun.faces.application.ConverterPropertyEditorBase.setAsText(ConverterPropertyEditorBase.java:103)
>
>
> the setAsText calls this guy:
> Object appAssociate = getPropertyEditorHelper();
>
> and inside the getPropertyEditorHelper() it explodes.
>
> See:
> http://fisheye5.atlassian.com/browse/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ConverterPropertyEditorBase.java?r=1.8
>
> So, question is now... how to really just enable MyFaces, since their
> EL impl (=> com.sun.el.lang.ELSupport.coerceToType(...) ) calls into
> their JSF impl (=>ConverterPropertyEditorBase)
and their ELSupport does this:
PropertyEditor editor = PropertyEditorManager.findEditor(type);
if (editor != null) {
editor.setAsText((String) obj);
return editor.getValue();
..........
I think you should contact the glassfish folks (or the RI DEVs)
-Matthias
>
>
> HTH,
> Matthias
>
>
>
>
>>>
>>> Also, yes, you are running MyFaces, snip:
>>> ...
>>> at
>>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>>> at
>>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
>>> ...
>>>
>>> So, I wonder why there is no FacesContext, since you are running w/in
>>> the lifecycle.
>>> The FacesContext is created by the FAcesServlet, *before* triggering
>>> the lifecyle.
>>
>> I'll dive into it. I'll let you (and the list) know if I find something...
>>
>> Bart
>>>
>>>
>>> -Matthias
>>>
>>> >
>>> > On Thu, Feb 19, 2009 at 09:20, Matthias Wessendorf <[email protected]>
>>> > wrote:
>>> >>
>>> >> Wait!
>>> >>
>>> >> Glassfish v2 server. Doesn't this ship the RI ?
>>> >>
>>> >> I am seeing this guy in you stack trace:
>>> >>
>>> >> com.sun.faces.application.ConverterPropertyEditorBase
>>> >>
>>> >> On Thu, Feb 19, 2009 at 9:19 AM, Matthias Wessendorf
>>> >> <[email protected]>
>>> >> wrote:
>>> >> > crazy,
>>> >> >
>>> >> > so you get that always, with <tr:validateDateRestriction> (and
>>> >> > facelets)
>>> >> > ?
>>> >> >
>>> >> > -Matthias
>>> >> >
>>> >> > On Thu, Feb 19, 2009 at 8:37 AM, Bart Kummel <[email protected]>
>>> >> > wrote:
>>> >> >> Hi,
>>> >> >>
>>> >> >> Has anyone an idea about what's going wrong here? Matthias?
>>> >> >>
>>> >> >> Regards,
>>> >> >> Bart
>>> >> >>
>>> >> >> On Sat, Feb 14, 2009 at 12:24, Bart Kummel <[email protected]>
>>> >> >> wrote:
>>> >> >>>
>>> >> >>> Hi,
>>> >> >>>
>>> >> >>> I'm trying to use the <tr:validateDateRestriction> component to
>>> >> >>> restrict
>>> >> >>> an input date to working days. So I set the invalidDaysOfWeek
>>> >> >>> attribute to
>>> >> >>> "sat sun". But then I get the following stack trace. (In fact I get
>>> >> >>> this
>>> >> >>> stack trace no matter what the contents of the string are.)
>>> >> >>>
>>> >> >>> javax.faces.FacesException: Cannot find FacesContext.
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.faces.application.ConverterPropertyEditorBase.setAsText(ConverterPropertyEditorBase.java:103)
>>> >> >>> at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:377)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:66)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:45)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ValidateHandler.apply(ValidateHandler.java:98)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>>> >> >>> at
>>> >> >>> com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:122)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
>>> >> >>> at
>>> >> >>> com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:241)
>>> >> >>> at
>>> >> >>> com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:98)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
>>> >> >>> at
>>> >> >>> com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
>>> >> >>> at
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
>>> >> >>> at
>>> >> >>> com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:188)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
>>> >> >>> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
>>> >> >>> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
>>> >> >>> at
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
>>> >> >>> at
>>> >> >>>
>>> >> >>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
>>> >> >>> at
>>> >> >>>
>>> >> >>> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
>>> >> >>> at
>>> >> >>>
>>> >> >>>
>>> >> >>> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
>>> >> >>>
>>> >> >>> I saw the same behaviour with the <tr:validateDateTimeRange>, when
>>> >> >>> I
>>> >> >>> tried
>>> >> >>> to set the minimum and maximum attributes with a literal string in
>>> >> >>> the
>>> >> >>> "yyyy-MM-dd" format. I worked around that by using an expression
>>> >> >>> that
>>> >> >>> evaluates to a java.util.Date. So I tried the same solution here,
>>> >> >>> except
>>> >> >>> that the expression now evaluates to a java.lang.String[] with the
>>> >> >>> following
>>> >> >>> contents: {"sat", "sun"}. When I do that, I don't get the exception
>>> >> >>> and my
>>> >> >>> page is rendered fine. But the validation is not working at all, I
>>> >> >>> can
>>> >> >>> still
>>> >> >>> input dates that are on saturday or sunday. Am I doing something
>>> >> >>> wrong, or
>>> >> >>> should I file a bug?
>>> >> >>>
>>> >> >>> I'm using Trinidad 1.2.10, MyFaces core 1.2.4, Facelets 1.1.14 on a
>>> >> >>> Glassfish v2 server.
>>> >> >>>
>>> >> >>> Best regards,
>>> >> >>> Bart Kummel
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Matthias Wessendorf
>>> >> >
>>> >> > blog: http://matthiaswessendorf.wordpress.com/
>>> >> > sessions: http://www.slideshare.net/mwessendorf
>>> >> > twitter: http://twitter.com/mwessendorf
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Matthias Wessendorf
>>> >>
>>> >> blog: http://matthiaswessendorf.wordpress.com/
>>> >> sessions: http://www.slideshare.net/mwessendorf
>>> >> twitter: http://twitter.com/mwessendorf
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Matthias Wessendorf
>>>
>>> blog: http://matthiaswessendorf.wordpress.com/
>>> sessions: http://www.slideshare.net/mwessendorf
>>> twitter: http://twitter.com/mwessendorf
>>
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf