Announcement Announcement Module
Collapse
No announcement yet.
XMLRPC Problem with AOP Proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XMLRPC Problem with AOP Proxy

    using Spring with xmlrpc I have the following problem.
    I'm trying to initialize the bean xmlRpcHandlerMapping
    that when not involved in a proxy and the error occurs when registering in HandlerMapping methods because the ServiceBean is a org.springframework.aop.framework.JdkDynamicAopPro xy object
    How can I do to initialize the bean?
    my configuration :

    Code:
    	<bean id="xmlRpcController" class="cl.bbr.xmlrpctesting.controller.XmlRpcController">
    		<property name="mapping" ref="xmlRpcHandlerMapping" />
    	</bean>
     
    	<bean id="ObjectiveServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.ObjectiveServiceImpl">
    		<property name="objectiveWrapperService" ref="wrapper"></property>
    	</bean>
    	
    	<bean id="ReferenceDataServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.ReferenceDataServiceImpl">
    		<property name="referenceDataWrapperService" ref="referenceDataWrapperServiceBean"/>
    	</bean>
    	<bean id="TradeLocationServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.TradeLocationServiceImpl"/>
    
    	<bean id="wrapper" class="cl.bbr.modulos.xmlrpc.test.wrappers.ObjectiveXmlRPCWrapped"/>
    	<bean id="referenceDataWrapperServiceBean" class="cl.bbr.modulos.xmlrpc.test.wrappers.ReferenceDataXmlRPCWrapped"/>
    	
    	<bean id="xmlRpcHandlerMapping" class="cl.bbr.xmlrpctesting.handlermapping.SimpleHandlerMapping" init-method="init">
    			<constructor-arg>
    				<map>
    					<entry key="ObjectiveService" 	  value-ref="ObjectiveServiceBean" />
    					<entry key="ReferenceDataService" value-ref="ReferenceDataServiceBean" />
    					<entry key="TradeLocationService" value-ref="TradeLocationServiceBean" />
    				</map>
    		</constructor-arg>
    	</bean>
    	
    	<bean id="logHandlerExceptions" class="cl.bbr.modulos.xmlrpc.exceptions.HandlerException"/>
    
    	<aop:config>
    		<aop:aspect id="afterThrowingLog" ref="logHandlerExceptions">
    			<aop:after-throwing method="afterThrowing" 
    								pointcut="execution(* *..services.*.*(..))" throwing="ex" arg-names="ex" />
    		</aop:aspect>
    	</aop:config>

    this beans are wrapped in a poxy and they are injected in xmlRpcHandlerMapping bean...
    Code:
    <bean id="ObjectiveServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.ObjectiveServiceImpl">
    		<property name="objectiveWrapperService" ref="wrapper"></property>
    	</bean>
    	
    	<bean id="ReferenceDataServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.ReferenceDataServiceImpl">
    		<property name="referenceDataWrapperService" ref="referenceDataWrapperServiceBean"/>
    	</bean>
    	<bean id="TradeLocationServiceBean" class="cl.bbr.modulos.xmlrpc.test.servicesImpl.TradeLocationServiceImpl"/>

    Code:
    		proccesorFactory = new SimpleRequestProcessorFactoryFactory();
    
    		for (Object serviceBean : servicesMapping.values()) {
            	proccesorFactory.registerServiceBean(serviceBean.getClass(), serviceBean);
            }
            // Setear RequestFactoryFactory que sera  usado por el mapping
            setRequestProcessorFactoryFactory(proccesorFactory);
    
            Iterator<Entry<String, Object>> it = servicesMapping.entrySet().iterator();
            while (it.hasNext()) {
                Entry<String, Object> entry = it.next();
                String serviceName = entry.getKey();
                Object serviceBean = entry.getValue();
            	registerPublicMethods(serviceName, serviceBean.getClass());
            }
    	}
    The problem occurs here:
    Code:
    registerPublicMethods(serviceName, serviceBean.getClass());
    The exception is
    Code:
    GRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlRpcController' defined in ServletContext resource [/WEB-INF/application-context.xml]: Cannot resolve reference to bean 'xmlRpcHandlerMapping' while setting bean property 'mapping'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlRpcHandlerMapping' defined in ServletContext resource [/WEB-INF/application-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid parameter or result type: org.springframework.aop.Advisor
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xmlRpcHandlerMapping' defined in ServletContext resource [/WEB-INF/application-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid parameter or result type: org.springframework.aop.Advisor
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    ....

    Thanks!!!
    Last edited by JoseBovet; Jan 28th, 2010, 08:34 AM.
Working...
X