Как исправить исключение нулевого указателя для FacesContext в ORACLE-ADF - PullRequest
0 голосов
/ 07 мая 2019

Я использую эту библиотеку https://github.com/marksh222/universalTaskFlow/blob/master/Rcore/Global/src/com/rcore/global/jsf/JSFUtils.java для моего резервного компонента, который определен в моем потоке задач с областью видимости, и наша версия JDev - 12c, и мы продолжаем получать случайное исключение нулевого указателя после ADF Сам вызывая некоторые функции в моей библиотеке, я поместил несколько SOP (System.out.println), чтобы отследить исключение нулевого указателя, и получил следующую информацию: 1- ADF вызывает эту функцию:

public String getCrudMode(){
    System.out.println("*** CoreCrud *** 4");
    String crudMode=(String) JsfUtils.getExpressionValue(CRUD_MODE);
    if (crudMode==null) {crudMode=MODE_VIEW;}
    return crudMode;
}

который должен вызывать эту функцию:

public static Object getExpressionValue(String jsfExpression) {
    System.out.println("*** devt.core.utils.JsfUtils *** 11");
    // when specifying EL expression in managed bean as "literal" value
    // so t can be evaluated later, the # is replaced with $, quite strange
    if (jsfExpression == null) {
        return jsfExpression;
    }
    if (jsfExpression.startsWith("${")) {
        jsfExpression = "#{" + jsfExpression.substring(2);
    }
    if (!jsfExpression.startsWith("#{")) {
        if (jsfExpression.equalsIgnoreCase("true")) {
            return Boolean.TRUE;
        } else if (jsfExpression.equalsIgnoreCase("false")) {
            return Boolean.FALSE;
        }
        // there can be literal text preceding the expression...
        else if (jsfExpression.indexOf("#{") < 0) {
            return jsfExpression;
        }
    }
    ValueExpression ve = getApplication().getExpressionFactory().createValueExpression(getFacesContext().getELContext(), jsfExpression, Object.class);
    return ve.getValue(getFacesContext().getELContext());
}

Как вы можете видеть в журнале ниже, последнее сообщение, которое я получил от моего регистратора, это <<strong>* CoreCrud * 4> вот полный журнал ошибок

####<May 7, 2019 9:10:06,677 AM EEST> <Notice> <Stdout> <WebHyperV> <AdminServer> <[ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default (self-tuning)'> <WDAHER> <> <12673e39-1fb9-4cd4-bc4f-f2d1a6a37b75-000003f0> <1557209406677> <[severity-value: 32] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <*** CoreCrud *** 4> 
####<May 7, 2019 9:10:06,677 AM EEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <WebHyperV> <AdminServer> <[ACTIVE] ExecuteThread: '40' for queue: 'weblogic.kernel.Default (self-tuning)'> <WDAHER> <> <12673e39-1fb9-4cd4-bc4f-f2d1a6a37b75-000003f0> <1557209406677> <[severity-value: 16] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <ADF_FACES-00009> <Error processing viewId: /providers/ProviderByIdView URI: /WEB-INF/com/ba/network/fragments/ProviderByIdView.jsff actual-URI: /WEB-INF/com/ba/network/fragments/ProviderByIdView.jsff.
java.lang.NullPointerException
                at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:1513)
                at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:123)
                at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:152)
                at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:932)
                at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:563)
                at org.apache.myfaces.trinidad.component.UIXTable.setRowKey(UIXTable.java:794)
                at oracle.adfinternal.view.faces.renderkit.rich.TableRendererUtils._processStampedChildrenForActiveRow(TableRendererUtils.java:3056)
                at oracle.adfinternal.view.faces.renderkit.rich.TableRendererUtils.processFacetsAndChildrenForClickToEdit(TableRendererUtils.java:1678)
                at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.processFacetsAndChildrenForClickToEdit(TableRenderer.java:354)
                at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.decodeChildren(TableRenderer.java:195)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1513)
                at org.apache.myfaces.trinidad.component.UIXCollection.processDecodes(UIXCollection.java:250)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$001(ContextSwitchingComponent.java:42)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$2.run(ContextSwitchingComponent.java:186)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processDecodes(ContextSwitchingComponent.java:189)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$001(ContextSwitchingComponent.java:42)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$2.run(ContextSwitchingComponent.java:186)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processDecodes(ContextSwitchingComponent.java:189)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$001(ContextSwitchingComponent.java:42)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$2.run(ContextSwitchingComponent.java:186)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processDecodes(ContextSwitchingComponent.java:189)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.access$001(ContextSwitchingComponent.java:42)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$2.run(ContextSwitchingComponent.java:186)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)
                at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.processDecodes(ContextSwitchingComponent.java:189)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1531)
                at oracle.adf.view.rich.component.fragment.UIXRegion.decodeChildrenImpl(UIXRegion.java:496)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1517)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:1277)
                at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ApplyRequestValuesCallback.invokeContextCallback(LifecycleImpl.java:1673)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:2115)
                at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:447)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:2070)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:2200)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:2070)
                at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:2200)
                at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1503)
                at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:714)
                at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executeApplyValidateOrUpdate(LifecycleImpl.java:635)
                at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:370)
                at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:227)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:650)
                at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
                at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
                at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
                at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
                at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:207)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
                at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:529)
                at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
                at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:529)
                at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:354)
                at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:232)
                at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:169)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at oracle.security.jps.ee.http.JpsAbsFilter$3.run(JpsAbsFilter.java:172)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
                at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:650)
                at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:110)
                at oracle.security.jps.ee.http.JpsAbsFilter.doFilterInternal(JpsAbsFilter.java:273)
                at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:147)
                at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:94)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:248)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
                at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
                at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
                at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
                at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
                at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
                at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
                at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
                at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
                at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
                at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
                at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
                at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
                at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
                at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
                at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
                at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
                at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
                at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
                at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
>
...