spring IntelliJ需要将tomcat/conf目录复制到项目目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16428126/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 05:56:52  来源:igfitidea点击:

IntelliJ needs to copy tomcat/conf directory to project directory

springtomcatspring-mvcintellij-ideatomcat7

提问by Hrishikesh Choudhari

I have a freshly installed Tomcat 7 server, and I'm trying to make IntelliJ deploy a HelloWorld Spring MVC app to Tomcat.

我有一个新安装的 Tomcat 7 服务器,我正在尝试让 IntelliJ 将 HelloWorld Spring MVC 应用程序部署到 Tomcat。

My Tomcat home is /usr/share/tomcat7and Tomcat base is /var/lib/tomcat7

我的 Tomcat 家是/usr/share/tomcat7,Tomcat 基地是/var/lib/tomcat7

However, when I try to run the project, IntelliJ throws an error saying:

但是,当我尝试运行该项目时,IntelliJ 会抛出一个错误:

Error running Tomcat : Error copying configuration files from /var/lib/tomcat7/conf to /home/adonis/.IntelliJIdea12/system/tomcat/Tomcat__SpringMVCApp/conf : /var/lib/tomcat7/conf/tomcat-users.xml (Permission denied)

Error running Tomcat : Error copying configuration files from /var/lib/tomcat7/conf to /home/adonis/.IntelliJIdea12/system/tomcat/Tomcat__SpringMVCApp/conf : /var/lib/tomcat7/conf/tomcat-users.xml (Permission denied)

Here is a screenshot - http://i.imgur.com/CQ3z0e1.png

这是屏幕截图 - http://i.imgur.com/CQ3z0e1.png

Any permissions I need to set up?

我需要设置任何权限吗?

采纳答案by CrazyCoder

Make sure that files under /var/lib/tomcat7/conf/directory have read permission for the user IntelliJ IDEA is running from.

确保目录下的/var/lib/tomcat7/conf/文件对运行 IntelliJ IDEA 的用户具有读取权限。

chmod -R 644 /var/lib/tomcat7/conf/

should help.

应该有帮助。

Also check that /home/adonis/.IntelliJIdea12/system/tomcat/has correct permissions and owner. Could be that it was created from a different user and your current user doesn't have the rights to write into it.

还要检查是否/home/adonis/.IntelliJIdea12/system/tomcat/具有正确的权限和所有者。可能是它是由其他用户创建的,而您当前的用户没有写入权限。



If it doesn't help, download and unpack a new Tomcat installation from .tar.gzfile, configure IDEA to use this installation instead.

如果没有帮助,请从.tar.gz文件下载并解压缩新的 Tomcat 安装,将 IDEA 配置为使用此安装。

Note that Tomcat installed using the package manager on some Linux systems has non-standard layout and permissions, and therefore will not work with IDEA.

请注意,在某些 Linux 系统上使用包管理器安装的 Tomcat 具有非标准的布局和权限,因此不适用于 IDEA。

回答by Rodrigo Hime

Try chmod -R 777 /var/lib/tomcat7/conf/, it works to me.

试试吧chmod -R 777 /var/lib/tomcat7/conf/,它对我有用。

回答by Kayvan Tehrani

I had the same problem and these steps helped me to Start my tomcat7 from Intellij :

我遇到了同样的问题,这些步骤帮助我从 Intellij 启动了我的 tomcat7:

I have Linux Mint 17,and Tomcat 7 which is installed using apt-get

我有 Linux Mint 17 和使用 apt-get 安装的 Tomcat 7

CATALINA_HOME in /usr/share/tomcat7 and CATALINA_BASE in /var/lib/tomcat7

/usr/share/tomcat7 中的 CATALINA_HOME 和 /var/lib/tomcat7 中的 CATALINA_BASE

1- First I created a soft link which references /etc/tomcat7

1-首先我创建了一个引用 /etc/tomcat7 的软链接

cd /usr/share/tomcat7
ln -s /etc/tomcat7 conf

2- Then you have to change the access permissions of /etc/tomcat7

2-然后你必须改变/etc/tomcat7的访问权限

sudo chmod -R 655 /etc/tomcat7/

That's it.

就是这样。

回答by Smile4ever

For me, this worked for Tomcat 8 on Manjaro Linux:

对我来说,这适用于 Manjaro Linux 上的 Tomcat 8:

sudo chmod -R 755 /usr/share/tomcat8/

回答by Stephan Oudmaijer

I added my own user account to the tomcat7 group.

我将自己的用户帐户添加到了 tomcat7 组。

And chmod g+r /var/lib/tomcat7/conf/tomcat-users.xml

和 chmod g+r /var/lib/tomcat7/conf/tomcat-users.xml