Announcement Announcement Module
Collapse
No announcement yet.
Problems Overriding ScriptFactoryPostProcessor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems Overriding ScriptFactoryPostProcessor

    Hi All,

    I'm extending Springs(2.5.6) built in script support, Groovy in my case, so I can pull the script source from a database.

    I'm having a strange AOP error, which looks related to a classloader problem:

    Code:
    Caused by: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine annotations of missing type groovy.DefaultPasswordControl
     [Xlint:cantFindType]
    	at org.aspectj.weaver.reflect.ReflectionWorld$ExceptionBasedMessageHandler.handleMessage(ReflectionWorld.java:163)
    	at org.aspectj.weaver.Lint$Kind.signal(Lint.java:287)
    	at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.raiseCantFindType(MissingResolvedTypeWithKnownSignature.java:198)
    	at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.hasAnnotation(MissingResolvedTypeWithKnownSignature.java:152)
    	at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.fastMatches(ExactAnnotationTypePattern.java:65)
    	at org.aspectj.weaver.patterns.WithinAnnotationPointcut.fastMatch(WithinAnnotationPointcut.java:82)
    	at org.aspectj.weaver.patterns.AndPointcut.fastMatch(AndPointcut.java:48)
    	at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:78)
    	at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:235)
    	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:195)
    	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:250)
    	at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:284)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:113)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:85)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
    	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)
    	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.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:764)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:399)
    	... 93 more
    Here are the relevant bits of configuration:

    Code:
    <bean id="scriptFactoryPostProcessor" class="com.opterus.opscenter.shared.script.CustomScriptFactoryPostProcessor"/>
    
    <lang:defaults refresh-check-delay="1200000"/>
    <lang:groovy id="passwordControl" scope="request" script-source="classpath:groovy/PasswordControl.groovy"/>
    And the class itself, which doesn't do anything but forward a single call:
    Code:
    public class CustomScriptFactoryPostProcessor extends ScriptFactoryPostProcessor
    {
        @Override
        protected ScriptSource convertToScriptSource( String beanName, String scriptSourceLocator, ResourceLoader resourceLoader )
        {
        	return super.convertToScriptSource( beanName, scriptSourceLocator, resourceLoader );
        }
    }
    If I remove my CustomScriptFactoryPostProcessor bean from the configuration, everything works properly!

    Has anyone seen something like this, or know how to fix it?

    Thanks in advance!

  • #2
    Here is a bit more info, as it looks like the bean is being auto proxied:

    Code:
    Caused by: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine annotations of missing type groovy.DefaultPasswordControl
     [Xlint:cantFindType]
    	at org.aspectj.weaver.reflect.ReflectionWorld$ExceptionBasedMessageHandler.handleMessage(ReflectionWorld.java:163)
    	at org.aspectj.weaver.Lint$Kind.signal(Lint.java:287)
    	at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.raiseCantFindType(MissingResolvedTypeWithKnownSignature.java:198)
    	at org.aspectj.weaver.MissingResolvedTypeWithKnownSignature.hasAnnotation(MissingResolvedTypeWithKnownSignature.java:152)
    	at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.fastMatches(ExactAnnotationTypePattern.java:65)
    	at org.aspectj.weaver.patterns.WithinAnnotationPointcut.fastMatch(WithinAnnotationPointcut.java:82)
    	at org.aspectj.weaver.patterns.AndPointcut.fastMatch(AndPointcut.java:48)
    	at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:78)
    	at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:235)
    	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:195)
    	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:250)
    	at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:284)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:113)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:85)
    	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
    	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)
    	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.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:764)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:399)

    Comment


    • #3
      This looks like the Groovy classloader and the AspectJ classloader problem that is supposed to be fixed that is talked about in various forum posts.

      I'm not sure what my next steps should be....

      Comment

      Working...
      X