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

Does KRAD/KRAD-DATA support extended attributes on documents?

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-14126Transactional documents should be able to store extended attributes automatically
      KULRICE-6721Document search does not work properly with KNS Attribute Definitions
      KULRICE-13230KRAD does not support AuditErrorMap
      KULRICE-8782KRAD AuthZ is difficult to extend
      KULRICE-4717More screen flexibility in the development framework and support for transactional documents
      KULRICE-13707Implement better boolean datatype support for searchable attributes
      KULRICE-12248DocumentSearchGeneratorImpl#getSearchableAttributeSql does not handle searchable attributes well if document type changes
      KULRICE-4755Dynamic Attribute support
      KULRICE-5171Lookup not returning supporting attributes
      KULRICE-9553Implement concept of a "Conversation" managed by the framework, to support extended persistence contexts for lazy loading
    • Rice Module:
      KNS, KRAD
    • KRAD Feature Area:
      Document
    • Application Requirement:
      KFS
    • Sprint:
      Core 2.5.0-m7 Sprint 1
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      2

      Description

      We discovered that in the KNS, you have to do extra work to associate extended attributes with a document (versus a normal business object) - you have to use prepareForSave to set the documentNumber on the extension object (assuming documentNumber is the PK of the document). This strikes us as non-intuitive - there is no such extra step necessary with normal business objects.

      We know the KNS won't be patched; thankfully, there's an easy work-around. But again, because this behavior is non-intuitive, we are kind of hoping that KRAD and KRAD-DATA do not perpetuate it.

        Activity

        Hide
        James Smith added a comment -

        Don't know how much help this will be, because it is deeply KNS-specific code, but: I created a simple extended attribute for both the business object Chart in KFS and the KFS transactional document Internal Billing. Here are the associated tables:

        create table CA_CHART_EXT_T (
        	FIN_COA_CD VARCHAR(2) primary key,
        	OBJ_ID VARCHAR(36),
        	VER_NBR DECIMAL(8),
        	SNG TEXT
        )
        /
        
        create table FP_INT_BILL_DOC_EXT_T (
        	FDOC_NBR VARCHAR(14) primary key,
        	OBJ_ID VARCHAR(36),
        	VER_NBR DECIMAL(8),
        	SNG TEXT
        )
        /
        

        The extended attributes for Chart work exactly as expected. However, when I try to save the Internal Billing Document with the extended attributes, I get the following error:

        14-06-17 16:50:12,740 [http-8080-1] u:khuntley/d: ERROR org.kuali.rice.kns.web.struts.form.pojo.StrutsExceptionIncidentHandler :: Exception being handled by Exception Handler
        org.springframework.dao.DataIntegrityViolationException: OJB operation; SQL []; Column 'FDOC_NBR' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'FDOC_NBR' cannot be null
        	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
        	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
        	at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107)
        	at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89)
        	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144)
        	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244)
        	at org.kuali.rice.krad.dao.impl.DocumentDaoOjb.save(DocumentDaoOjb.java:60)
        	at org.kuali.rice.krad.dao.proxy.DocumentDaoProxy.save(DocumentDaoProxy.java:98)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
        	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        	at com.sun.proxy.$Proxy74.save(Unknown Source)
        	at org.kuali.rice.krad.service.impl.DocumentServiceImpl.validateAndPersistDocument(DocumentServiceImpl.java:860)
        	at org.kuali.rice.krad.service.impl.DocumentServiceImpl.routeDocument(DocumentServiceImpl.java:192)
        	at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.route(KualiDocumentActionBase.java:814)
        	at org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase.route(KualiAccountingDocumentActionBase.java:758)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
        	at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:171)
        	at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:129)
        	at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:176)
        	at org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase.execute(FinancialSystemTransactionalDocumentActionBase.java:73)
        	at org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase.execute(KualiAccountingDocumentActionBase.java:103)
        	at org.kuali.kfs.fp.document.web.struts.CapitalAccountingLinesActionBase.execute(CapitalAccountingLinesActionBase.java:76)
        	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:496)
        	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
        	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:492)
        	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processFormActionAndForward(KualiRequestProcessor.java:221)
        	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.strutsProcess(KualiRequestProcessor.java:208)
        	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:95)
        	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        	at org.kuali.rice.kns.web.struts.action.KualiActionServlet.process(KualiActionServlet.java:198)
        	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.kfs.sys.web.filter.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:45)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:78)
        	at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:62)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:89)
        	at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:77)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:162)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.rice.kns.web.filter.ParameterFilter.doFilter(ParameterFilter.java:53)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.kfs.sys.web.filter.DevelopmentLoginFilter.doFilter(DevelopmentLoginFilter.java:66)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
        	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        	at java.lang.Thread.run(Thread.java:745)
        Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'FDOC_NBR' cannot be null
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        	at com.mysql.jdbc.Util.getInstance(Util.java:384)
        	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
        	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
        	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
        	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
        	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
        	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
        	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
        	at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102)
        	at sun.reflect.GeneratedMethodAccessor633.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at net.bull.javamelody.JdbcWrapper.doExecute(JdbcWrapper.java:373)
        	at net.bull.javamelody.JdbcWrapper$StatementInvocationHandler.invoke(JdbcWrapper.java:130)
        	at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:259)
        	at com.sun.proxy.$Proxy456.executeUpdate(Unknown Source)
        	at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeAndLinkOneToOne(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeReferences(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
        	at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246)
        	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141)
        	... 83 more
        

        Why wasn't documentNumber simply set automatically by OJB?

        Show
        James Smith added a comment - Don't know how much help this will be, because it is deeply KNS-specific code, but: I created a simple extended attribute for both the business object Chart in KFS and the KFS transactional document Internal Billing. Here are the associated tables: create table CA_CHART_EXT_T ( FIN_COA_CD VARCHAR (2) primary key, OBJ_ID VARCHAR (36), VER_NBR DECIMAL(8), SNG TEXT ) / create table FP_INT_BILL_DOC_EXT_T ( FDOC_NBR VARCHAR (14) primary key, OBJ_ID VARCHAR (36), VER_NBR DECIMAL(8), SNG TEXT ) / The extended attributes for Chart work exactly as expected. However, when I try to save the Internal Billing Document with the extended attributes, I get the following error: 14-06-17 16:50:12,740 [http-8080-1] u:khuntley/d: ERROR org.kuali.rice.kns.web.struts.form.pojo.StrutsExceptionIncidentHandler :: Exception being handled by Exception Handler org.springframework.dao.DataIntegrityViolationException: OJB operation; SQL []; Column 'FDOC_NBR' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'FDOC_NBR' cannot be null at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springmodules.orm.ojb.OjbAccessor.convertJdbcAccessException(OjbAccessor.java:107) at org.springmodules.orm.ojb.OjbAccessor.convertOjbAccessException(OjbAccessor.java:89) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:144) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244) at org.kuali.rice.krad.dao.impl.DocumentDaoOjb.save(DocumentDaoOjb.java:60) at org.kuali.rice.krad.dao.proxy.DocumentDaoProxy.save(DocumentDaoProxy.java:98) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy74.save(Unknown Source) at org.kuali.rice.krad.service.impl.DocumentServiceImpl.validateAndPersistDocument(DocumentServiceImpl.java:860) at org.kuali.rice.krad.service.impl.DocumentServiceImpl.routeDocument(DocumentServiceImpl.java:192) at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.route(KualiDocumentActionBase.java:814) at org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase.route(KualiAccountingDocumentActionBase.java:758) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269) at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:171) at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:129) at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:176) at org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase.execute(FinancialSystemTransactionalDocumentActionBase.java:73) at org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase.execute(KualiAccountingDocumentActionBase.java:103) at org.kuali.kfs.fp.document.web.struts.CapitalAccountingLinesActionBase.execute(CapitalAccountingLinesActionBase.java:76) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:496) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:492) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processFormActionAndForward(KualiRequestProcessor.java:221) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.strutsProcess(KualiRequestProcessor.java:208) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:95) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.kuali.rice.kns.web.struts.action.KualiActionServlet.process(KualiActionServlet.java:198) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.kfs.sys.web.filter.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:78) at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:89) at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.kns.web.filter.ParameterFilter.doFilter(ParameterFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.kfs.sys.web.filter.DevelopmentLoginFilter.doFilter(DevelopmentLoginFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:745) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'FDOC_NBR' cannot be null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312) at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102) at sun.reflect.GeneratedMethodAccessor633.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.bull.javamelody.JdbcWrapper.doExecute(JdbcWrapper.java:373) at net.bull.javamelody.JdbcWrapper$StatementInvocationHandler.invoke(JdbcWrapper.java:130) at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:259) at com.sun.proxy.$Proxy456.executeUpdate(Unknown Source) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeAndLinkOneToOne(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeReferences(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141) ... 83 more Why wasn't documentNumber simply set automatically by OJB?
        Hide
        Gayathri Athreya added a comment - - edited

        James, I wonder if this is solved by KULRICE-11414 . We have not tested it though. So you could do something like what Eric suggests

        @Entity
        @Table(name = "MY_EXTENSION_T")
        @ExtensionFor(MyParent.class)
        public class MyExtension {
        
        Show
        Gayathri Athreya added a comment - - edited James, I wonder if this is solved by KULRICE-11414 . We have not tested it though. So you could do something like what Eric suggests @Entity @Table(name = "MY_EXTENSION_T" ) @ExtensionFor(MyParent.class) public class MyExtension {
        Hide
        Kristina Taylor (Inactive) added a comment -

        We certainly wouldn't want to propagate that type of error into krad-data, but as of yet, I'm not seeing any tests that cover this for us. That doesn't mean we didn't address it, but we should probably verify that the case of when you have a document (I'm assuming FP_INT_BILL_DOC_EXT_T is an extension of a transactional document) that the document number is being saved both places.

        Show
        Kristina Taylor (Inactive) added a comment - We certainly wouldn't want to propagate that type of error into krad-data, but as of yet, I'm not seeing any tests that cover this for us. That doesn't mean we didn't address it, but we should probably verify that the case of when you have a document (I'm assuming FP_INT_BILL_DOC_EXT_T is an extension of a transactional document) that the document number is being saved both places.
        Hide
        James Smith added a comment -

        FP_INT_BILL_DOC_EXT_T in my example is indeed a extended attributes DO for a transactional document.

        Show
        James Smith added a comment - FP_INT_BILL_DOC_EXT_T in my example is indeed a extended attributes DO for a transactional document.
        Hide
        Jonathan Keller added a comment -

        I now have a test which seems to confirm that this is still a problem.

        The thing which mystifies me is how this is working for non-documents. (Or maybe there just is no test for this.)

        But my (commented out) test in edu.sampleu.travel.dataobject.TravelAuthorizationDocumentTest confirms that the document number is missing after save and I can see it inserting the null into the document number column in the EL debug output.

        Show
        Jonathan Keller added a comment - I now have a test which seems to confirm that this is still a problem. The thing which mystifies me is how this is working for non-documents. (Or maybe there just is no test for this.) But my (commented out) test in edu.sampleu.travel.dataobject.TravelAuthorizationDocumentTest confirms that the document number is missing after save and I can see it inserting the null into the document number column in the EL debug output.
        Hide
        Jonathan Keller added a comment -

        And another test which confirms that this was not working on the BO extension objects either.

        Show
        Jonathan Keller added a comment - And another test which confirms that this was not working on the BO extension objects either.
        Hide
        James Smith added a comment -

        Well, at least the mystification got cleared up. Thank you greatly for looking into this and confirming that there still seems to be a problem here....

        Show
        James Smith added a comment - Well, at least the mystification got cleared up. Thank you greatly for looking into this and confirming that there still seems to be a problem here....
        Hide
        Jonathan Keller added a comment -

        OK. It should be fixed. I added some logic which uses the metadata to attempt to detect this type of relationship and fill in the PK fields on the extension objects. I now have integration tests which check this for both business objects and documents.

        I'm crossing my fingers that it does not cause any issues. I set the code to short-circuit if the needed relationships are not there.

        Show
        Jonathan Keller added a comment - OK. It should be fixed. I added some logic which uses the metadata to attempt to detect this type of relationship and fill in the PK fields on the extension objects. I now have integration tests which check this for both business objects and documents. I'm crossing my fingers that it does not cause any issues. I set the code to short-circuit if the needed relationships are not there.
        Hide
        James Smith added a comment -

        Awesome - thank you so much, Jonathan!

        Show
        James Smith added a comment - Awesome - thank you so much, Jonathan!

          People

          • Assignee:
            Jonathan Keller
            Reporter:
            James Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile

                Structure Helper Panel