idea项目导入eclipse中步骤

来源:互联网 发布:北京美工工资一般多少 编辑:程序博客网 时间:2024/05/17 00:16

1、打开eclipse,右键import
这里写图片描述
找到需要导入的项目
2、重新配置tomcat,已经配置好了建议移除后重新添加,
window-preference这里写图片描述
3、项目上右键-debug AS-发现没有 debug on server,这是没有转成web项目
项目右键-properties
这里写图片描述
配置好后会出现debug on server,启动会报错(没报错也访问不了项目)

4、发现pom.xml文件报错现
web.xml is missing and is set to true
网上说webapp下没有web.xml导致的,但是这是原来在idea上可以使用的,所以不存在没有web.xml,实际上也不存在没有web.xml,所以以下方法是针对有web.xml 情况下的
项目-Properties-Deployment Assembly-add-Folder-src-main-webapp
保存
最后project-clean下
这里写图片描述
如上图已经添加webapp
5、启动tomcat,发现报错
Error configuring application listener of class org.springframework.web.context.ContextLoaderListene
由于我这是maven项目
右键项目->Properties->Deployment Assembly,看看有没有Maven Dependencies,发现没有
没有的话,点Add,选Java Build Path Entries ,拉到最下面,就可以看到Maven Dependencies,这样添加进去就可以了。
这里写图片描述
6、接着重启tomcat,哈哈,发现又报错了,但这次报的错误不一样了
class path resource [spring-mybatis.xml] cannot be opened because it does not exist
说我的spring-mybatis.xml不存在,胡说,绝对胡说!!!
解决办法,添加resource,如图,页面是不是很熟悉,
add-folder-选resource文件夹,deploy path里的内容,我是复制进去的
这里写图片描述

7、再启动,没报错,访问,可以访问,收工!!!

原创粉丝点击