Abdul
Abdul

Reputation: 1208

HTTP Status 500 - oracle.adfinternal.controller.faces.context.StubJSFPageLifecycleContext cannot be cast to

We are developing web applications using Oracle ADF (jdeveloper 11.1.2.4). We need to run these applications on tomcat6.x. We have setup our tomcat6.x environment using the post ADF Essentials on tomcat.

We are able to run only one application on tomcat. Means if we deploy only one application it is successfully running on browser and everything is fine. Whenever we are trying to deploy more than one application no exception is coming on tomcat server console.

But when we are trying to open any page like http://localhost:1234/E/faces/j.jsf it is giving the following error.

HTTP Status 500 - oracle.adfinternal.controller.faces.context.StubJSFPageLifecycleContext cannot be cast to oracle.adf.controller.faces.context.FacesPageLifecycleContext
exception

java.lang.ClassCastException: oracle.adfinternal.controller.faces.context.StubJSFPageLifecycleContext cannot be cast to oracle.adf.controller.faces.context.FacesPageLifecycleContext
    oracle.adfinternal.controller.application.model.UpdateBindingListener.beforePhase(UpdateBindingListener.java:66)
    oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.beforePhase(ADFLifecycleImpl.java:550)
    oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:100)
    oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
    oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$200(ADFPhaseListener.java:23)
    oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:232)
    oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:274)
    oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
    oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:447)
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

Please help us. We have to deploy and successfully run more than one adf application on tomcat 6.x.

Upvotes: 2

Views: 982

Answers (2)

Jan
Jan

Reputation: 41

I'm noting that this exception will/can also appear on Tomcat 9+ as a result of the FacesInitializer (a SCI ServletContainerInitializer) being loaded as part of the Tomcat root loader. This will "confuse" the ADF Faces application, with the result of a ClassCastException.

A possible fix for this is to go into the jsf-impl and comment out the contents of META-INF/services/javax.servlet.ServletContainerInitializer or remove this file in its entirety.

Upvotes: 1

User404
User404

Reputation: 2192

Might be the same issue as posted here: https://community.oracle.com/thread/724037?start=15&tstart=0

In short, the correct answer was:

I cannot say for sure, but this sounds like you have the same library placed in both web application library folder and Tomcat common library directory. Depending of where you place those libraries, they will be loaded by application classloader or the parent Tomcat classloader. In other words, I believe that you have one library loaded by webapplication's lib folder instead of having it loaded into the parent classloader. - Florin

Upvotes: 1

Related Questions