On Fri, 2010-01-29 at 09:38 +0200, Martin Asenov wrote:
> Hello guys! Very strange exception occurred yesterday when trying to set 
> IAuthorizationStrategy to my webapp. Here's the exception:
> 
> SEVERE: An exception or error occurred in the container during the request 
> processing
> java.lang.OutOfMemoryError: Java heap space at 
> java.util.Arrays.copyOfRange(Arrays.java:3209)
> 
> these are the first 2 lines of the exception. Here's my MyAythStrategy class:
> 
> public class MyAuthStrategy implements IAuthorizationStrategy {
>       
>       private UserContext context = ((AppSession)Session.get()).getContext();
Move this to be a local variable in #isInstantiationAuthorized(Class).
This is not the cause of OOM but the session (respectively the context)
should be get per request.
>       
>       public MyAuthStrategy() {}
>       
>       public boolean isActionAuthorized(Component arg0, Action arg1)
>       {
>               return true;
>       }
>       
>       public <T extends Component> boolean isInstantiationAuthorized(Class<T> 
> componentClass)
>       {
> 
>               if (BaseFrame.class.isAssignableFrom(componentClass)) {
>                       
>                       if 
> (AdministrationPage.class.isAssignableFrom(componentClass)) {
>                               if (context.getRole().equals(Role.ROOT) || 
> context.getRole().equals(Role.ADMIN))
>                                       return true;
>                               else
>                                       throw new 
> RestartResponseAtInterceptPageException(AccessDeniedPage.class);
>                       } else if 
> (DomainRequiredPage.class.isAssignableFrom(componentClass)) {
>                               if (context.getDomain() == null)
>                                       throw new 
> RestartResponseAtInterceptPageException(AccessDeniedPage.class);
>                               else 
>                                       return true;
>                       }                               
>               }
>               return true;
>               
>       }
>       
> }
> 
> AdministrationPage and DomainRequiredPage are my tagging interfaces.
> 
> When I set that strategy to my webapp I get the above mentioned exception.
> 
> Hope someone helps! 
> 
> Thanks,
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to