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 Tue, 04 Mar 2008 11:19:42 GMT
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

Ok, should now be fixed in Orchestra trunk. Bruno, could you please give
that a try?

Orchestra core still compiles using JSF1.1, but now has an extra
dependency on javax.el, so that the getELContext method can be
implemented. Actually, with the Sun JVM (at least) the dependency can be
left out at runtime, but that's not guaranteed according to the JVM
specification AFAIK.

By the way, you said in another email that if you "uncomment the code it
works again". Presumably you meant uncomment the code then change the
pom to compile against JSF1.2?

BTW, this issue is really a bug in myfaces-core 1.2.2, which does not
provide a correct default implementation of FacesContext.getELContext().
Delegating to getCurrentInstance is not the right thing to do. I have a
patch for that too, but as we want Orchestra to run on myfaces 1.2.2
I've implemented a workaround in Orchestra.

And the issue is only triggered when combining orchestra with trinidad.
Orchestra not implementing the getELContext method (and therefore
getting the buggy implementation from myfaces-core) is normally not a
problem because it does *not* install its custom FacesContext instance
as "the current instance" so that method is never called. However
Trinidad then has its own FacesContextFactory that creates an object
that *does* get registered as "the current instance" and then delegates
to the orchestra instance. All very twisty...

Regards,
Simon


Mime
View raw message