码迷,mamicode.com
首页 > 其他好文 > 详细

maven搭建ssm框架问题总结

时间:2018-01-27 00:40:11      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:使用   对话   ble   ide   win   安装   index   对话框   nts   

1. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project jcseg-core: Compilation failure
[ No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

解决:把 JRE 路径从 JRE 改成 JDK: 
Window → Preferences → 对话框中的左侧选择Java → Installed JREs → 对话框右侧点击 Add 按钮 → Standard VM → next → JRE home 选择 JDK 的安装路径 → Finish → 选中 jdk 的复选框 → 点击 OK 按钮
按照《Maven实战》的内容,建议你不要使用 eclipse 内嵌的 Maven。而是给 eclipse 配置电脑上安装的 Maven。这样保证版本一致,可以避免一些问题。

2.Caused by: java.net.BindException: Address already in use: JVM_Bind <null>:8080
解决:端口被占用,可能运行两次tomcat

3.严重: Compilation error org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException:
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

解决:项目正常启动,但是无法在浏览器中打开,报的错是 org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException,是tomcat:run的问题
在web项目的pom文件中增加tomcat7配置

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9999</port> 
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
启动tomcat插件,不过这次的命令不是tomcat:run 而是tomcat7:run 因为前者不会调用tomcat7;

4.ssm整合时出现
java.sql.SQLException: The server time zone value ‘?й???????‘ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value ‘?й???????‘ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解决:配置pom.xml时使用的是MySQL最新jar包,原来新版的驱动配置有些变化:

1. url连接必须设置时区
### MySQL Connector/J 5.x (旧版连接)
#jdbc.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8

### MySQL Connector/J 6.x (新版连接)
jdbc.url=jdbc:mysql:///test?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false

说明: 新版驱动url默认地址为127.0.0.1:3306,所以访问本机mysql数据库地址可以用 /// 表示。

2. 新的驱动类位置有了变化(不影响使用,但会报警告)

### MySQL Connector/J 5.x (旧版驱动)
#jdbc.driver_class=com.mysql.jdbc.Driver

### MySQL Connector/J 6.x (新版驱动)
jdbc.driver_class=com.mysql.cj.jdbc.Driver

maven搭建ssm框架问题总结

标签:使用   对话   ble   ide   win   安装   index   对话框   nts   

原文地址:https://www.cnblogs.com/smfx1314/p/8361753.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!