使用Tomcat启动项目时候出了不少的小错误,Java的配置好细致;
错误一:
Failed to execute goal on project e3-manager-interface: Could not resolve dependencies for project cn.e3mall:e3-manager-interface:jar:0.0.1-SNAPSHOT:
Failure to find cn.e3mall:e3-manager-pojo:jar:0.0.1-SNAPSHOT in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository,
resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]
[ERROR]
错误描述:找不到对应的cn.e3mall:e3-manager-interface:jar:0.0.1-SNAPSHOT;
解决方案:之所以会出现这样的问题,是因为我们的本地仓库中没有e3-manager-interface:jar:0.0.1-SNAPSHOT,那么就需要生成,在e3-manager-interface文件上右键-Run As-Maven install;
错误二:
Missing artifact com.github.pagehelper:pagehelper:jar:3.4.2-fix
错误描述:遇上一个错误一致都是找不到所需要的文件,这个是找不到需要的jar包
解决方案一:
从网上查阅了解到,可能是由于该版本的jar包需要收费或者是连接不到网络问题,可以自己从网络上下载一个pagehelper.3.4.2.jar包,然后复制到.m2目录中;
如我的目录是E:E:\Program Files (x86).m2\repository\com\github\pagehelper\pagehelper\3.4.2-fix,然后重启eclipse;
但是我的没有什么反应;
解决方案二:
更改版本号,将pagehelper:jar:3.4.2-fix更改为pagehelper:jar:3.2.1-fix,然后点击Window-Preferences-Maven-Update Maven projects on startup,点击OK,然后重启Eclipse(File–Restart);
看网上大家基本上都是操作到这里就解决啦,但是就我的项目来说还是没有反应,一样的错误,只不过错误的版本号变了,这个时候就在想是不是不是版本的问题,而是自己写的问题呢,那就继续解决;
解决方案三:添加依赖版本号
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>3.2.1</version>
</dependency>
到此问题成功解决,有时候换个角度思考问题,也没有那么难,在要放弃的时候再坚持一会儿,说不定真的有惊喜呢;
错误三:
错误:Re-run Maven using the -X switch to enable full debug logging(使用-x开关重新运行maven以启用完全调试日志记录)
错误情况如下图:(选择Maven clean时候)
解决:点击Window-Preferences-Maven-Debug Output,点击OK,然后重启Eclipse,然后再在对应项目文件上右键Run As-Maven install,问题解决;
错误四:
错误:Failed to initialize connector [Connector[HTTP/1.1-8081]],连接不到,端口号被占用;
解决方案:更换端口号,更改为8082或其他;
注意:Tomcat的Server.xml中配置的端口号与项目中启动配置的端口号不同相同;