myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "simon.kitching@chello.at" <simon.kitch...@chello.at>
Subject Re: FacesContext.getCurrentInstance() provoking StackTraceException on initialization
Date Wed, 27 Feb 2008 13:57:33 GMT
Hi Bruno,

Bruno Aranda schrieb:
> Hi,
>
> I have a webapp with the combination
>
> myfaces core 1.2.3-SNAPSHOT
> trinidad 1.2.7-SNAPSHOT
> orchestra-core 1.1-SNAPSHOT
> and others (Facelets, Spring...)
>
> This used to work a weeks ago, but today I was trying to start it
> again and on initialization this exception happens:
>
> 2008-02-27 13:23:37,991 [btpool0-1] DEBUG (JsfFrameworkAdapter,57) -
> Beginning request
> 2008-02-27 13:23:37,992 [btpool0-1] DEBUG
> (OrchestraFacesContextFactory$1,114) - Running inithandler of type
> java.util.LinkedList$ListItr
> 2008-02-27 13:23:37,997 [btpool0-1] DEBUG
> (OrchestraFacesContextFactory$1,114) - Running inithandler of type
> java.util.LinkedList$ListItr
> 2008-02-27 13:23:38,365 [btpool0-1] DEBUG
> (OrchestraFacesContextFactory$1,129) - Running release
> 2008-02-27 13:23:38,368 [btpool0-1] DEBUG (JsfFrameworkAdapter,69) -
> Ending request
> 2008-02-27 13:23:38.260::WARN:  Error for
> /intact/intact-search-webapp/search.xhtml
> java.lang.StackOverflowError
>     at
> javax.faces.context.FacesContext.getCurrentInstance(FacesContext.java:98)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:35)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>     at javax.faces.context.FacesContext.getELContext(FacesContext.java:40)
>     at
> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.getELContext(FacesContextFactoryImpl.java:238)
>
> Tried to switch Trinidad and myfaces to stable or previous versions to
> no avail, so I guess this is related to the FacesContext creation by
> Orchestra. Any recent development that might cause this? Any
> configuration I have to add?
>
> I am a bit rusty with orchestra lately, so hopefully I can be up to
> date for the JSFDays! :)

I don't *think* this is Orchestra.

That last log message is ok, it just means that orchestra is cleaning up:
    public void endRequest()
    {
        log.debug("Ending request");
        FrameworkAdapter.setCurrentInstance(null);
    }

Orchestra does implement its own FacesContext object, and some of the
related code has changed in the last few weeks. However that object
should never be returned from
  FacesContext.getCurrentInstance()

OrchestraFacesContextFactory calls:
        log.debug("getFacesContext: creating custom instance");
        return new FacesContextWrapper(facesContext, false)
        {
         ...
       }
with the "false" parameter here meaning that the object is *not*
registered as the default FacesContext object; calls to
FacesContext.getCurrentInstance still return the original.

With that stack trace there isn't much info to go on. The obvious
culprit is Trinidad, but if reverting to an earlier release does not
solve the issue then I don't know what might be going on.

BTW, I look forward to meeting you at JSFDays!

Cheers,
Simon


Mime
View raw message