Vincent Massol wrote:

>Florent,
>
>>-----Original Message-----
>>From: Florent Nisseron [mailto:[EMAIL PROTECTED]]
>>Sent: 26 February 2002 08:09
>>To: [EMAIL PROTECTED]
>>Subject: Cactus 1.3 and Log4j
>>
>>   Hi,
>>
>>Like few days ago, I have problem with cactus 1.3 when I want to use
>>
>it
>
>>with Log4j.
>>JUnit throws the following errors for a test which works well without
>>Log4j
>>
>><<<<<<<<<<<<<<<<<
>>java.security.AccessControlException: access denied
>>(java.lang.RuntimePermission getClassLoader)
>>    at java.security.AccessControlContext.checkPermission(AccessControlContext.
>>java:272)
>>    at java.security.AccessController.checkPermission(AccessController.java:399)
>>
>>    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
>>
>>    at java.lang.ClassLoader.getParent(ClassLoader.java:692)
>>    at 
>org.apache.cactus.server.AbstractTestCaller.getTestClassInstance(AbstractTestCaller.java:290)
>><<<<<<<<<<<<<<<<<
>>
>>As you see, the error is thrown from
>>AbstractTestCaller.getTestClassInstance method in a part of code which
>>is only use in debug mode
>>( included in a block like this :
>><<<<<<<<<<<<<<if(logger.isDebugEnabled()) <<<<<<<<<<< )
>>The call to ClassLoader.getParent throws an AccesControlException.
>>
>>The question is why ? Must I add something into my java.security or
>>java.policy ? Why ?
>>
>
>I would say yes ! The container under which you're running is probably
>using a security manager that protects something. This part of the code
>retrieves the parent classloaders of the current class. Thus, I believe
>it is either the call to classLoader.getParent() or the getClassLoader()
>one that must be causing this security exception.
>
>Which container are you using ? (I have never seen this exception in any
>of the containers I have used Cactus with).
>

Well, this errors is thrown by the container provided with the j2sdkee1.3.
However i think the same error is raised when i use an other container 
like the IONA ( iPortal )  one.

>One solution is of course to disable the security check by modifying
>your policy file.
>
The problem is that i try to disable this security check by adding lines 
into my java.policy using the policytool but even if i have added  :

<<<<<<<<
grant {
  permission java.security.AllPermission;
}
<<<<<<<<<<< OR
grant {
  permission java.security.AllPermission;
  permission java.lang.RuntimePermission "getClassLoader";
  permission java.io.FilePermission "<<ALL FILES>>", "read, write, 
delete, execute";
};
<<<<<<<<<<<<

The problem still remains the same .... and i have try many combinaison 
( but not the good one )
I must admit that i am not a guru in security file and I don't see what 
to add more.
I use the same jdk ( and the same policy file in %JDK_PATH%\lib\security 
) for client and server side


Florent


Reply via email to