Results 1 to 4 of 4

Thread: JoinPointMatch was NOT bound in invocation

  1. #1

    Exclamation JoinPointMatch was NOT bound in invocation

    Hi there,

    I've faced with a frustrating problem that I just can't seem to solve.

    I have a service that searches Events, and have written a simple aspect that uses a blocking cache instance to cache these Events. Pretty simple right? My aspect is never invoked, and the attached stacktrace is thrown.

    Below are the relevant code snippets and stacktrace. If needed, I can post any other relevant code. I really hope someone can help!

    Thanks in advance,
    Marco.

    My spring config:
    Code:
        <!-- Search Service and Cache -->
        <bean id="cacheManager" class="net.sf.ehcache.CacheManager" factory-method="getInstance"/>
    
        <bean id="searchResultsBlockingCache" class="uk.co.and.tin.cache.SearchResultsBlockingCache">
            <constructor-arg ref="cacheManager"/>
            <property name="timeoutMillis" value="500"/>
        </bean>
        
        <bean id="searchResultsCacheAspect" class="uk.co.and.tin.advice.SearchResultsCacheAspect">
            <property name="cache" ref="searchResultsBlockingCache"/>
        </bean>
        
        <aop:config>
            <aop:aspect ref="searchResultsCacheAdvice">
                <aop:pointcut id="executeSearchEvents" 
                    expression="execution(* uk.co.and.services.search.IEventSearchServices.searchEvents(..))
                    and args(queryParameters, synchBinds, site)"/>
                <aop:around pointcut-ref="executeSearchEvents" method="fetchFromCache" />
            </aop:aspect>
        </aop:config>
        
        <bean id="eventSearchServices" class="uk.co.and.services.search.EventSearchServices" parent="searchServices" />
    My Aspect class:
    Code:
    public class SearchResultsCacheAspect {
        private SearchResultsBlockingCache cache;
        
        public Object fetchFromCache(ProceedingJoinPoint call, EventListingsSearchCommand queryParameters, boolean synchBinds, Site site) throws Throwable{
            String key = generateCacheKey(queryParameters, site);
            Element element = cache.get(key);
            SearchResults results = null;
            if(element == null){
                results = (SearchResults) call.proceed();
                Element newEntry = new Element(key, results);
                cache.put(newEntry);
                
            } else {
                results = (SearchResults) element.getValue();
            }
            
            return results;
        }
    
        //some more methods
    }
    The interface of the target:
    Code:
    public interface IEventSearchServices extends ISearchServices{    
        SearchResults searchEvents(EventListingsSearchCommand queryParameters, boolean synchBinds, Site site) throws Exception;
    
    }
    Called from a controller by:
    Code:
    SearchResults searchResults = eventSearchServices.searchEvents(thisCommand, false, site);
    Upon running this code, I get the following lovely stacktrace

    Code:
    java.lang.IllegalStateException: Required to bind 4 arguments, but only bound 1 (JoinPointMatch was NOT bound in invocation)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.argBinding(AbstractAspectJAdvice.java:590)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy21.searchEvents(Unknown Source)
        at uk.co.and.tin.web.controller.EventListingsSearchFormController.formBackingObject(EventListingsSearchFormController.java:76)
        at org.springframework.web.servlet.mvc.AbstractFormController.getCommand(AbstractFormController.java:431)
        at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:262)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)
    Last edited by marco.vermeulen; Apr 11th, 2009 at 05:09 PM.

  2. #2
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default

    Please use [CODE] tag for easy reading.

    At the first glance, your setup seems fine. Which Spring version are you using?

    -Ramnivas
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

  3. #3

    Default

    Hi Ramnivas,

    Thanks for your reply, I really appreciate it! I am currently using Spring 2.5.4.

    Regards,
    Marco.

  4. #4
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default

    I suggest that you try Spring 2.5.6. If you still see the problem, please file a JIRA issue.

    -Ramnivas
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

Tags for this Thread

Posting Permissions

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