1

I'm using tomcat security manager for my application. In my application, i have placed my running tomcat in

path: usr/local/tomcat-7/webapps/myapplication

And when i run my application i will logged all the actions in logger. That logger file is placed in another path

path:usr/local/tomcat-6/logs/mylogs.log (*this is not running server, just a folder named tomcat-6*)

When i run my application with security manager, it will throw this exception:

java.security.AccessControlException:access denied("java.io.FilePermission" "usr/local/tomcat6/logs/mylogs.log" "write" ).

In My catalina.policy file i have gave this rule to grant permission to this file. But it doesn't works.

grant codeBase "file:${catalina.home}/../tomcat-6/logs/-" {
        permission java.security.AllPermission;
};

How can i resolve this problem?

arulmr
  • 8,620
  • 9
  • 54
  • 69
Hariprasath
  • 828
  • 4
  • 15
  • 41

2 Answers2

1

1: Login as root user

2: Go to logs directory

3: chmod 644 mylogs.log

Deepu--Java
  • 3,742
  • 3
  • 19
  • 30
0

Change your java permission. read thisenter link description here

Vishwajit R. Shinde
  • 465
  • 2
  • 5
  • 18
  • Will you give me any clue or examples to get the tomcat installation directory. – Hariprasath Oct 13 '14 at 09:38
  • Wherever is server, there you have to provide permissions in java setup. If you are using applets in browser you will get same access/permission denied exception on client side also. If yes, at client also you have to provide permissions. read from tutorial link from previous comment. – Vishwajit R. Shinde Oct 13 '14 at 10:30