1. 程式人生 > >table configuration with catalog null schema root and table message did not resolve to any tables

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

最近在使用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所寫的解決辦法似乎都沒有效果。。。