XML Parser Error on line 44: 元素类型为 “table“ 的内容必须匹配 “(property*,generatedKey?,domainObjectRenamingRul

本文解决了一个XML配置文件中关于table元素的结构错误。问题在于property标签的位置不当,正确的做法是将其放置在generatedKey标签之上。通过调整标签顺序并重新生成配置文件,成功解决了XML解析错误。

XML Parser Error on line 44: 元素类型为 “table” 的内容必须匹配 “(property*,generatedKey?,domainObjectRenamingRule?,columnRenamingRule?,(columnOverride|ignoreColumn|ignoreColumnsByRegex)*)”。

找了半天原因!最后竟然是因为:

在这里插入图片描述
这个property标签不能放在这,要放在generatedKey上面,修改之后重新generate一下就可以了
在这里插入图片描述

[WARNING] [WARNING] Some problems were encountered while building the effective model for com.ytwd:corw-phone-app-service:jar:1.0.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ com.ytwd:corw-phone-app:1.0.0-SNAPSHOT, E:\project\corw-phone-app\pom.xml, line 185, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------< com.ytwd:corw-phone-app-service >------------------- [INFO] Building corw-phone-app-service 1.0.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- mybatis-generator:1.3.2:generate (default-cli) @ corw-phone-app-service --- [ERROR] XML Parser Error on line 44: Ԫ������Ϊ "context" �����ݱ���ƥ�� "(property*,plugin*,commentGenerator?,jdbcConnection,javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)"�� [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.414 s [INFO] Finished at: 2025-09-16T10:11:09+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project corw-phone-app-service: XML Parser Error on line 44: Ԫ������Ϊ "context" �����ݱ���ƥ�� "(property*,plugin*,commentGenerator?,jdbcConnection,javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)"�� -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
09-17
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <generatorConfiguration> <classPathEntry location="C:\Users\Dust\.m2\repository\mysql\mysql-connector-java\8.0.33\mysql-connector-java-8.0.27.jar"/> <context id="mysql" targetRuntime="MyBatis3"> <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin"/> <plugin type="org.mybatis.generator.plugins.SerializablePlugin"/> <plugin type="org.mybatis.generator.plugins.LombokPlugin"/> <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/corw_phone_app" userId="root" password="666666"/> <sqlMapGenerator targetPackage="mapper" targetProject=".\src\main\resources\mybatis"> <property name="enableSubPackages" value="true"/> </sqlMapGenerator> <javaClientGenerator targetPackage="com.ytwd.repository.mapper" targetProject="src/main/java" type="XMLMAPPER"> <property name="enableSubPackages" value="false"/> </javaClientGenerator> <javaModelGenerator targetPackage="com.ytwd.repository.model" targetProject="src/main/java"> <property name="enableSubPackages" value="false"/> <property name="trimStrings" value="true"/> </javaModelGenerator> <commentGenerator> <property name="suppressAllComments" value="false"/> <property name="suppressDate" value="true"/> </commentGenerator> <javaTypeResolver> <property name="forceBigDecimals" value="false"/> </javaTypeResolver> <table tableName="user" domainObjectName="User" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="service_category" domainObjectName="ServiceCategory" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="service_info" domainObjectName="ServiceInfo" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="service_item" domainObjectName="ServiceItem" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="service_appraise" domainObjectName="ServiceAppraise" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="operation_log" domainObjectName="operationLog" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> <table tableName="audit_log" domainObjectName="auditLog" > <generatedKey column="id" sqlStatement="Auto" identity="true"/> </table> </context> </generatorConfiguration> C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2025.2.1\plugins\maven\lib\maven3\bin\mvn.cmd -Didea.version=2025.2.1 -Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2025.2.1\plugins\maven\lib\maven-event-listener.jar -Djansi.passthrough=true -Dstyle.color=always -Dmaven.repo.local=C:\Users\Dust\.m2\repository org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate -f pom.xml [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.ytwd:corw-phone-app-service >------------------- [INFO] Building corw-phone-app-service 1.0.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- mybatis-generator:1.4.1:generate (default-cli) @ corw-phone-app-service --- [INFO] Artifact mysql:mysql-connector-java:pom:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] [INFO] Artifact mysql:mysql-connector-java:pom:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] Downloading from central: https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.pom Downloaded from central: https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.33/mysql-connector-java-8.0.33.pom (0 B at 0 B/s) [INFO] Artifact com.mysql:mysql-connector-j:pom:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] [INFO] Artifact com.mysql:mysql-connector-j:pom:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] Downloading from central: https://repo.maven.apache.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.pom Downloaded from central: https://repo.maven.apache.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.pom (0 B at 0 B/s) Downloading from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9.pom Downloaded from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9.pom (5.4 kB at 17 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.21.9/protobuf-parent-3.21.9.pom Downloaded from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-parent/3.21.9/protobuf-parent-3.21.9.pom (9.0 kB at 46 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.21.9/protobuf-bom-3.21.9.pom Downloaded from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-bom/3.21.9/protobuf-bom-3.21.9.pom (3.5 kB at 27 kB/s) [INFO] Artifact com.mysql:mysql-connector-j:jar:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] [INFO] Artifact com.mysql:mysql-connector-j:jar:8.0.33 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases), sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots, default, releases+snapshots)] Downloading from central: https://repo.maven.apache.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar Downloaded from central: https://repo.maven.apache.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar (0 B at 0 B/s) Downloading from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9.jar Downloading from central: https://repo.maven.apache.org/maven2/org/mybatis/generator/mybatis-generator-core/1.4.1/mybatis-generator-core-1.4.1.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/mybatis/generator/mybatis-generator-core/1.4.1/mybatis-generator-core-1.4.1.jar (706 kB at 62 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9.jar (1.7 MB at 40 kB/s) [ERROR] XML Parser Error on line 56: Ԫ������Ϊ "context" �����ݱ���ƥ�� "(property*,plugin*,commentGenerator?,(connectionFactory|jdbcConnection),javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)"�� [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 44.957 s [INFO] Finished at: 2025-09-16T11:37:35+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate (default-cli) on project corw-phone-app-service: XML Parser Error on line 56: Ԫ������Ϊ "context" �����ݱ���ƥ�� "(property*,plugin*,commentGenerator?,(connectionFactory|jdbcConnection),javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)"�� -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
最新发布
09-17
更新流程业务表数据失败:nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :' , copper wire_produce , ', expect ), actual null, pos 1347, line 72, column 21, token IDENTIFIER wire_produce ### The error may exist in URL [jar:file:/D:/ZeroCloud/setup_win_v5.0.0_rc4/setup_win/files/services/system-service/zerocloud-system-service.jar!/BOOT-INF/classes!/mapper/FormDataMapper.xml] ### The error may involve com.zerocloud.system.mapper.FormDataMapper.insertRow-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO Pur_GongYingShangShiYang ( apply_name , apply_no , apply_date , apply_dept_no , apply_dept_name , business_key , sn , proc_state , supplier_name , shiyebu , shiyang_leixing , chanpin_fenlei , caigou_no , xuqiu_bumen , prd_no , shiyang_cishu , guige_canshu , supplier_no , purchase_ID , gongchengkahao , qty , produce_date , produce_dept , changpinliaohao , changpinguige , sujiaoshengchancanshu , sujiaowuliaoshiyongqingkuang , sujiaoliaohao , sujiaopihao , sujiao_qty , wire_produce , wire_use , irradiation_produce , irradiation_use , copper wire_produce , copper wire_use , high speed_produce , high speed_use , new energy_produce , new energy_use , process_report , finished product_report , pinbaojielun , gongchengjianyijijielun , final_conclusion , next_business_key , Acknowledgment ) VALUES ( ? , ? , ? , ? , ? , ? , NULL , NULL , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ) ### Cause: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :' , copper wire_produce , ', expect ), actual null, pos 1347, line 72, column 21, token IDENTIFIER wire_produce
03-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值