From 30f9b3e72cd359f350fb9b410e483135d91b3c9c Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Wed, 10 Dec 2008 16:57:40 +0000 Subject: [PATCH] SEC-995: AbstractSecurityInterceptor exception message improvement. Added the secured object to the exception message to make it easier to track down the originating method which causes a problem with public invocations. --- .../security/intercept/AbstractSecurityInterceptor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/springframework/security/intercept/AbstractSecurityInterceptor.java b/core/src/main/java/org/springframework/security/intercept/AbstractSecurityInterceptor.java index 1a1965350a..349a8fdabc 100644 --- a/core/src/main/java/org/springframework/security/intercept/AbstractSecurityInterceptor.java +++ b/core/src/main/java/org/springframework/security/intercept/AbstractSecurityInterceptor.java @@ -99,7 +99,7 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean, A MessageSourceAware { //~ Static fields/initializers ===================================================================================== - protected static final Log logger = LogFactory.getLog(AbstractSecurityInterceptor.class); + protected final Log logger = LogFactory.getLog(getClass()); //~ Instance fields ================================================================================================ @@ -175,10 +175,10 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean, A if (attributes == null) { if (rejectPublicInvocations) { - throw new IllegalArgumentException( - "No public invocations are allowed via this AbstractSecurityInterceptor. " + throw new IllegalArgumentException("Secure object invocation " + object + + " was denied as public invocations are not allowed via this interceptor. " + "This indicates a configuration error because the " - + "AbstractSecurityInterceptor.rejectPublicInvocations property is set to 'true'"); + + "rejectPublicInvocations property is set to 'true'"); } if (logger.isDebugEnabled()) {