Announcement Announcement Module
Collapse
No announcement yet.
JoinPointMatch was NOT bound in invocation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:09 PM.

  • #2
    Please use [CODE] tag for easy reading.

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

    -Ramnivas

    Comment


    • #3
      Hi Ramnivas,

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

      Regards,
      Marco.

      Comment


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

        -Ramnivas

        Comment

        Working...
        X