Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3473

NoSuchMethodException thrown by oracle.jbo.uicli.mom.CpxUtils.getCpxMainMapFromADFContext() on first request

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: bridge-ext-5.0.0, bridge-ext-5.0.1, bridge-ext-5.0.2, bridge-ext-5.0.3, bridge-ext-5.0.4
    • Fix Version/s: bridge-ext-5.0.5
    • Labels:
      None

      Description

      Problem Background

      When deploying an ADF Faces portlet to Liferay Portal with all the necessary ADF Essentials dependencies, the oracle.jbo.uicli.mom.CpxUtils.getCpxMainMapFromADFContext() method calls getDeclaredMethod("getResource", String.class) on the com.liferay.faces.bridge.ext.filter.internal.BridgePortletContextLiferayImpl class. Even though this class extends PortletContextWrapper (which implements PortletContext), a NoSuchMethodException is thrown because getResource(String) is not a "declared" method. If the CpxUtils class called getMethod instead of getDeclaredMethods then all would be well. But since it doesn't, it is necessary to add the getResource(String) method to the BridgePortletContextLiferayImpl class.

      Steps to Reproduce

      1. Deploy an ADF Faces portlet to Liferay Portal

      2. Add the portlet to a portal page

      Expected Results

      A NoSuchMethodException is *not* logged to the console.

      Actual Results

      The following exception appears in the console log:

      2019-08-07 17:03:41.040 WARN  [http-nio-8080-exec-9][CpxUtils$Visitor:221] j2eeCtx=com.liferay.faces.bridge.ext.filter.internal.BridgePortletContextLiferayImpl
      java.lang.NoSuchMethodException: com.liferay.faces.bridge.ext.filter.internal.BridgePortletContextLiferayImpl.getResource(java.lang.String)
      	at java.lang.Class.getDeclaredMethod(Class.java:2130)
      	at oracle.jbo.uicli.mom.CpxUtils$Visitor.getCpxMainMapFromADFContext(CpxUtils.java:413)
      	at oracle.jbo.uicli.mom.CpxUtils$Visitor.getCpxList(CpxUtils.java:181)
      	at oracle.jbo.uicli.mom.CpxUtils.getCpxListFromMetadata(CpxUtils.java:493)
      	at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:915)
      	at oracle.adf.model.BindingContext.initialize(BindingContext.java:472)
      	at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:270)
      	at com.liferay.faces.adf.internal.context.ExternalContextLiferayADFInnerImpl.<init>(ExternalContextLiferayADFInnerImpl.java:62)
      	at com.liferay.faces.adf.internal.context.ExternalContextFactoryLiferayADFImpl.getExternalContext(ExternalContextFactoryLiferayADFImpl.java:39)
      	at com.sun.faces.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:99)
      	at com.liferay.faces.bridge.context.internal.FacesContextFactoryCompatImpl.getFacesContext(FacesContextFactoryCompatImpl.java:39)
      	at com.liferay.faces.bridge.context.internal.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:49)
      	at oracle.adfinternal.controller.application.model.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:70)
      	at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:62)
      	at oracle.adfinternal.view.faces.context.RichFacesContextFactory.getFacesContext(RichFacesContextFactory.java:47)
      	at com.liferay.faces.adf.internal.context.FacesContextFactoryLiferayADFImpl.getFacesContext(FacesContextFactoryLiferayADFImpl.java:38)
      	at com.sun.faces.context.InjectionFacesContextFactory.getFacesContext(InjectionFacesContextFactory.java:123)
      	at com.liferay.faces.bridge.internal.BridgePhaseBaseImpl.getFacesContext(BridgePhaseBaseImpl.java:134)
      	at com.liferay.faces.bridge.internal.BridgePhaseBaseImpl.init(BridgePhaseBaseImpl.java:212)
      	at com.liferay.faces.bridge.internal.BridgePhaseHeaderRenderCommon.executeRender(BridgePhaseHeaderRenderCommon.java:89)
      	at com.liferay.faces.bridge.internal.BridgePhaseRenderCompatImpl.execute(BridgePhaseRenderCompatImpl.java:57)
      	at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:57)
      	at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:157)
      	at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:753)
      	at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:397)
      	at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:669)
      	at javax.portlet.GenericPortlet.render(GenericPortlet.java:291)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      [...]
      

        Attachments

          Activity

            People

            • Assignee:
              neil.griffin Neil Griffin
              Reporter:
              neil.griffin Neil Griffin
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                bridge-ext-5.0.5