-
May 17th, 2012, 02:06 AM
#1
Problem using spring dm + spring aop + spring restclient
Can anyone please help me , i having a very strange behavior , when my pointcut point to the bean i want to advise "bean("beanname")" , i worked fine , but when i remove the "bean("beanname")" and use exact class name when the application OsgiBundleXmlApplicationContext start i got the folowing exception
Caused by: java.lang.IllegalStateException: Expecting raw type, not: org.springframework.http.HttpEntity
at org.aspectj.weaver.TypeFactory.createParameterized Type(TypeFactory.java:37)
here is my spring.xml and my
spring osgi :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schem...pring-osgi.xsd
http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
<!--
Expose an instance of the SlingDispatcherServlet as an OSGi service. This is exposed in the global Spring
OSGi configuration file since this instance will initialize the configurations within the WEB-INF folder.
-->
<osgi:service ref="restClient" interface="com.tk.test.test.coreproductbundle.rest client.RestClient" >
</osgi:service>
</beans>
spring.xml :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.5.xsd
">
<aop:aspectj-autoproxy />
<bean id="testAop" class="com.tk.test.test.coreproductbundle.testaop. RestClientAop"></bean>
<bean id="restClient" class="com.tk.test.test.coreproductbundle.restclie nt.impl.RestClientImpl">
<property name="restTemplate" ref="restTemplate"></property>
</bean>
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate ">
<property name="messageConverters">
<list>
<bean id="converter" class="org.springframework.http.converter.StringHt tpMessageConverter"/>
</list>
</property>
</bean>
</beans>
Please Help!!
-
May 20th, 2012, 08:56 PM
#2
still no one answer
, i guess when the app context start it tried to create proxy for all bean in my xml , including the httpmessageconverter bean and ... , the problem is with the httpmessageconverter bean , when i made it more specific it created 1 proxy for restClient bean so it worked...,but it's still just my guess
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules