eclipse开发中常见问题

1、端口被占用

Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

说明:部署项目到tomcat的时候报端口被占用。

报这个错误的原因是你有另外一个tomcat实例正在运行,可以通过浏览器访问localhost:8080看是否出现tomcat默认猫界面查看;或者报tomcat默认的404not found页面,这两种情况都说明,你有另外一个tomcat正在运行。


解决办法:找到tomcat路径下的bin目录,如果是windows系统则执行shutdown.bat,如果是linux(unix)系统的话,则执行shutdown.sh。

如果以上方法不起作用,则关闭eclipse,杀死所有java或者javax进程。


如果你的确需要运行两个tomcat的话,你需要修改这个tomcat的端口号。


2、Could not get JDBC Connection

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver  '
### The error may exist in file [/Users/zhongshibo/Documents/workspace/storm/target/classes/com/zhongsb/base/mapping/UserMapper.xml]
### The error may involve com.zhongsb.base.IDao.IUserDao.selectByPrimaryKey
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver  '
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
    at com.sun.proxy.$Proxy14.selectOne(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68)
    。。。

说明:Cannot load JDBC driver class 'com.mysql.jdbc.Driver  '

观察到url后面存在空格,删除jdbc.properties文件中的空格。问题解决。

3、retrieving archetypes has encountered a problem

http://blog.csdn.net/zhang5476499/article/details/51009022

下载碰到困难的同志们,可以在csdn寻找这个文件,有提供这个文件的下载。


4、编码指定重复

org.apache.jasper.JasperException: /WEB-INF/jsp/showUser.jsp (line: 2, column: 1) Page directive must not have multiple occurrences of pageencoding

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

页面制定了两次编码,删除一个。


5、mybatis自动生成代码

Java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite

修改generatorConfig.xml配置文件中的数据库配置为自己的配置。



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

伍六七AI编程

你猜你给我1分我要不要

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值