myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: [Trinidad] Configuring <debug-output> in trinidad-config.xml with EL-expression
Date Wed, 30 Jan 2008 19:41:57 GMT
Hi,

On Jan 30, 2008 11:57 AM, Martin Marinschek <martin.marinschek@gmail.com> wrote:
> 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.

I don't think, that this is a good idea.


I think the debug-output is designed to be used static, instead of EL
(I can be wrong, but searching a little bit with google, I found only
"examples" that use it static. (due to security?))

At the same time in the code, the GlobalConfiguratorImpl also check if
there is a custom "UploadProcessor", which is usually defined static
(full qualified class-name).
Since providing the class name via EL doesn't make sense (to me), I
now think (I can be wrong), that debug-output is only settable via
static plain text, instead of EL.

> 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 <HKuhn@airplus.com> 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
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Mime
View raw message