鍍金池/ 問答/Java  HTML/ mybatis generator 運(yùn)行報(bào)錯(cuò)

mybatis generator 運(yùn)行報(bào)錯(cuò)

xml文件配置如下

<?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="/Users/lyv/.m2/repository/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar" />
    <context id="context" targetRuntime="MyBatis3">
        <property name="javaFileEncoding" value="UTF-8" />
        <!--注釋-->
        <!--<commentGenerator type="cn.kelaile.bigdata.common.mybatis.MyCommentGenerator">-->
            <!--&lt;!&ndash; <property name="suppressAllComments" value="true"/> &ndash;&gt;-->
            <!--&lt;!&ndash; <property name="suppressDate" value="true"/> &ndash;&gt;-->
        <!--</commentGenerator>-->
        <!-- 配置路徑 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
            connectionURL="jdbc:mysql://127.0.0.1:3306/lv?useSSL=false&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;allowMultiQueries=true"
            userId="root" password="123458" />

        <javaModelGenerator targetPackage="com.lyv.springboot.domain"
            targetProject="/Users/lyv/Documents/ideawork/src/main/java" />

        <sqlMapGenerator targetPackage="com.lyv.springboot.mapper"
            targetProject="/Users/lyv/Documents/ideawork/src/main/java" />

        <javaClientGenerator targetPackage="com.lyv.springboot.dao"
            targetProject="/Users/lyv/Documents/ideawork/src/main/java"
            type="XMLMAPPER" />

        <table tableName="customer" mapperName="CustomerDao" domainObjectName="Customer"
               enableCountByExample="false"
               enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false">
        </table>
            
    </context>
</generatorConfiguration>

運(yùn)行后報(bào)錯(cuò)

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-test1: XML Parser Error on line 33: 必須為元素類型 "table" 聲明屬性 "mapperName"。 -> [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
Disconnected from the target VM, address: '127.0.0.1:52591', transport: 'socket'

Process finished with exit code 1
回答
編輯回答
影魅

Mapper.xml bean 和數(shù)據(jù)庫字段寫錯(cuò)

2017年9月20日 00:39
編輯回答
祉小皓

我也遇到這個(gè)問題,樓主這么解決的?

2017年6月10日 16:37