This discussion is archived
12 Replies Latest reply: May 10, 2012 9:35 AM by 547185 RSS

Entity level validation gets triggered but message not shown

547185 Newbie
Currently Being Moderated
Hi, I have an entity level declarative validation for simple start/end date validation. At run time, when the end date is less than start date, the expected fnd error message never shows up, instead, the popup error shows "JBO-27023: Failed to validate all rows in a transaction". I tried method validator in EOImpl, it went through fine in debug mode but still I got the same error without the message. The only thing I noticed strange is all getter/setter for attributes are not present in EOImp. So for testing method validator, I had to create those for start/end dates fields.

Appreciate any inputs

Thanks
Tony
  • 1. Re: Entity level validation gets triggered but message not shown
    Sudipto Desmukh Expert
    Currently Being Moderated
    Try using a simple compare validator @ Entity Level for StartDate >= EndDate (Entity Attribute or Expression)
    http://one-size-doesnt-fit-all.blogspot.in/2007/08/jdev-11g-new-features-adf-bc-entity.html
  • 2. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    Forget to mention, we use declarative validator and because it's not showing the error message, in my debug test, I also tried method validator and it's gving same result. below is the code for declarative validator:

    <validation:CompareValidationBean
    Name="InteractionEO_Rule_4"
    ResId="ColAttr.EndTime.InteractionEndTime.ZMMINTERINTERACTIONS.INTERACTIONENDDATE"
    ResBundleId="oracle.apps.crmCommon.interactions.resource.AppCmmnCompInteractionsAttrBundle"
    OnAttribute="InteractionStartDate"
    OperandType="ATTR"
    Inverse="false"
    CompareType="LESSTHANEQUALTO"
    CompareValue="InteractionEndDate">
    <validation:OnAttributes>
    <validation:Item
    Value="InteractionStartDate"/>
    <validation:Item
    Value="InteractionEndDate"/>
    </validation:OnAttributes>
    <validation:OnCondition>
    <![CDATA[this.InteractionEndDate != null]]>
    </validation:OnCondition>
    </validation:CompareValidationBean>
  • 3. Re: Entity level validation gets triggered but message not shown
    Sudipto Desmukh Expert
    Currently Being Moderated
    Which Jdev version do you use .. always mention that at the start of the post.
    Also can you post the stack trace from your console when you get "Failed to validate all rows in the Txn ...."
  • 4. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    Thanks, the jdev version is JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1 and below is the trace:

    javax.el.ELException: oracle.jbo.TxnValException: JBO-27023: Failed to validate all rows in a transaction.
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:173)
         at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:162)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1035)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:552)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:148)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
         at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:43)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:241)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:169)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1049)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:413)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:197)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.bi.presentation.runtime.binding.BIRegionBindingFilter.doFilter(BIRegionBindingFilter.java:40)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.view.page.editor.webapp.WebCenterComposerFilter.doFilter(WebCenterComposerFilter.java:117)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:62)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:128)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.apps.customerCenter.infrastructure360.ui.bean.customizationLayer.doFilter(customizationLayer.java:46)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.apps.fnd.applcore.common.ApplSessionFilter.doFilter(ApplSessionFilter.java:696)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         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:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         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:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.jbo.TxnValException: JBO-27023: Failed to validate all rows in a transaction.
         at oracle.jbo.server.DBTransactionImpl.validate(DBTransactionImpl.java:4599)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2046)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2389)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)
         at oracle.adf.model.dcframe.LocalTransactionHandler.commit(LocalTransactionHandler.java:139)
         at oracle.adf.model.dcframe.DataControlFrameImpl.commit(DataControlFrameImpl.java:1289)
         at oracle.apps.customerCenter.infrastructure360.publicUi.bean.ZcmHandleTransNavBean.commit(ZcmHandleTransNavBean.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         ... 85 more
  • 5. Re: Entity level validation gets triggered but message not shown
    SantoshVaza Expert
    Currently Being Moderated
    you are having entity validation and you are trying to commit where entity validation is getting fired, on commit and giving you as expected error,,
    try this workaround, you can use this in all types of usecases..
    . create a client interface in your vo with following code
    public void forcefullyValidateCurrentRow(){
    Row row = getCurrentRow();
    //entity validator wont fire untill and unless you make row dirty dirty..
    row.setAttribute("pkAttr",row.getAttribute("pkAttr"));
    //tell entity to fire all entity level validators
    row.validate();
    }
    . now add this interface method nd commit to your pageDef as operation
    . on the button click execute both one after another..
    DCBindingContainer dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding onV = dc.getOperationBinding("forcefullyValidateCurrentRow");
    OperationBinding onC = dc.getOperationBinding("Commit");
    onV.execute();
    if(onV.getErrors().isEmpty())
    onC.execute();
  • 6. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    Thanks, do you mean to add the interface in xxxVOImpl.java? I thought only interface added to xxxAMImpl.java can be exposed on pageDef, can you please clarify?

    thanks so much.

    Tony
  • 7. Re: Entity level validation gets triggered but message not shown
    SantoshVaza Expert
    Currently Being Moderated
    Yes you can..

    follow came step as you follow for am..
    add method action to your pageDef the same way as you do for am.. but the only difference is that you may need to locate it under your viewobject hiearchy..

    some samples based on viewobject client interface
    http://mjabr.wordpress.com/2011/05/20/perform-deleteundo-delete-without-using-rollback/
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/62-autosuggestbehavior-177811.pdf

    Regards,
  • 8. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    I tried to add an interface in AMImpl as follows:

    public void forcefullyValidateCurrentRow(){
    ViewObjectImpl vo = getInteraction();
    Row row = vo.getCurrentRow();
    //entity validator wont fire untill and unless you make row dirty..
    row.setAttribute("InteractionId",row.getAttribute("InteractionId"));
    //tell entity to fire all entity level validators
    row.validate();
    }

    Then added the methodAction in pageDef and in the backing bean added follows in button actionListener:

    ADFUtilsBean.invokeEL("#{bindings.forcefullyValidateCurrentRow.execute}");

    Since commit is handled in task flow I didn't code for it. My test shows the flow goes through the interface and row.validate() gets called, but I still got the same error? Can you please tell me what else needs to be done?

    Thanks
  • 9. Re: Entity level validation gets triggered but message not shown
    SantoshVaza Expert
    Currently Being Moderated
    Hi,

    in button's action method call it like this way..
        public static BindingContext getBindingContext() {
            return BindingContext.getCurrent();
        }
        public static BindingContainer getBindingContainer() {
            return getBindingContext().getCurrentBindingsEntry();
        }
        public static DCBindingContainer getDCBindingContainer() {
            return (DCBindingContainer)getBindingContainer();
        }
        public static OperationBinding getOperationBinding(String operationName) {
            return getDCBindingContainer().getOperationBinding(operationName);
        }
        public String buttonAction(){
           OperationBinding ob = getOperationBinding("forcefullyValidateCurrentRow");
           ob.execute();
           if(ob.getErrors().isEmpty()){
             return "to_commit_controlflow";
           }else{
             return null;
           }
        }
    Here determining whether the error is thrown is important and avoid the control to goto commit action..in tff


    Regards,

    Edited by: Santosh Vaza on May 10, 2012 2:18 PM
  • 10. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    Thanks, I tried this using the code below at the end of button actionlistener:

    DCBindingContainer dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding onV = dc.getOperationBinding("forcefullyValidateCurrentRow");
    //OperationBinding onC = dc.getOperationBinding("Commit");
    onV.execute();
    if(onV.getErrors().isEmpty()) {
    return "to_commit_controlflow";
    }else{
    return null;
    }

    Still got the same error "JBO-27023: Failed to validate all rows in a transaction.". The problem is this error is thrown after calling row.validate() in AMImpl. I don't quite understand the intention of having a return value above. Also I have other code inside button ActionListner method. I'm not sure how the above should be placed, tried at beginning and the end of the button actionListener method, doesn't make a difference. If you can give some details it would be very helpful. I will get back to you tomorrow morning.

    Thank you.
  • 11. Re: Entity level validation gets triggered but message not shown
    SantoshVaza Expert
    Currently Being Moderated
    Hi,

    1. try to test your method in BC4J Tester by running your am and invoking your client interface.
    2. > I don't quite understand the intention of having a return value above
    How do you commit..?
    >Also I have other code inside button ActionListner method
    >. I'm not sure how the above should be placed, tried at beginning and the end of the button actionListener method, doesn't make a difference
    place your code in buttons action.. and the returntype will be your control-flow-case from view to commit action in tf(if used in tf).. else call commit action prog in action method.


    Regards,
  • 12. Re: Entity level validation gets triggered but message not shown
    547185 Newbie
    Currently Being Moderated
    Hi,

    I'm not sure too about having a return value in your example. In jsff file, the button is defined as follows:

    <af:commandButton actionListener="#{backingBeanScope.InteractionSummaryBean.refreshTableOnOK}"
    id="commandButton1"
    textAndAccessKey="#{backingBeanScope.InteractionSummaryBean.isolatedTransaction ? applcoreBundle.SAVE_AND_CLOSE : applcoreBundle.OK}"
    action="commit" partialSubmit="true"/>

    In parent task flow, they will have some method for action=commit to handle commit, so that code is not in button action method refreshTableOnOK.

    The problem as I described earlier is when I have a end date less than start date in Ui and try to save it using the button, in AMImpl, the same exception is thrown once it hits row.validate();

    Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points