Announcement Announcement Module
No announcement yet.
AOP over HttpInvokerProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP over HttpInvokerProxyFactoryBean

    Seems like this class doesn't extend org.springframework.aop.framework.ProxyConfig, so how is it possible to use other interceptors with this? The JVM gen'd proxy is a final class so it can't be proxied again by CGlib.


  • #2
    You should be able to use the HttpInvokerClientInterceptor instead, which is essentially the same, except for the fact that it's not a FactoryBean, so doesn't create proxies itself.

    Just use a normal ProxyFactoryBean in combination with the HttpInvokerClientInterceptor (and any other interceptors you'd like to add) and you'll be fine.

    Alef Arendsen


    • #3
      Thanks for the feedback. I am trying to figure out how to set this up. It seems to work if I use the HttpClientInvokerInterceptor as the only interceptor with ProxyFactoryBean (and specify the proxyInterfaces). However when I add a second interceptor before it, SimpleTraceInterceptor in my case, I get odd exceptions. I've tried a few configurations and here is the one I am working with right now:

      <bean id="tracer2" class="org.springframework.aop.interceptor.SimpleT raceInterceptor"/>

      <bean id="cc_client__" class="org.springframework.remoting.httpinvoker.Ht tpInvokerClientInterceptor">
      <property name="serviceUrl" value="${endpoint.root}/ContractAdmin"/>

      <bean id="cc_client" class="org.springframework.aop.framework.ProxyFact oryBean">
      <property name="interceptorNames" value="tracer2,cc_client__"/>
      <property name="proxyInterfaces" value="IContractAdmin"/>

      It starts up alright but whenever I run a method on the proxy, I just get a NullPointerException like so:

      at org.springframework.aop.interceptor.SimpleTraceInt erceptor.getInvocationDescription(SimpleTraceInter
      at org.springframework.aop.interceptor.SimpleTraceInt erceptor.invokeUnderTrace(SimpleTraceInterceptor.j ava:55)
      at org.springframework.aop.interceptor.AbstractTraceI nterceptor.invoke( )
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :144)
      at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(
      at $Proxy0.getBillCycleDelay(Unknown Source)

      Any ideas on this one? Maybe I have configured it wrong? Thanks.


      • #4
        I find it strange that HttpInvokerProxyFactoryBean doesn't extends ProxyFactoryBean... it would be to easy ;-)

        Did you get it working? I would appreciate any help with this. Thanks!