3

While trying to deploy my spring app on tomcat 6 I get an error saying

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$2.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?

cdeszaq
  • 30,869
  • 25
  • 117
  • 173
Pratyusha
  • 113
  • 1
  • 4
  • 10

8 Answers8

6

I solved it by running netBeans (or whichever IDE you are using to run the application) as an administrator. That gives you access permissions.

Mark
  • 883
  • 1
  • 8
  • 14
4

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?

Peter Lang
  • 54,264
  • 27
  • 148
  • 161
  • 1
    ... and if the file in question does not exist, check that your application / its account has the permissions required to create the file in that directory. – Stephen C Feb 16 '10 at 05:34
  • 1
    File doesnt exist. How do I check for permissions? Unable to create/cut/copy a new folder in Tomcat directory. Says"access is denied." Also, While trying to export the project as a .war file from eclipse into the tomcat webapps folder, it says an error has occured. – Pratyusha Feb 16 '10 at 05:44
  • You can try to change permissions. On Windows XP for example: http://support.microsoft.com/kb/308419/EN-US/ – Peter Lang Feb 16 '10 at 05:55
3

right click on log folder and in security give yourself proper WRITE permission and make sure folders are not in read only mode.

1

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:

  1. Uninstall tomcat.
  2. Find a folder where you can read/write into (eg. D:\neetu)
  3. Install tomcat in the above folder.

Run tomcat.
It should work now.

Ryan Fernandes
  • 8,238
  • 7
  • 36
  • 53
  • Hi, what were you referring to when you said "these new users (1 rep point users) dont bother to use the site as they should"? – Pratyusha Feb 16 '10 at 08:42
  • Thanks for your answer. I got the necessary system rights to deploy Tomcat. But now its throwing an error saying the war file cannot be unzipped.Also, How can I find out which port Tomcat is currently using? – Pratyusha Feb 16 '10 at 08:45
  • 1
    Looks like you marked the question as 'answered'. Maybe you would need to open up another question on the site? – Ryan Fernandes Feb 16 '10 at 08:53
1

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.

Kdeveloper
  • 13,679
  • 11
  • 41
  • 49
0

Solution: I right click on eclipse and gave it administrative rights

0

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).

kgiannakakis
  • 103,016
  • 27
  • 158
  • 194
0

The simple solution is that you need to run Tomcat with Administrator Permission. And this access denied will never occur.

Hammad Hassan
  • 1,192
  • 17
  • 29