Run time exception IlligalStateException

1,163 views
Skip to first unread message

Owl

unread,
Jun 14, 2010, 3:54:57 PM6/14/10
to Ehcache Spring Annotations
I am having problem injecting a bean that was made cacheable. During
start-up I get IlligalState exception telling me this

Cannot convert value of type [$Proxy13 implementing
org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [ms.ps.announcement.dao.ProductDao] for property
'productDao': no matching editors or conversion strategy found.

Here is how productDao is defined:
<bean id="productDao" class="ms.ps.announcement.dao.ProductDao">
<property name="sqlMapClient" ref="sqlPrismMapClient" />
</bean>

Here is where it's being injected:
<bean id="annDataDao"
class="ms.ps.announcement.dao.AnnouncementDataDao">
<property name="productDao" ref="productDao" />
</bean>

Here is how cache is being configured:
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:ms/ps/config/
ehcache.xml" />
</bean>

<ehcache:annotation-driven cache-manager="cacheManager" />
<bean id="myKeyGenerator"
class="com.googlecode.ehcache.annotations.key.HashCodeCacheKeyGenerator">
<property name="includeMethod" value="false"/>
</bean>

Thank you

Eric Dalquist

unread,
Jun 14, 2010, 3:57:19 PM6/14/10
to ehcache-sprin...@googlegroups.com
Is ProductDao defined by an interface? The Spring auto-proxy code is setup to create proxies of classes defined by an interface and inject a proxy of the interface into other classes.

Owl

unread,
Jun 14, 2010, 4:04:00 PM6/14/10
to Ehcache Spring Annotations
ProductDao is defined as a class, just as in your example. See below.

public class ProductDao extends SqlMapClientDaoSupport {
@Cacheable(cacheName = "ProductCache", keyGeneratorName =
"myKeyGenerator")
public Product getProductByTapsCusip(String tapsCusip) {
...

I also made an interface, at some point, for the method signature of
this class and applied @Cacheable to it, but that didn't work either.
I was getting different exception then.

On Jun 14, 3:57 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> Is ProductDao defined by an interface? The Spring auto-proxy code is setup
> to create proxies of classes defined by an interface and inject a proxy of
> the interface into other classes.
>

Eric Dalquist

unread,
Jun 14, 2010, 4:06:43 PM6/14/10
to ehcache-sprin...@googlegroups.com
You should create a ProductDao interface that includes all needed methods then create a ProductDaoImpl that implements it and contains the annotations on the interface methods. That will let Spring create a proxy that can be injected into your other classes.

Owl

unread,
Jun 14, 2010, 4:19:45 PM6/14/10
to Ehcache Spring Annotations
Did as was suggested - no exceptions during configuration stage, but
there was exception when the method was called. See below.

<org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named
'com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor#0'
must be of type [org.aopalliance.aop.Advice], but was actually of type
[com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
349)
...


On Jun 14, 4:06 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> You should create a ProductDao interface that includes all needed methods
> then create a ProductDaoImpl that implements it and contains the annotations
> on the interface methods. That will let Spring create a proxy that can be
> injected into your other classes.
>

Eric Dalquist

unread,
Jun 14, 2010, 4:23:13 PM6/14/10
to ehcache-sprin...@googlegroups.com
Could you please include the entire stack trace?

Owl

unread,
Jun 14, 2010, 4:25:31 PM6/14/10
to Ehcache Spring Annotations
Error org/apache/catalina/core/ContainerBase/[Catalina]/[localhost]/[/
FailProof]/[spring-ws] Servlet.service() for servlet spring-ws threw
exception
<org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named
'com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor#0'
must be of type [org.aopalliance.aop.Advice], but was actually of type
[com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
349)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
194)
at
org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor.getAdvice(AbstractBeanFactoryPointcutAdvisor.java:
80)
at
org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.getInterceptors(DefaultAdvisorAdapterRegistry.java:
78)
at
org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(DefaultAdvisorChainFactory.java:
61)
at
org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:
482)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:
188)
at $Proxy13.getProductByTapsCusip(Unknown Source)
at
ms.ps.announcement.dao.AnnouncementDataDao.getAnnouncementData(AnnouncementDataDao.java:
71)
at
ms.ps.adjustment.endpoint.GetPositionAdjustmentEndpoint.setAnnouncementData(GetPositionAdjustmentEndpoint.java:
83)
at
ms.ps.adjustment.endpoint.GetPositionAdjustmentEndpoint.setResponseData(GetPositionAdjustmentEndpoint.java:
56)
at
ms.ps.adjustment.endpoint.GetPositionAdjustmentEndpoint.getPositionAdjustments(GetPositionAdjustmentEndpoint.java:
46)
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.springframework.ws.server.endpoint.MethodEndpoint.invoke(MethodEndpoint.java:
115)
at
org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter.invokeInternal(MarshallingMethodEndpointAdapter.java:
136)
at
org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter.invoke(AbstractMethodEndpointAdapter.java:
58)
at
org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:
227)
at
org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:
169)
at
org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:
88)
at
org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:
57)
at
org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:
230)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
644)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:
560)
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
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.coyote.http11.Http11Processor.process(Http11Processor.java:
873)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
81)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)


On Jun 14, 4:23 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> Could you please include the entire stack trace?
>

Owl

unread,
Jun 14, 2010, 4:27:38 PM6/14/10
to Ehcache Spring Annotations
Do I also need this included in Spring configuration file?

<aop:aspectj-autoproxy proxy-target-class="true" />

Eric Dalquist

unread,
Jun 14, 2010, 4:27:48 PM6/14/10
to ehcache-sprin...@googlegroups.com
What version of Spring are you using?

Owl

unread,
Jun 14, 2010, 4:30:21 PM6/14/10
to Ehcache Spring Annotations
According to JARs it is 3.0.2. Is there any particular JAR do you want
me to check the version of?

On Jun 14, 4:27 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> What version of Spring are you using?
>

Eric Dalquist

unread,
Jun 14, 2010, 4:31:39 PM6/14/10
to ehcache-sprin...@googlegroups.com
No, the library doesn't use aspectj for proxying.

I'm confused by the stack trace though. It is claiming that EhCacheInterceptor doesn't implement Advice but it does, you can look at the JavaDocs to see that:
http://ehcache-spring-annotations.googlecode.com/svn/site/current/apidocs/com/googlecode/ehcache/annotations/interceptor/EhCacheInterceptor.html

Spring 3.0.2 should work.

Can you attach your entire spring context XML to an email (remove any sensitive info of course)

-Eric

Owl

unread,
Jun 14, 2010, 4:38:33 PM6/14/10
to Ehcache Spring Annotations
Did you get my Spring context XML? I sent it via "Reply to author"
link.

On Jun 14, 4:31 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> No, the library doesn't use aspectj for proxying.
>
> I'm confused by the stack trace though. It is claiming that
> EhCacheInterceptor doesn't implement Advice but it does, you can look at the
> JavaDocs to see that:http://ehcache-spring-annotations.googlecode.com/svn/site/current/api...
>
> Spring 3.0.2 should work.
>
> Can you attach your entire spring context XML to an email (remove any
> sensitive info of course)
>
> -Eric
>
> ...
>
> read more »

Owl

unread,
Jun 14, 2010, 5:06:34 PM6/14/10
to Ehcache Spring Annotations
Well, look according to the JavaDoc EhCacheInterceptor implements
org.aopalliance.intercept.MethodInterceptor interface, but exception
refers to org.aopalliance.aop.Advice interface.
> ...
>
> read more »

Eric Dalquist

unread,
Jun 14, 2010, 5:15:56 PM6/14/10
to ehcache-sprin...@googlegroups.com
Right, and MethodIntercetpor extends Interceptor which extends Advice, therefore EhCacheInterceptor actually implements all three of those interfaces.

What sort of environment are you running this in? Could you have multiple aop-alliance jars in use or multiple classloaders?

Owl

unread,
Jun 14, 2010, 5:42:57 PM6/14/10
to Ehcache Spring Annotations
That what I was thinking: I may have some kind of conflict of JARs. I
am running a project in Eclipse. Do you know what JARs me conflict in
defining AOP?
Here is the list of JARs in the project. Any suspects?

aopalliance.jar
aspectjweaver.jar
axiom-api-1.2.8.jar
axiom-impl-1.2.8.jar
cglib-nodep-2.2.0.jar
ehcache-core-2.1.0.jar
ehcache-spring-annotations-1.0.4.jar
ibatis-2.3.4.726.jar
jconn3.jar
log4j-1.2.16.jar
msjava_base_backcompat.jar
msjava_base.jar
msjava_dbpool.jar
msjava_kerberos.jar
msjava_management.jar
msjava_msenvironment.jar
msjava_mslog.jar
msjava_pool.jar
org.springframework.aop-3.0.2.RELEASE.jar
org.springframework.asm-3.0.2.RELEASE.jar
org.springframework.aspects-3.0.2.RELEASE.jar
org.springframework.beans-3.0.2.RELEASE.jar
org.springframework.context-3.0.2.RELEASE.jar
org.springframework.context.support-3.0.2.RELEASE.jar
org.springframework.core-3.0.2.RELEASE.jar
org.springframework.expression-3.0.2.RELEASE.jar
org.springframework.instrument-3.0.2.RELEASE.jar
org.springframework.instrument.tomcat-3.0.2.RELEASE.jar
org.springframework.jdbc-3.0.2.RELEASE.jar
org.springframework.jms-3.0.2.RELEASE.jar
org.springframework.orm-3.0.2.RELEASE.jar
org.springframework.oxm-3.0.2.RELEASE.jar
org.springframework.test-3.0.2.RELEASE.jar
org.springframework.transaction-3.0.2.RELEASE.jar
org.springframework.web-3.0.2.RELEASE.jar
org.springframework.web.portlet-3.0.2.RELEASE.jar
org.springframework.web.servlet-3.0.2.RELEASE.jar
org.springframework.web.struts-3.0.2.RELEASE.jar
slf4j-api-1.5.10.jar
spring-aop-1.2.6-sources.jar
spring-modules-cache-0.8a.jar
spring-ws-2.0.0-M1-all.jar
wsdl4j-1.6.1.jar
XmlSchema-1.4.3.jar


On Jun 14, 5:15 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> Right, and MethodIntercetpor extends Interceptor which extends Advice,
> therefore EhCacheInterceptor actually implements all three of those
> interfaces.
>
> What sort of environment are you running this in? Could you have multiple
> aop-alliance jars in use or multiple classloaders?
>
> ...
>
> read more »

Eric Dalquist

unread,
Jun 14, 2010, 5:50:33 PM6/14/10
to ehcache-sprin...@googlegroups.com
What is in spring-aop-1.2.6-sources.jar?

Also using Eclipse you can use the Open Type option and do "Advice" it will show you multiple versions of the same class from different jars

Owl

unread,
Jun 14, 2010, 6:04:31 PM6/14/10
to Ehcache Spring Annotations
Aha!!! This is where I see Advice defined in org.aopalliiance.aop
package. I also see intercept package with Interceptor class. And
there is another JAR with Interceptor class (but no Advice) -
aopalliance.jar. This one doesn't have a lot: instrument, intercept
and reflect packages. So, which one do I need to include?

On Jun 14, 5:50 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> What is in spring-aop-1.2.6-sources.jar?
>
> Also using Eclipse you can use the Open Type option and do "Advice" it will
> show you multiple versions of the same class from different jars
>
> ...
>
> read more »

Eric Dalquist

unread,
Jun 14, 2010, 6:11:03 PM6/14/10
to ehcache-sprin...@googlegroups.com
I'm not sure, that depends on why each one is in your project. My
guess would be to remove spring-aop-1.2.6-sources.jar

-Eric

Owl

unread,
Jun 14, 2010, 6:34:24 PM6/14/10
to Ehcache Spring Annotations
Well, if I remove spring-aop-1.2.6-sources.jar I will be without
definition of the Aspect. I removed the other one and everything
worked. I tested and got expected results.

Thanks a lot for your help. Your framework ROCKS! We will give it a
try in our projects.

Yury

On Jun 14, 6:11 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> I'm not sure, that depends on why each one is in your project. My
> guess would be to remove spring-aop-1.2.6-sources.jar
>
> -Eric
>
> ...
>
> read more »

Eric Dalquist

unread,
Jun 14, 2010, 7:01:28 PM6/14/10
to ehcache-sprin...@googlegroups.com
Glad you got it figured out and glad the library is working well for you!

Our 1.1 release is due out 'very soon now' and has some neat new features.

-Eric

lythanh

unread,
Jul 26, 2010, 3:49:56 AM7/26/10
to Ehcache Spring Annotations
I am having the same problem when spring creating bean, if I remove
ehcache annotation lines:

<ehcache:annotation-driven cache-manager="ehCacheManager" />

<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:ehcache.xml" />
</bean>

my application work fine, but when I add these line, I got following
exception when start.
How is my problem, I have check for lib config and use Interface but
still have problem.

[DEBUG,DefaultListableBeanFactory] Creating shared instance of
singleton bean 'branchManager'
[DEBUG,DefaultListableBeanFactory] Creating instance of bean
'branchManager'
[DEBUG,DefaultListableBeanFactory] Eagerly caching bean
'branchManager' to allow for resolving potential circular references
[DEBUG,DefaultListableBeanFactory] Returning cached instance of
singleton bean 'branchDao'
[DEBUG,BeanUtils] No property editor
[com.vietinbank.ipay.branch.dao.BranchDaoEditor] found for type
com.vietinbank.ipay.branch.dao.BranchDao according to 'Editor' suffix
convention
[INFO,DefaultListableBeanFactory] Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@a7681:
defining beans
[dataSource,org.springframework.aop.config.internalAutoProxyCreator,com.googlecode.ehcache.annotations.key.CachingReflectionHelper,com.googlecode.ehcache.annotations.key.ListCacheKeyGenerator.DEFAULT_BEAN_NAME,com.googlecode.ehcache.annotations.key.HashCodeCacheKeyGenerator.DEFAULT_BEAN_NAME,com.googlecode.ehcache.annotations.key.MessageDigestCacheKeyGenerator.DEFAULT_BEAN_NAME,com.googlecode.ehcache.annotations.key.ReflectionHashCodeCacheKeyGenerator.DEFAULT_BEAN_NAME,com.googlecode.ehcache.annotations.key.StringCacheKeyGenerator.DEFAULT_BEAN_NAME,com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0,com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0,com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor#0,com.googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor,ehCacheManager,RetailIbACCDAO,IbCurrentcyDao,RetailIbCifDAO,RetailIbCifServDAO,RetailIBSysParDAO,RetailIBAuthenDAO,branchDao,userDao,userTxDao,roleDao,activityDao,bankUserDao,authenTokenDao,serviceTDao,serviceTManager,menuDao,menuManager,serviceDao,serviceManager,historyDao,tokenDao,historyManager,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,transactionManager,placeholderConfig,sessionRegistry,hqLdapAuthenticator,hqLdapAuthenticationProvider,userDetailsService,customAuthenticationProvider,ldapBankUserService,createUser,userTxManager,branchManager,roleManager,activityManager,bankUserManager,IbCurrencyManager,RetailIbAccManager,RetailIbCifManager,RetailIbCifServManager,RetailIBSysParManager,RetailIbAuthenManager,org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.access.channel.ChannelDecisionManagerImpl#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0,org.springframework.security.filterChainProxy,appLdapServer,org.springframework.security.core.userdetails.memory.InMemoryDaoImpl#0,org.springframework.security.authentication.dao.DaoAuthenticationProvider#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager];
root of factory hierarchy
[DEBUG,DefaultListableBeanFactory] Retrieved dependent beans for bean
'com.googlecode.ehcache.annotations.key.CachingReflectionHelper':
[com.googlecode.ehcache.annotations.key.HashCodeCacheKeyGenerator.DEFAULT_BEAN_NAME,
com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0,
com.googlecode.ehcache.annotations.key.ListCacheKeyGenerator.DEFAULT_BEAN_NAME,
com.googlecode.ehcache.annotations.key.MessageDigestCacheKeyGenerator.DEFAULT_BEAN_NAME,
com.googlecode.ehcache.annotations.key.ReflectionHashCodeCacheKeyGenerator.DEFAULT_BEAN_NAME,
com.googlecode.ehcache.annotations.key.StringCacheKeyGenerator.DEFAULT_BEAN_NAME]
[DEBUG,DefaultListableBeanFactory] Retrieved dependent beans for bean
'com.googlecode.ehcache.annotations.key.HashCodeCacheKeyGenerator.DEFAULT_BEAN_NAME':
[com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0]
[DEBUG,DefaultListableBeanFactory] Retrieved dependent beans for bean
'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0':
[com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0,
com.googlecode.ehcache.annotations.interceptor.EhCacheInterceptor#0]
[DEBUG,DefaultListableBeanFactory] Retrieved dependent beans for bean
'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0':
[com.googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor]
[DEBUG,DisposableBeanAdapter] Invoking destroy() on bean with name
'com.googlecode.ehcache.annotations.key.CachingReflectionHelper'
[DEBUG,DisposableBeanAdapter] Invoking destroy() on bean with name
'ehCacheManager'
[INFO,EhCacheManagerFactoryBean] Shutting down EHCache CacheManager
[ERROR,ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'branchManager' defined in ServletContext
resource [/WEB-INF/spring-contexts/service.xml]: Initialization of
bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to
convert property value of type '$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type 'com.vietinbank.ipay.branch.dao.BranchDao' for
property 'branchDao'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
527)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
574)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
425)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
276)
at
com.vietinbank.ipay.listener.StartupListener.createWebApplicationContext(StartupListener.java:
50001)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
197)
at
com.vietinbank.ipay.listener.StartupListener.initWebApplicationContext(StartupListener.java:
50001)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
47)
at
com.vietinbank.ipay.listener.StartupListener.contextInitialized(StartupListener.java:
42)
at weblogic.servlet.internal.EventsManager
$FireContextListenerAction.run(EventsManager.java:465)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:
321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:
175)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:
1784)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:
2999)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:
1371)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:
468)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:
37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:
60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:
200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:
117)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:
37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:
60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:
27)
at weblogic.application.internal.BaseDeployment
$2.next(BaseDeployment.java:635)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:
37)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:
212)
at
weblogic.application.internal.EarDeployment.activate(EarDeployment.java:
16)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:
162)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:
79)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:
569)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:
140)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:
106)
at
weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:
143)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:
323)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:
820)
at
weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:
1227)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:
436)
at
weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:
163)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:
181)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access
$100(DeploymentReceiverCallbackDeliverer.java:12)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer
$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at weblogic.work.SelfTuningWorkManagerImpl
$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type '$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type 'com.vietinbank.ipay.branch.dao.BranchDao' for
property 'branchDao'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:
462)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
499)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
493)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:
1363)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
1322)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:
1076)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
517)
... 52 more
Caused by: java.lang.IllegalStateException: Cannot convert value of
type [$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:
231)
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:
447)
... 58 more
<Jul 26, 2010 2:32:43 PM ICT> <Warning> <HTTP> <BEA-101162> <User
defined listener com.vietinbank.ipay.listener.StartupListener failed:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'branchManager' defined in ServletContext
resource [/WEB-INF/spring-contexts/service.xml]: Initialization of
bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to
convert property value of type '$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type 'com.vietinbank.ipay.branch.dao.BranchDao' for
property 'branchDao'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy
found.
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'branchManager' defined in ServletContext
resource [/WEB-INF/spring-contexts/service.xml]: Initialization of
bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to
convert property value of type '$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type 'com.vietinbank.ipay.branch.dao.BranchDao' for
property 'branchDao'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
527)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
288)
Truncated. see log file for complete stacktrace
org.springframework.beans.ConversionNotSupportedException: Failed to
convert property value of type '$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type 'com.vietinbank.ipay.branch.dao.BranchDao' for
property 'branchDao'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:
462)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
499)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
493)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:
1363)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
1322)
Truncated. see log file for complete stacktrace
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:
231)
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:
447)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
499)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
493)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:
1363)
Truncated. see log file for complete stacktrace
>
<Jul 26, 2010 2:32:43 PM ICT> <Error> <Deployer> <BEA-149265> <Failure
occurred in the execution of deployment request with ID
'1280129560158' for task '5'. Error is:
'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:
1373)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:
468)
at weblogic.application.internal.flow.ModuleStateDriver
$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:
37)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:
60)
Truncated. see log file for complete stacktrace
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy70 implementing
com.vietinbank.ipay.branch.dao.BranchDaoInterface,org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
to required type [com.vietinbank.ipay.branch.dao.BranchDao] for
property 'branchDao': no matching editors or conversion strategy found
at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:
231)
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:
447)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
499)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:
493)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:
1363)
Truncated. see log file for complete stacktrace
>

Eric Dalquist

unread,
Jul 26, 2010, 10:14:34 AM7/26/10
to ehcache-sprin...@googlegroups.com
Is "com.vietinbank.ipay.branch.dao.BranchDao" an interface? Spring's proxy support uses interface based proxies. If you can't make BranchDao an interface you'll need to include cglib on the classpath and add proxy-target-class="true" to the ehcache:annotation-driven element in your spring config.

lythanh

unread,
Jul 26, 2010, 10:01:18 PM7/26/10
to Ehcache Spring Annotations
Thanks you very much!

my DAO is not an interface, I add proxy-target-class="true" as you
guild and it's working!!!!!!
your framework is great!

Thanks you again,



On Jul 26, 9:14 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> Is "com.vietinbank.ipay.branch.dao.BranchDao" an interface? Spring's proxy
> support uses interface based proxies. If you can't make BranchDao an
> interface you'll need to include cglib on the classpath and add
> proxy-target-class="true" to the ehcache:annotation-driven element in your
> spring config.
>
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages