我使用Apache Tomcat 7安装了NetBeans。我尝试运行程序,并提示Tomcat Manager Application并要求输入用户名和密码。
首先,我无法在Apache Tomcat服务器的属性下更改密码。我可以更改用户名,但无论密码始终保持不变。我在Catalina home&amp ;;中编辑了tomcat-user.xml文件。基地,但它似乎没有什么区别。我仍然无法使用NetBeans运行任何东西。我得到部署错误:未授权访问Tomcat服务器。在服务器管理器的Tomcat自定义程序中使用“manager-script”角色设置正确的用户名和密码。 有关详细信息,请参阅服
启动服务器时显示以下错误
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.41\logs\catalina.2014-02-22.log (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:389)
at org.apache.juli.FileHandler.<init>(FileHandler.java:100)
at org.apache.juli.FileHandler.<init>(FileHandler.java:91)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:536)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:479)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:303)
at java.util.logging.LogManager$2.run(LogManager.java:294)
at java.util.logging.LogManager$2.run(LogManager.java:292)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
at java.util.logging.LogManager.getLogManager(LogManager.java:274)
at java.util.logging.Logger.<init>(Logger.java:264)
at java.util.logging.Logger.<init>(Logger.java:260)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
at java.util.logging.LogManager$1.run(LogManager.java:196)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:173)
at java.util.logging.Logger.demandLogger(Logger.java:336)
at java.util.logging.Logger.getLogger(Logger.java:390)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.41\logs\localhost.2014-02-22.log (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:389)
at org.apache.juli.FileHandler.<init>(FileHandler.java:100)
at org.apache.juli.FileHandler.<init>(FileHandler.java:91)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:536)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:479)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:303)
at java.util.logging.LogManager$2.run(LogManager.java:294)
at java.util.logging.LogManager$2.run(LogManager.java:292)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
at java.util.logging.LogManager.getLogManager(LogManager.java:274)
at java.util.logging.Logger.<init>(Logger.java:264)
at java.util.logging.Logger.<init>(Logger.java:260)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
at java.util.logging.LogManager$1.run(LogManager.java:196)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:173)
at java.util.logging.Logger.demandLogger(Logger.java:336)
at java.util.logging.Logger.getLogger(Logger.java:390)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.41\logs\manager.2014-02-22.log (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:389)
at org.apache.juli.FileHandler.<init>(FileHandler.java:100)
at org.apache.juli.FileHandler.<init>(FileHandler.java:91)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:536)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:479)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:303)
at java.util.logging.LogManager$2.run(LogManager.java:294)
at java.util.logging.LogManager$2.run(LogManager.java:292)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
at java.util.logging.LogManager.getLogManager(LogManager.java:274)
at java.util.logging.Logger.<init>(Logger.java:264)
at java.util.logging.Logger.<init>(Logger.java:260)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
at java.util.logging.LogManager$1.run(LogManager.java:196)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:173)
at java.util.logging.Logger.demandLogger(Logger.java:336)
at java.util.logging.Logger.getLogger(Logger.java:390)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.41\logs\host-manager.2014-02-22.log (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:389)
at org.apache.juli.FileHandler.<init>(FileHandler.java:100)
at org.apache.juli.FileHandler.<init>(FileHandler.java:91)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:536)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:479)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:303)
at java.util.logging.LogManager$2.run(LogManager.java:294)
at java.util.logging.LogManager$2.run(LogManager.java:292)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
at java.util.logging.LogManager.getLogManager(LogManager.java:274)
at java.util.logging.Logger.<init>(Logger.java:264)
at java.util.logging.Logger.<init>(Logger.java:260)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1412)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1410)
at java.util.logging.LogManager$1.run(LogManager.java:196)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:173)
at java.util.logging.Logger.demandLogger(Logger.java:336)
at java.util.logging.Logger.getLogger(Logger.java:390)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:196)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:242)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:293)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
答案 0 :(得分:0)
在Windows Vista或更高版本中,需要管理权限才能在C:\Program Files\
目录下写一些内容
但Apache出于安全原因没有管理权限。
这就是错误的原因。
您需要在\conf\logging.properties
,server.xml
等tomcat配置文件中更改日志设置。
在logging.properties中,您可以找到一些${catalina.base}/logs
值。
将其更改为您喜欢的绝对路径(ex c:/path/you/like/logs
)。
在server.xml中,更改Valve标记中的目录属性,如下所示
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="c:/path/you/like/logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
或者,您也可以重新安装tomcat另一个非系统目录。
以下评论的其他答案。
当我在努力保存时,它显示出被拒绝的访问
要在某些系统文件夹Program Files
下保存文件,您需要管理权限。
我解释了解决这个问题的两种方法 你可以选择自己喜欢的任何一个。
使用管理权限运行文本编辑器。
可能是,右键单击编辑器的快捷方式并选择Run as administrator
或类似。
在其他地方和商店进行修改。 首先,将要修改的配置文件复制到其他位置,例如Desktop。 其次,编辑复制的文件并保存。 第三,复制(或移动)到原始位置(从第一步复制的地方)。 在thrid步骤之后,系统会询问您是否允许,如果需要,请选择允许。
抱歉我的英语不好。
关于Apache Web服务器。
我认为要解决它们,您需要在配置文件中更改日志设置。 您可以在httpd.conf
中找到以下(个别)行 ErrorLog "logs/error.log"
#CustomLog "logs/access.log" common
CustomLog "logs/access.log" combined
更改这些设置的绝对路径,并取消注释common
,如下所示。
ErrorLog "c:/path/you/like/logs/error.log"
CustomLog "c:/path/you/like/logs/access.log" common
CustomLog "c:/path/you/like/logs/access.log" combined
或者您可以重新安装Apache另一个非系统目录。
答案 1 :(得分:0)
您可以在NetBeans中配置多个Tomcat版本。
或
您可以安装多个不同版本的NetBeans。