Results 1 to 6 of 6

Thread: "Failed to bind all argument names" Error

  1. #1

    Default "Failed to bind all argument names" Error

    I'm receiving this error, and after searching the forums I've tried all previous solutions, including updating to 2.0.6, but nothing works.

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor': Cannot create inner bean '(inner bean)' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to bind all argument names: 1 argument(s) could not be bound
    Caused by: 
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to bind all argument names: 1 argument(s) could not be bound
    Caused by: 
    java.lang.IllegalStateException: Failed to bind all argument names: 1 argument(s) could not be bound
    	at org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.getParameterNames(AspectJAdviceParameterNameDiscoverer.java:282)
    	at org.springframework.core.PrioritizedParameterNameDiscoverer.getParameterNames(PrioritizedParameterNameDiscoverer.java:54)
    	at org.springframework.aop.aspectj.AbstractAspectJAdvice.bindArgumentsByName(AbstractAspectJAdvice.java:356)
    	at org.springframework.aop.aspectj.AbstractAspectJAdvice.calculateArgumentBindings(AbstractAspectJAdvice.java:317)
    	at org.springframework.aop.aspectj.AbstractAspectJAdvice.afterPropertiesSet(AbstractAspectJAdvice.java:283)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanDefinition(BeanDefinitionValueResolver.java:200)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:116)
    	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:329)
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:97)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:684)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:622)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:381)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    Here are the bean entries and the class:
    Code:
    <aop:config>
    		<aop:pointcut id="activtyExecution"
    			expression="execution(* com.company.esm.eputil.core.ActivityIfc.*(..))" />
    		<aop:aspect id="aroundExample" ref="TimerAspect">
    			<aop:around pointcut-ref="activtyExecution"  method="doBasicProfiling" />
    		</aop:aspect>
    	</aop:config>
    	<bean id="TimerAspect" class="com.company.esm.eputil.aop.TimerAspect" />
    Code:
    public class TimerAspect {
    	private Log log = LogFactory.getLog(TimerAspect.class);
    	//@Around("com.company.esm.eputil.aop.SystemArchitecture.timingOperation()")
    	  public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {
    	    log.info("Start: " + new Date());
    	    Object retVal = pjp.proceed();
    	    log.info("End: " + new Date());
    	    return retVal;
    	  }
    
    }
    Any help would be appreciated.
    Last edited by mecode; Sep 21st, 2007 at 01:49 PM. Reason: Grammar

  2. #2

    Default Wow

    Really frustrating. I can't even get this to work. Same error message. It works if I remove the JoinPoint params, but I thought that was how you could do it.

    I used Spring AOP during the 1.x days and loved it, but I'm about ready to give up on the 2.x Spring AOP.

    Code:
    public class TimerAspect {
    	private Log log = LogFactory.getLog(TimerAspect.class);
    	
    	  public void doBasicProfilingStart(JoinPoint jp) throws Throwable {
    	    log.info("Start: " + new Date() + jp.getKind());
    	  }
    	  
    	  public void doBasicProfilingEnd(JoinPoint jp) throws Throwable {
    		    log.info("End: " + new Date()+ jp.getKind());
    		  }
    
    }
    Code:
    <aop:config>
        <aop:aspect id="timingAspect" ref="TimerAspect" >
          <aop:before 
            method="doBasicProfilingStart"
            pointcut="execution(* com.company.esm.eputil.core.ActivityIfc.*(com.company.esm.eputil.core.ActivityProcessorIfc))" />
          <aop:after method="doBasicProfilingEnd" 
          pointcut="execution(* com.company.esm.eputil.core.ActivityIfc.*(com.company.esm.eputil.core.ActivityProcessorIfc))" />
        </aop:aspect>
      </aop:config>
    	
    <bean id="TimerAspect" class="com.company.esm.eputil.aop.TimerAspect" />

  3. #3

    Default

    Add argNames annotation parameter?

  4. #4

    Default

    Quote Originally Posted by plethora View Post
    Add argNames annotation parameter?
    With what value? The JoinPoint should be supplied by Spring automatically.

  5. #5

    Default

    I was thinking that spring perhaps wanted a "arg-names" attribute that specified the name of the "JoinPoint"/"ProceedingJoinPoint" parameter. However, it seems not to be the case.

    Can you provide some more details on your environment? Versions of Java, Spring, and the version of the AspectJ libraries used?

  6. #6

    Default

    Quote Originally Posted by plethora View Post
    Can you provide some more details on your environment? Versions of Java, Spring, and the version of the AspectJ libraries used?
    That was it...old aspectj versions. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •