Home > Back-end >  Java maven project practice of reverse engineering error Communications link failure
Java maven project practice of reverse engineering error Communications link failure

Time:10-28

# reverse engineering, Java, maven, mybatis#

A maven project (mybatis) mysql driver to run completely no problem, now ready to learn to run reverse engineering, so here's the thing I use a test test times wrong, the code is as follows:

MBG. XML file:

<? The XML version="1.0" encoding="utf-8"?>
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration/1.0/EN"
"Http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" & gt;


TargetRuntime: execute the generated version of reverse engineering
MyBatis3Simple: create basic CRUD (simple version function less)
MyBatis3: generated CRUD with constraints (function more complex version)
- & gt;

ConnectionURL="JDBC: mysql://localhost: 3306/SMBMS? UseUnicode=true& amp; CharacterEncoding=utf-8 & amp; amp; UseSSL=true "
UserId="root"
Password="131452" & gt;











Java test test class:

@ Test
Public void testMBG () throws the Exception {
List Warnings=new ArrayList (a);
Boolean overwrite=true;
The File configFile=new File (" MBG. XML ");
ConfigurationParser cp=new ConfigurationParser (warnings);
The Configuration config=cp. ParseConfiguration (configFile);
DefaultShellCallback callback=new DefaultShellCallback (overwrite);
MyBatisGenerator MyBatisGenerator=new MyBatisGenerator (config,
The callback, warnings);
MyBatisGenerator. Generate (null);
}

Pom. XML configuration for the jar package:


Mysql
Mysql connector - java
5.1.47 & lt;/version>


IO. Making. Orange1438 & lt;/groupId>
Mybatis generator - core
1.3.5 & lt;/version>


An error is as follows:

  • Related