Forum Stats

  • 3,872,069 Users
  • 2,266,376 Discussions
  • 7,911,043 Comments

Discussions

application deploys fine but returns java.lang.ClassCastException

Marc Arbour
Marc Arbour Member Posts: 37
edited Aug 27, 2014 11:10AM in JDeveloper and ADF

Hi.

I am using jdev12.1.3 and adfessentials 12.1.3 on a running glassfish3.1.2 server.

I am deploying rich client faces demo as well as other demo applications that work fine. But when I deploy my own application I get this 500 error message in the browser:

java.lang.ClassCastException: oracle.jbo.mom.DefinitionContextAgeable cannot be cast to oracle.jbo.mom.DefinitionContext

Here is the stack trace from the glassfish logs:

[#|2014-08-21T09:17:32.057-0400|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=90;_ThreadName=Thread-2;|WEB0671: Loading application [application1#viewcontroller.war] at [paramApplication-ViewController-context-root]|#]

[#|2014-08-21T09:17:32.318-0400|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=90;_ThreadName=Thread-2;|application1 was successfully deployed in 65 477 milliseconds.|#]

[#|2014-08-21T09:17:50.572-0400|INFO|glassfish3.1.2|oracle.adfinternal.controller.state.ControllerState|_ThreadID=48;_ThreadName=Thread-2;|ADFc: Limiting the number of RootViewPorts to 20|#]

[#|2014-08-21T09:17:50.577-0400|WARNING|glassfish3.1.2|org.apache.catalina.connector.Request|_ThreadID=48;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context /paramApplication-ViewController-context-root, because request parameters have already been read, or ServletRequest.getReader() has already been called|#]

[#|2014-08-21T09:17:50.817-0400|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=48;_ThreadName=Thread-2;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
java.lang.ClassCastException: oracle.jbo.mom.DefinitionContextAgeable cannot be cast to oracle.jbo.mom.DefinitionContext
    at oracle.jbo.mom.DefinitionManager.getCurrentDefinitionContext(DefinitionManager.java:3594)
    at oracle.jbo.mom.DefinitionManager.findLoadedObject(DefinitionManager.java:3412)
    at oracle.jbo.mom.DefinitionManager.getObjectManagerDef(DefinitionManager.java:425)
    at oracle.jbo.uicli.mom.JUMetaObjectManager.isStatelessApplication(JUMetaObjectManager.java:462)
    at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:149)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:190)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:744)
|#]

The strange thing is that I get this error when calling this url:

http://is-marca-v:9090/paramApplication-ViewController-context-root/faces/parametres.jsf

When I access this one

http://is-marca-v:9090/paramApplication-ViewController-context-root/parametres.jsf

I get a white page with the possibility of showing the source to be my exact page's XML

Has anyone seen this? Any pointers will help.

Best regards.

Marc

Tagged:
Alejandro Tovar Lanz

Best Answer

  • Marc Arbour
    Marc Arbour Member Posts: 37

    I found the solution

    in web.xml, replace lines

    <filter-name>ADFLibraryFilter</filter-name>
    <filter-class>oracle.adf.library.webapp.LibraryFilter</filter-class>
    

    by

    <filter-name>ServletADFFilter</filter-name>
    <filter-class>oracle.adf.share.http.ServletADFFilter</filter-class>
    

    and line

    <filter-name>adfBindings</filter-name>
    

    by

    <filter-name>ServletADFFilter</filter-name>
    

    Have a nice day

    Marc

    Alejandro Tovar Lanz

Answers

This discussion has been closed.