0
votes

C:\opt\apache-tomcat-6.0.36-ins2 is where my tomcat instance located.

When I start up the tomcat instance today, I received the following error immediately (on the very first line). I have been able to start the tomcat up without this type of error until today. May I ask if there's any fix to this?

java.io.FileNotFoundException: C:\opt\apache-tomcat-6.0.36-ins2\logs\localhost.2013-02-11.log (Access is denied) at java.io.FileOutputStream.openAppend(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:192) at org.apache.juli.FileHandler.openWriter(FileHandler.java:374) at org.apache.juli.FileHandler.(FileHandler.java:99) at org.apache.juli.FileHandler.(FileHandler.java:90) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:515) at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:460) at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:286) at java.util.logging.LogManager$2.run(LogManager.java:267) at java.security.AccessController.doPrivileged(Native Method) at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:265) at java.util.logging.LogManager.getLogManager(LogManager.java:248) at java.util.logging.Logger.(Logger.java:225) at java.util.logging.LogManager$RootLogger.(LogManager.java:1094) at java.util.logging.LogManager$RootLogger.(LogManager.java:1091) at java.util.logging.LogManager$1.run(LogManager.java:180) at java.security.AccessController.doPrivileged(Native Method) at java.util.logging.LogManager.(LogManager.java:157) at java.util.logging.Logger.getLogger(Logger.java:287) at org.apache.juli.logging.DirectJDKLog.(DirectJDKLog.java:71) at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:178) at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:171) at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:243) at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:298) at org.apache.catalina.startup.Bootstrap.(Bootstrap.java:55)

2
close any editors or other instances keeping the file open? or, empty the logs folder (and move existing logs to somewhere else)eis
great. added it as an answer theneis

2 Answers

4
votes

In windows, having a log file open in an editor would prevent other processes from writing into it. So, close any editors having the log file open.

Sometimes also the permissions of folders get mismatched - in that case emptying the logs folder / moving existing logs elsewhere should fix it.

0
votes

Even I Got the same exception while starting tomcat6, in my case this problem is because of the permission that set to the log folder, finally this solved by setting read write permission on the log folder to the current user.

Now Tomcat6 is started successfully :)