What can I say - you are absolutely right.

However, maybe you could ask Cristi to take a look at this when he is
with you, and then it might as well work again, so let's not change it
too fast ;)

regards,

Martin

On 1/30/08, Kuhn, Harald <[EMAIL PROTECTED]> wrote:
> Hi Martin,
>
> ok, if I understand you right it is not possible for property <debug-output>
> as this property is evaluated before FacesContext is instanciated. But then,
> at least the documentation (Developer Guide / Configuring Apache Trinidad)
> should be updated.
>
> <quote>
> Apache Trinidad is configured with an trinidad-config.xml file. If you need
> an trinidad-config.xml file then it must be placed in the WEB-INF directory
> of your web application.
> This file has a very simple XML structure that relies on the JSF expression
> language (EL) for flexibility.
> **** Each configurable property can be defined either inline with a static,
> constant value, or with a JSF EL expression **** that is re-evaluated on
> each request.
> </quote>
>
> As you could see (marked with ****) each property should accept
> EL-expressions.
> Also the code implies that EL-binding is supported:
>   if (key.getSupportsBinding())
>   {
>     ... // EL-Evaluation, only if binding is supported.
>   }
>
> Thanks for your reply.
>
> Kind regards
>
>   Harald
>
>
> **************************************
> Harald Kuhn
> AirPlus International
> Business Information Services
> Phone:         +49 (0) 61 02 204-821
> Fax:   +49 (0) 61 02 204-139
> E-Mail:         [EMAIL PROTECTED]
> Internet:  www.airplus.com
> **************************************
>
>
>
> Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263
> Neu-Isenburg · Deutschland · Geschäftsführer: Patrick W. Diemer (Vorsitz),
> Klaus Busch · Vorsitzender des Aufsichtsrates: Stephan Gemkow ·
> Handelsregister: Amtsgericht Offenbach/Main, HRB 8119
>
>
>
> -----Original Message-----
> From: Martin Marinschek [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 30, 2008 11:58 AM
> To: MyFaces Discussion
> Subject: Re: [Trinidad] Configuring <debug-output> in trinidad-config.xml
> with EL-expression
>
>
> Hi Harald,
>
> well, the FacesContext is only created in the FacesServlet, and
> obviously, in the filter, you are before this creation.
>
> It might be possible to patch the Trinidad-Filter to create a
> FacesContext and release it to properly evaluate these properties.
> Maybe the Trinidad-Filter could also be prompted to create the
> RequestContext later on in the lifecycle.
>
> regards,
>
> Martin
>
> On 1/28/08, Kuhn, Harald <[EMAIL PROTECTED]> wrote:
> > Hi to all,
> >
> > in order to have all debug-relevant settings in one place (web.xml) I
> tried
> > to set <debug-output> via EL.
> > Unfortunately this doesn't work.
> >
> > I always get a NPE on the 1 request (login page) to my webapp.
> > Should this scenario be possible? Or, am I doing something wrong?
> >
> > Thanks for your help.
> >
> > Harald
> >
> > web.xml:
> >   <context-param>
> >     <param-name>TRINIDAD_DEBUG_OUTPUT</param-name>
> >     <param-value>true</param-value>
> >   </context-param>
> >
> > trinidad-config.xml:
> >   <debug-output>#{initParam.TRINIDAD_DEBUG_OUTPUT}</debug-output>
> >
> > Stack-Trace:
> > 2008-01-28 11:43:16,687   ERROR
> >
> org.apache.catalina.core.ContainerBase.[Catalina].[xp-lmazf9p.lasg].[/aim].[faces]:
> > Servlet.service() for servlet faces threw exception
> > java.lang.NullPointerException
> >     at
> >
> org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68)
> >     at
> >
> org.apache.myfaces.trinidadinternal.config.ConfigParser.parseConfigFile(ConfigParser.java:138)
> >     at
> >
> org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl._getBean(RequestContextFactoryImpl.java:71)
> >     at
> >
> org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl.createContext(RequestContextFactoryImpl.java:56)
> >     at
> >
> org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._attachRequestContext(GlobalConfiguratorImpl.java:422)
> >     at
> >
> org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:202)
> >     at
> >
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:126)
> >     at
> >
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> >     at com.airplus.aim.webapp.filter.AIMFilter.doFilter(AIMFilter.java:135)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> >     at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> >     at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> >     at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> >     at
> >
> org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:209)
> >     at
> >
> org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
> >     at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> >     at
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
> >     at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >     at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> >     at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> >     at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> >     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> >     at java.lang.Thread.run(Unknown Source)
> > 2008-01-28 11:43:17,187   INFO
> > org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl: Apache
> > Trinidad is running with time-stamp checking enabled. This should not be
> > used in a production environment. See the
> > org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in
> > WEB-INF/web.xml
> > 2008-01-28 11:43:17,609   ERROR javax.faces.webapp._ErrorPageWriter: An
> > exception occurred
> > java.lang.NullPointerException
> >     at
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext.<init>(CoreRenderingContext.java:77)
> >     at
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit.encodeBegin(CoreRenderKit.java:479)
> >     at
> >
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:166)
> >     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:152)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> >     at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> >     at
> >
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
> >     at
> >
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:447)
> >     at
> >
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
> >     at
> >
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
> >     at
> >
> org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)
> >     at
> >
> org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:271)
> >     at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
> >     at
> >
> org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:209)
> >     at
> >
> org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
> >     at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> >     at
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
> >     at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >     at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> >     at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> >     at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> >     at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> >     at java.lang.Thread.run(Unknown Source)
> >
> > Additional debugging reveilled that FacesContext is null while evaluating
> > the EL-expression.
> > The NPE occurs at
> > org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(PropertyKey
> key)
> >   final public Object getProperty(PropertyKey key)
> >   {
> >     Object o = getLocalProperty(key);
> >     if (o != null)
> >       return o;
> >
> >     // Look for a binding if and only if the key supports bindings
> >     if (key.getSupportsBinding())
> >     {
> >       ValueExpression expression = getValueExpression(key);
> >       if (expression != null)
> >       {
> >         FacesContext context = FacesContext.getCurrentInstance(); //
> context
> > is null here !!!
> >         return expression.getValue(context.getELContext());
> >       }
> >     }
> >
> >     return null;
> >   }
> >
> >
> > Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263
> > Neu-Isenburg · Deutschland · Geschäftsführer: Patrick W. Diemer (Vorsitz),
> > Klaus Busch · Vorsitzender des Aufsichtsrates: Stephan Gemkow ·
> > Handelsregister: Amtsgericht Offenbach/Main, HRB 8119
> >
> >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to