table configuration with catalog null schema root and table message did not resolve to any tables

博主在使用MyBatisGenerator工具自动生成DAO层映射时遇到错误,详细分享了配置文件内容,包括数据库连接、生成Model类、映射文件和DAO类的位置设置。寻求关于如何正确配置和debug的指导。

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

最近在使用mybatis generator 工具自动生成一个dao层映射时,报如下错误,不知如果debug,求指导~

在这里插入图片描述
具体配置文件如下:

<?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>
	<!--database driver -->
	<classPathEntry location="mysql-connector-java-5.1.8.jar" />
	<context id="myTables" targetRuntime="MyBatis3">
		<commentGenerator>
			<property name="suppressDate" value="true" />
			<property name="suppressAllComments" value="true" />
		</commentGenerator>

		<!--数据库链接地址账号密码 -->
		<jdbcConnection driverClass="com.mysql.jdbc.Driver"
			connectionURL="jdbc:mysql://localhost:3306/mybatis?characterEncoding=utf8" userId="root"
			password="root">
		</jdbcConnection>

		<!-- <environments default="development"> <environment id="development"> 
			<transactionManager type="JDBC" /> 配置数据库连接信息 <dataSource type="POOLED"> <property 
			name="driver" value="${driver}" /> <property name="url" value="${url}" /> 
			<property name="username" value="${name}" /> <property name="password" value="${password}" 
			/> </dataSource> </environment> </environments> -->

		<javaTypeResolver>
			<property name="forceBigDecimals" value="false" />
		</javaTypeResolver>
		
		<!--生成Model类存放位置 -->
		<javaModelGenerator targetPackage="javabean.mybatis"
			targetProject="src">
			<property name="enableSubPackages" value="true" />
			<property name="trimStrings" value="true" />
		</javaModelGenerator>
		
		<!--生成映射文件存放位置 -->
		<sqlMapGenerator targetPackage="javabean.mapping"
			targetProject="src">
			<property name="enableSubPackages" value="true" />
		</sqlMapGenerator>
		
		<!--生成Dao类存放位置 -->
		<javaClientGenerator type="XMLMAPPER"
			targetPackage="javabean.dao" targetProject="src">
			<property name="enableSubPackages" value="true" />
		</javaClientGenerator>
		
		<!--生成对应表及类名 -->
		<table schema="root" tableName="message" domainObjectName="Messgae"
			enableCountByExample="false" enableUpdateByExample="false"
			enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>
	</context>

</generatorConfiguration>

其他blog所写的解决办法似乎都没有效果。。。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值