新增出错错误记录NodeletException,SAXParseException20231025

文章描述了在使用iBatis时遇到的XML配置错误,涉及到`sqlMapConfig`元素不完整的问题,以及主键自动生成导致的SQLIntegrityConstraintViolationException。作者提到XML可能是自动生成的,但与主键定义冲突,且尝试解决过程中遇到不能传空值的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

新增出错(DB2+ibatis)

[com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 281; The content of element type “sqlMapConfig” is incomplete, it must match “(properties?,settings?,resultObjectFactory?,typeAlias*,typeHandler*,transactionManager?,sqlMap+)+”.][Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 281; The content of element type “sqlMapConfig” is incomplete, it must match “(properties?,settings?,resultObjectFactory?,typeAlias*,typeHandler*,transactionManager?,sqlMap+)+”.]:[Ljava.lang.StackTraceElement;@1179358f

    ORDER_NO            INTEGER generated always as identity
        primary key,
    PLAN_MONTH          VARCHAR(40)  default ''   not null,
    MANU_FACTORY_ID     VARCHAR(40)  default ''   not null,
    PLAN_VERSION        VARCHAR(255) default ''   not null,
    PLAN_VERSION_STATE  VARCHAR(10)  default '00' not null,
    REMARK              VARCHAR(40)  default ''   not null,
    REC_CREATOR         VARCHAR(32)  default ''  not null,
    REC_CREATOR_NAME    VARCHAR(32)  default ' '  not null,
    REC_CREATE_TIME     VARCHAR(14)  default ' '  not null,
    REC_REVISOR         VARCHAR(32)  default ' '  not null,
    REC_REVISOR_NAME    VARCHAR(32)  default ' '  not null,
    REC_REVISE_TIME     VARCHAR(14)  default ' '  not null,
    ARCHIVE_FLAG        VARCHAR(1)   default ' '  not null,
    ARCHIVE_TIME        VARCHAR(14)  default ' '  not null,
    ARCHIVE_STAMP_NO    VARCHAR(10)  default ' '  not null,
    PROCESS_INSTANCE_ID VARCHAR(64)  default ' '  not null,
    DOC_ID              VARCHAR(64)  default ' '  not null,
    REC_ID              VARCHAR(64)  default ' '  not null,
    REC_VERSION         VARCHAR(64)  default ' '  not null,
    REC_AREA_ID         VARCHAR(10)  default ' '  not null,
    EXT1                VARCHAR(255) default ' '  not null,
    EXT2                VARCHAR(255) default ' '  not null
  1. 这个错误有可能是xml写的不正确,(但是我是自动生成的xml应该不存在这个选项)
  2. 这该死啊,是主键是新增的,但是xml生成的时候也包括主键了,就报这个错误了(和这个有关但吧全是)
  3. 我把sql换了一个xml然后报错不能传空,但是我又都有默认值,就把创建人创建时间给了,就突然对了

com.ibatis.sqlmap.client.SqlMapException: Failed to instantiate MappedStatementStrategy bean

com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=5, TABLEID=24840, COLNO=2, DRIVER=4.21.29:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Network porter

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值