Skip to Main Content

Problem if using "rollback" after using my custom validator invoked Two Validator method "controlede

SouhaielNov 30 2019 — edited Dec 2 2019

Oracle ADF Version 12.2.1.3.0 validator="#{DemEchandTcrechmax.controledemcredittests}"                                                         validator="#{DemEchandTcrechmax.demcredittestscontroles}"                                                                                 javaBean     validator="#{DemEchandTcrechmax.controledemcredittests}" public void controledemcredittests(FacesContext facesContext, UIComponent uIComponent, Object object) {         BindingContext bctx = BindingContext.getCurrent();         BindingContainer bindings = bctx.getCurrentBindingsEntry();         String  oldValue = object.toString();                 if(object != null && oldValue != null) {                         OperationBinding operationBinding = bindings.getOperationBinding("controle_dem_credit");                         operationBinding.getParamsMap().put("p_mat", getMatgzvalue().getValue().toString());             operationBinding.getParamsMap().put("p_type", oldValue);           operationBinding.execute();             String methodReturnValue = (String) operationBinding.getResult();                       if (!methodReturnValue.equals("0") ) {               throw new ValidatorException(new FacesMessage("Decision Not in Compliance with Management Rules",methodReturnValue.toString()));             }                                                 }     } validator="#{DemEchandTcrechmax.demcredittestscontroles}"     public void demcredittestscontroles(FacesContext facesContext, UIComponent uIComponent, Object objects) {         BindingContext bctx = BindingContext.getCurrent();         BindingContainer bindings = bctx.getCurrentBindingsEntry();         String oldValuez =  objects.toString();                 if(objects != null && oldValuez != null && getDemechsetvalue().getValue() != null && getMatgzvalue().getValue().toString() != null && this.getTcrtypevalues().getValue().toString() != null  ) {           OperationBinding operationBindings = bindings.getOperationBinding("get_nbre_ech");           operationBindings.getParamsMap().put("p_mat", getMatgzvalue().getValue().toString());           operationBindings.getParamsMap().put("p_type", this.getTcrtypevalues().getValue().toString());                     operationBindings.execute();           Object methodReturnValues = operationBindings.getResult();           String sentence  = methodReturnValues.toString();           System.out.println("1..............................2");           if (!methodReturnValues.toString().equals("0")) {                                                       if ( a > b  ){                                         throw new ValidatorException(new FacesMessage("Décision Non Conforme Aux Régles De Gestion",msg));  }    }                               }     } Erreur javax.el.ELException: //C:/Users/SIGA/AppData/Roaming/JDeveloper/system12.2.1.3.42.170820.0914/o.j2ee/drs/SocialAdminApplication/ViewControllerWebApp.war/tn/siga/socialadminapp/view/fragment /RequestCredits/RequestCreditsFragment.jsff @ 76,56 validator = "# {DemEchandTcrechmax.demcredittestscontroles}": java.lang.NullPointerException at com.sun.faces.flets.el.TagMethodExpression.invoke (TagMethodExpression.java:111) at javax.faces.validator.MethodExpressionValidator.validate (MethodExpressionValidator.java:106) at org.apache.myfaces.trinidad.component.UIXEditableValue.validateValue (UIXEditableValue.java:464) at org.apache.myfaces.trinidad.component.UIXEditableValue.validate (UIXEditableValue.java:215) at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate (UIXEditableValue.java:763) at org.apache.myfaces.trinidad.component.UIXEditableValue.processDecodes (UIXEditableValue.java:302) 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 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) Caused by: java.lang.NullPointerException at tn.siga.socialadminapp.bean.DemEchandTcrechmax.demcredittestscontroles (DemEchandTcrechmax.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at com.sun.el.util.ReflectionUtil.invokeMethod (ReflectionUtil.java:181) at com.sun.el.parser.AstValue.invoke (AstValue.java:289) at com.sun.el.MethodExpressionImpl.invoke (MethodExpressionImpl.java:304) at com.sun.faces.flets.el.TagMethodExpression.invoke (TagMethodExpression.java:105) ... 101 more

Comments
Post Details
Added on Nov 30 2019
14 comments
135 views