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.
ja
> va: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(Abstrac
tT
> estCaller.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).

One solution is of course to disable the security check by modifying
your policy file.

> 
> Florent

-Vincent




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to