SEC-1059: Hard dependency on AspectJ runtime when using AOP alliance MethodSecurityInterceptor #1310

Closed
spring-issuemaster opened this Issue Dec 12, 2008 · 2 comments

1 participant

@spring-issuemaster

Dan Diephouse (Migrated from SEC-1059) said:

It would seem to me that I shouldn’t have to AspectJ on the classpath when using AOP alliance. Here’s an example. My config:

echoComponentSecurity echoComponent

And here’s the exception I get when I don’t have AspectJ on the classpath:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘echoComponentSecurity’ defined in URL [file:/C:/workspaces/mule-2.x/modules/spring-security/target/test-classes/auth-component-security.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.resolveInterceptorNames(AbstractAutoProxyCreator.java:573)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.buildAdvisors(AbstractAutoProxyCreator.java:534)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:477)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:365)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1344)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
… 35 more
Caused by: java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at org.springframework.security.intercept.method.MethodDefinitionSourceEditor.setAsText(MethodDefinitionSourceEditor.java:72)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
… 51 more

@spring-issuemaster

Luke Taylor said:

The code which obtains the security metadata for a method invocation is designed to handle both MethodInvocation instances and JoinPoints. There are also other classes in the framework which are designed to handle both. Changing this would make the code more contrived and complicated and is something I’d prefer to avoid just to solve an unwanted dependency issue.

@spring-issuemaster spring-issuemaster added this to the 3.0.0 M1 milestone Feb 5, 2016
@spring-issuemaster

This issue duplicates #1159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment