Eclipse Tomcat配置

来源:互联网 发布:win10win7共享网络 编辑:程序博客网 时间:2024/05/29 15:19

今天在新安装的Eclipse启动刚配置好的Tomcat8竟然报如下错误:

Publishing the configuration...   Error copying file to /opt/apache-tomcat-8.0.30/backup/catalina.policy...

找了找,原来是在eclipse中配置tomcat8时,Server Locations我选择应用Use tomcat installed,而eclipse当然需要访问你安装的tomcat目录做相应操作,然而它使用user用户却拿不到权限,就这样悲催了。好,即然这样就修改下tomcat安装目录为user可访:

sudo chown user:user -R apache-tomcat-8.0.30

注意:配置tomcat时,其下的conf目录下的所有文件,建议将权限修改为664哦,不然你就等着报错吧。


可是在往服务器Add and Remove从MyEclipse迁移过来的项目时,又开始报错了:

There are no resources that can be added or removed from the server.

原因是eclipse没办法识别你的项目为动态的web项目,所以参考下面进行设置:

For this you need to update your Project Facets setting. Right Click on Project->Go to Properties->Select Project Facets from left navigation. If it is not open…click on the link, Check the Dynamic Web Module Check Box and select the respective version (Probably 2.4). Click on Apply Button and then Click on OK.

当然你会发现,如果是用MyEclipse创建的项目,用上述方法不可行,那你就选择Configuration中的Dynamic Web ...进行应用吧,最后你还需要修改WebRoot(MyEclipse) --> WebContent(Eclipse)哦。

参考链接:error-in-publishing-the-configuration-in-eclipse & there-are-no-resources-that-can-be-added-or-removed-from-the-server

0 0
原创粉丝点击