Java 在 tomcat 6 中部署 spring 应用程序时出现“访问被拒绝”消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2270854/
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
"Access is denied" message while deploying spring app in tomcat 6
提问by Pratyusha
While trying to deploy my spring app on tomcat 6 I get an error saying
在尝试在 tomcat 6 上部署我的 spring 应用程序时,我收到一条错误消息
java.util.logging.errormanager:4
java.io.filenotfoundexception: c:\program files\apache software foundation\tomcat 6.0\logs\catalina.2010.02.16.log <Access is denied>
at java.io.fileoutputstream.openappend <native method>
at java.io.fileoutputstream.<init><unknown source>
at java.io.filewriter.<init><unknown source>
at apache.juli.filehandler.open<filehandler.java:259>
at apache.juli.filehandler.open<filehandler.java:59>
at apache.juli.filehandler.open<filehandler.java:50>
at sun.reflect.nativeconstructoraccessorImpl.newInstance0<native method>
at sun.reflect.delegatingconstructoraccessorImpl.newInstance<unknown source>
at sun.reflect.constructor.newInstance<unknown source>
at java.lang.class.newinstance0<unknown source>
at org.apache.juli.classloaderlogmanager.readconfiguration<classloaderlogmanager.java:418>
.....
.....
at java.util.logging.logmanager.run<unknown source>
.....
.....
Is this because Tomcat hasn't been installed properly? Or do I need some permissions to use Tomcat? Or are some important tomcat files missing? Or something else?
这是因为Tomcat没有正确安装吗?或者我需要一些权限才能使用 Tomcat?或者缺少一些重要的tomcat文件?或者是其他东西?
采纳答案by Peter Lang
Check if the following file exists:
检查以下文件是否存在:
c:\program files\apache software foundation\tomcat 6.0\logs\catalina.2010.02.16.log
Your exception says <Access is denied>
, so maybe the file is open in another application or you are missing permissions?
您的例外是<Access is denied>
,所以可能该文件已在另一个应用程序中打开,或者您缺少权限?
回答by kgiannakakis
Tomcat has no access rights to the c:\program files\ folders. There are ways to get around this, but the easiest way will be to install Tomcat in another directory, e.g in your user area (C:\Users).
Tomcat 没有对 c:\program files\ 文件夹的访问权限。有很多方法可以解决这个问题,但最简单的方法是将 Tomcat 安装在另一个目录中,例如在您的用户区 (C:\Users) 中。
回答by Ryan Fernandes
Looks like you're working on a machine that has some security policies in place that restrict you from installing software yourself. This is very common in most organizations nowadays.
看起来您正在使用具有一些安全策略的机器来限制您自己安装软件。这在当今大多数组织中非常普遍。
Do the following:
请执行下列操作:
- Uninstall tomcat.
- Find a folder where you can read/write into (eg. D:\neetu)
- Install tomcat in the above folder.
- 卸载tomcat。
- 找到一个可以读/写的文件夹(例如 D:\neetu)
- 在上述文件夹中安装tomcat。
Run tomcat.
It should work now.
运行tomcat。
它现在应该可以工作了。
回答by Kdeveloper
After installing Apache Tomcat you must give the OS user who will be running the Tomcat server write/update rights to the directories: temp, logs, work.
安装 Apache Tomcat 后,您必须向将运行 Tomcat 服务器的操作系统用户授予对以下目录的写入/更新权限:temp、logs、work。
回答by Mark
I solved it by running netBeans (or whichever IDE you are using to run the application) as an administrator. That gives you access permissions.
我通过以管理员身份运行 netBeans(或您用来运行应用程序的任何 IDE)解决了这个问题。这为您提供了访问权限。
回答by manishgupta005
right click on log folder and in security give yourself proper WRITE permission and make sure folders are not in read only mode.
右键单击日志文件夹并在安全中给自己适当的写入权限,并确保文件夹不处于只读模式。
回答by user2015880
Solution: I right click on eclipse and gave it administrative rights
解决方案:我右键单击eclipse并赋予其管理权限
回答by Hammad Hassan
The simple solution is that you need to run Tomcat with Administrator Permission. And this access denied will never occur.
简单的解决方案是您需要以管理员权限运行 Tomcat 。并且这种访问被拒绝永远不会发生。