2

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.

User404
  • 2,152
  • 2
  • 27
  • 35
Abdul
  • 1,130
  • 4
  • 29
  • 65

2 Answers2

1

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

User404
  • 2,152
  • 2
  • 27
  • 35
  • @Abdul you must hate Tomcat so much by now :) – Florin Marcus May 05 '15 at 12:08
  • Hmm. But our client wants to deploy this application onto Tomcat. Can you please suggest any other server(That should be free)? – Abdul May 06 '15 at 04:37
  • You just have to get your libraries in order (if your problem is the same as the one described in the OTN topic) – User404 May 06 '15 at 05:38
  • I have libraries at only one place. That this in Tomcat/lib foldre. My war file doesn't contain libraries. – Abdul May 06 '15 at 05:46
  • You can try the free GlassFish 3.1 - that's the server that ADF Essentials is actually certified on. – Shay Shmeltzer May 06 '15 at 19:02
  • Okay . Thanks for your time. Let me try and come back. Can you give me some links to know how to configure Glassfish. – Abdul May 07 '15 at 11:12
  • http://www.oracle.com/technetwork/developer-tools/adf/overview/adfessentialskc-1870652.html – User404 May 07 '15 at 11:13
  • Thanks a lot for your hlep. I really thank you very much. I have successfully installed glassfish3.1 and configured it for ADF using https://blogs.oracle.com/shay/entry/deploying_oracle_adf_applications_to. Now am able to run two(more than one) application on the same server Glassfish3.1 without any error. I have ran just 2 simple test applications. It is successfully running. Let me try with actual applications. Thanks a lot for your help. – Abdul May 08 '15 at 05:38
1

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.

Jan
  • 21
  • 1
  • 5