org.springframework.beans.factory.BeanNotOfRequiredTypeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Parent Contexts in spring based web-app
    via Stack Overflow by emeraldjava
    ,
  • We have a maven 2.0.10 build that buids a product that uses servlets, hibernate, spring and jersey. The maven build runs fine from the command line. We added a profile to turn on cobertura and is activated using the BUILD_NUMBER property. The build runs fine with the profile loaded explicitly using the -P maven switch. However, when run from hudson with cobertura code coverage turned on, we get exceptions from spring: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'liveResource' must be of type [com.corp.m5es.rest.resources.livepc.LiveResource], but was actually of type [$Proxy114] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:884) at com.sun.jersey.spi.spring.container.SpringComponentProviderFactory$SpringManagedComponentProvider.getInstance(SpringComponentProviderFactory.java:182) at com.sun.jersey.server.impl.component.IoCResourceFactory$PerRequestWrapper.getInstance(IoCResourceFactory.java:138) at com.sun.jersey.server.impl.application.WebApplicationContext.getResource(WebApplicationContext.java:160) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:64) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:654) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:612) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:603) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:309) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:590) at com.corp.m5es.spring.M5SpringServlet.service(M5SpringServlet.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:141) at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:220) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:148) at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:621) at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:552) at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:800) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.SelectorThread$1.execute(SelectorThread.java:649) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56) We are not sure what is causing this. Perhaps byte-code engineering is broken. suspecting it might be an OS related issue ( hudson is running on CentOS and our dev machines are windows), we created a windows slave and directed the build to that slave. But we got the same errors. LiveResource is a java class with class level @Component and @Scope("prototype") annotations and has spring auto-wired members. I haven't been able to craete a test case that can reproduce this yet.
    via by moizd,
  • We have a maven 2.0.10 build that buids a product that uses servlets, hibernate, spring and jersey. The maven build runs fine from the command line. We added a profile to turn on cobertura and is activated using the BUILD_NUMBER property. The build runs fine with the profile loaded explicitly using the -P maven switch. However, when run from hudson with cobertura code coverage turned on, we get exceptions from spring: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'liveResource' must be of type [com.corp.m5es.rest.resources.livepc.LiveResource], but was actually of type [$Proxy114] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:884) at com.sun.jersey.spi.spring.container.SpringComponentProviderFactory$SpringManagedComponentProvider.getInstance(SpringComponentProviderFactory.java:182) at com.sun.jersey.server.impl.component.IoCResourceFactory$PerRequestWrapper.getInstance(IoCResourceFactory.java:138) at com.sun.jersey.server.impl.application.WebApplicationContext.getResource(WebApplicationContext.java:160) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:64) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:654) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:612) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:603) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:309) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:590) at com.corp.m5es.spring.M5SpringServlet.service(M5SpringServlet.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:141) at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:220) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:148) at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:621) at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:552) at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:800) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.SelectorThread$1.execute(SelectorThread.java:649) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56) We are not sure what is causing this. Perhaps byte-code engineering is broken. suspecting it might be an OS related issue ( hudson is running on CentOS and our dev machines are windows), we created a windows slave and directed the build to that slave. But we got the same errors. LiveResource is a java class with class level @Component and @Scope("prototype") annotations and has spring auto-wired members. I haven't been able to craete a test case that can reproduce this yet.
    via by moizd,
  • Geomajas Error on Feature Info Tool
    via Stack Overflow by Ganesh Pawar
    ,
  • Spring JMS ActiveMQ exception
    via Stack Overflow by Diluu
    ,
  • Shiro Annotations on a jersey resource
    via Stack Overflow by dstarh
    ,
    • org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named '/login' must be of typ e [org.apache.struts.action.Action], but was actually of type [$Proxy59] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:884) at org.springframework.web.struts.DelegatingRequestProcessor.getDelegateAction(DelegatingRequestProcessor.java:176) at org.springframework.web.struts.DelegatingRequestProcessor.processActionCreate(DelegatingRequestProcessor.java:154) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.mypkg.cpanel.servlets.CPanelServlet.service(CPanelServlet.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at com.mypkg.cpanel.servlets.CPanelFilter.doFilterInternal(CPanelFilter.java:115) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.terracotta.modules.tomcat.tomcat_5_5.SessionValve55.tcInvoke(SessionValve55.java:63) at org.terracotta.modules.tomcat.tomcat_5_5.SessionValve55.invoke(SessionValve55.java:50) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    pulse00
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    4 more bugmates