Oracle ADF - Tomcat 6.x - MySql 5.5 - java.lang.Ab

2019-08-06 02:43发布

问题:

We developed a Oracle ADF web app using

  • jDeveloper 11.1.2.4
  • MySql 5.5

and after a lot of google help we deployed our app onto tomcat this post.Oracle ADF onto Tomcat 6.x

In the above post he used Oracle Db. We deployed a test app with Oracle. Its running fine. But our original app has to work with MySql. We have setup our connection configuration as follows. In conf/context.xml

<ResourceLink global="jdbc/webApp" name="jdbc/MySqlCOnDSDS" type="javax.sql.DataSource"/>

conf/server.xml

<Resource name ="jdbc/webApp" auth="Container" 
    type="javax.sql.DataSource" 
    driverClassName="com.mysql.jdbc.Driver" 
    url="jdbc:mysql://localhost:3306/easyrun" 
    username="teja" password="teja" 
    maxActive="20" maxIdle="10" maxWait="10000"/>

when we are trying to run our page(first.jsf) we are getting the following error.

javax.servlet.ServletException: Servlet execution threw an exception
    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)
root cause

java.lang.AbstractMethodError: org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.isClosed()Z
    oracle.jbo.server.QueryCollection.setResultSetState(QueryCollection.java:5624)
    oracle.jbo.server.QueryCollection.hasNextInResultSet(QueryCollection.java:4859)
    oracle.jbo.server.ViewObjectImpl.hasNextForCollection(ViewObjectImpl.java:7306)
    oracle.jbo.server.QueryCollection.hasNext(QueryCollection.java:4768)
    oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1294)
    oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:913)
    oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:7282)
    oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1227)
    oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1413)
    oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1319)
    oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1304)
    oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7211)
    oracle.adf.model.bc4j.DCJboDataControl.executeIteratorBindingIfNeeded(DCJboDataControl.java:1366)
    oracle.adf.model.binding.DCIteratorBinding.executeQueryIfNeeded(DCIteratorBinding.java:2219)
    oracle.jbo.uicli.binding.JUCtrlHierBinding.getRootNodeBinding(JUCtrlHierBinding.java:92)
    oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.addRowKeyChangeListener(FacesCtrlHierBinding.java:616)
    oracle.adfinternal.view.faces.renderkit.rich.TableRendererUtils.registerRowKeyChangeListener(TableRendererUtils.java:2715)
    oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:758)
    oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:617)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
    oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
    oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
    oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
    oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
    oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
    oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1275)
    oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
    org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
    org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677)
    oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
    org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
    org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1035)
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:342)
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:236)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
    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..

Thanks in advance.

回答1:

Tomcat 6 datasource implementation is not upgraded to work with Java 1.6.

You can switch to Apache Datasource implementation by following the steps:

  1. Download and copy commons-dbcp 1.4 to $CATALINA_HOME/lib
  2. Download and copy commons-pool 1.5.5 to $CATALINA_HOME/lib
  3. Change your "Resource" tag to include the following attribute: factory="org.apache.commons.dbcp.BasicDataSourceFactory"