找到需要导入的项目 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里的内容,我是复制进去的