Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-6577

KRAD Infrastructure not handling null OJB proxies?

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-b6
    • Fix Version/s: 2.0.0-rc2, 2.0
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-2674UiDocumentService OJB proxy handling
      KULRICE-2572proxy="true" on EntityPrivacyPreferences causes OJB errors
      KULRICE-7298Selenium Test Infrastructure
      KULRICE-9413Implement portable data object proxy detection and unwrapping
      KULRICE-9102Determine how best to handle linking to DocumentHeader using JPA as was done with OJB
      KULRICE-9365Smoke Test proxy JVM param
      KULRICE-9548Null pointers in KRAD 2.3 trunk
      KULRICE-6853Currency Format exception on Null values
      KULRICE-5135fix ojb proxies for classes with protected setters
      KULRICE-1777Prevent exception when parameter value is null in UrlFactory.parameterizeUrl
    • Rice Module:
      KRAD
    • Application Requirement:
      KFS
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      I don't know if this is a problem or not yet. But, after the conversion, I am getting this error in places. The SalesTax object would be null as there is not usually a record in the database for this. But, it seems that, in the DD validation, the code may not be checking for the null under the proxy and handling it. I don't know how this was managed before. But something changed with the upgrade. Help?

      Error Message

      Invalid property 'salesTax.chartOfAccountsCode' of bean class [org.kuali.kfs.sys.businessobject.SourceAccountingLine]: Getter for property 'chartOfAccountsCode' threw exception; nested exception is java.lang.reflect.InvocationTargetException
      

      Stacktrace

      org.springframework.beans.InvalidPropertyException: Invalid property 'salesTax.chartOfAccountsCode' of bean class [org.kuali.kfs.sys.businessobject.SourceAccountingLine]: Getter for property 'chartOfAccountsCode' threw exception; nested exception is java.lang.reflect.InvocationTargetException
      	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:845)
      	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721)
      	at org.kuali.rice.krad.datadictionary.validation.DictionaryObjectAttributeValueReader.getValue(DictionaryObjectAttributeValueReader.java:132)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validateObject(DictionaryValidationServiceImpl.java:937)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validate(DictionaryValidationServiceImpl.java:768)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validate(DictionaryValidationServiceImpl.java:161)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validate(DictionaryValidationServiceImpl.java:141)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validate(DictionaryValidationServiceImpl.java:133)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validateBusinessObject(DictionaryValidationServiceImpl.java:359)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validateUpdatabableReferencesRecursively(DictionaryValidationServiceImpl.java:291)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validateDocumentAndUpdatableReferencesRecursively(DictionaryValidationServiceImpl.java:221)
      	at org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl.validateDocumentAndUpdatableReferencesRecursively(DictionaryValidationServiceImpl.java:212)
      	at org.kuali.rice.krad.rules.DocumentRuleBase.processSaveDocument(DocumentRuleBase.java:137)
      	at org.kuali.rice.krad.rules.rule.event.SaveDocumentEvent.invokeRuleMethod(SaveDocumentEvent.java:71)
      	at org.kuali.rice.krad.service.impl.KualiRuleServiceImpl.applyRules(KualiRuleServiceImpl.java:83)
      	at org.kuali.rice.krad.service.impl.KualiRuleServiceImpl.applyRules(KualiRuleServiceImpl.java:79)
      	at org.kuali.rice.krad.document.DocumentBase.validateBusinessRules(DocumentBase.java:483)
      	at org.kuali.rice.krad.service.impl.DocumentServiceImpl.validateAndPersistDocument(DocumentServiceImpl.java:761)
      	at org.kuali.rice.krad.service.impl.DocumentServiceImpl.routeDocument(DocumentServiceImpl.java:189)
      	at org.kuali.kfs.sys.document.AccountingDocumentTestUtils.routeDocument(AccountingDocumentTestUtils.java:368)
      	at org.kuali.kfs.sys.document.AccountingDocumentTestUtils.testRouteDocument(AccountingDocumentTestUtils.java:182)
      	at org.kuali.kfs.fp.document.AuxiliaryVoucherDocumentTest.testRouteDocument(AuxiliaryVoucherDocumentTest.java:104)
      	at org.kuali.kfs.sys.context.KualiTestBase.runBare(KualiTestBase.java:86)
      Caused by: java.lang.reflect.InvocationTargetException
      	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:761)
      Caused by: org.apache.ojb.broker.PersistenceBrokerException: Error invoking method getChartOfAccountsCode
      	at org.apache.ojb.broker.core.proxy.AbstractIndirectionHandler.invoke(AbstractIndirectionHandler.java:367)
      	at org.kuali.kfs.fp.businessobject.SalesTax$$EnhancerByCGLIB$$88c2d5ac.getChartOfAccountsCode(<generated>)
      Caused by: java.lang.NullPointerException
      	at org.apache.ojb.broker.core.proxy.AbstractIndirectionHandler.invoke(AbstractIndirectionHandler.java:357)
      

        Issue Links

          Activity

          Hide
          Jonathan Keller added a comment -

          This was working before the conversion and I am afraid to consider how many places in KFS where we may have null child objects that we expect to work. Is there some reason that the old ObjectUtils.isNull() method can not be used in the test as was the standard before when working with potential OJB proxies?

          Show
          Jonathan Keller added a comment - This was working before the conversion and I am afraid to consider how many places in KFS where we may have null child objects that we expect to work. Is there some reason that the old ObjectUtils.isNull() method can not be used in the test as was the standard before when working with potential OJB proxies?
          Hide
          Erik Meade added a comment -

          Yes, my previous comment (deleted) was incorrect. We are catching a subclass of InvalidPropertyException, looks like this changed in one of the spring upgrades. We'll catch the exception given in the stacktrace and return a null object rather then exploding.

          Show
          Erik Meade added a comment - Yes, my previous comment (deleted) was incorrect. We are catching a subclass of InvalidPropertyException, looks like this changed in one of the spring upgrades. We'll catch the exception given in the stacktrace and return a null object rather then exploding.
          Hide
          Jonathan Keller added a comment -

          Great! Thanks for looking into it.

          Show
          Jonathan Keller added a comment - Great! Thanks for looking into it.
          Hide
          Jessica Coltrin (Inactive) added a comment -

          Closing since these items are now in the release notes.

          Show
          Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.

            People

            • Assignee:
              Erik Meade
              Reporter:
              Jonathan Keller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel