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

  • Problem with Spring PetClinic with security

    Hello,

    I'm having the following problem:

    2011-05-07 16:50:36,073 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'petclinic': initialization started>
    2011-05-07 16:50:36,075 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <Refreshing WebApplicationContext for namespace 'petclinic-servlet': startup date [Sat May 07 16:50:36 EDT 2011]; parent: Root WebApplicationContext>
    2011-05-07 16:50:36,076 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/petclinic-servlet.xml]>
    2011-05-07 16:50:36,174 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@10d9f1e3: defining beans [findOwnersForm,editPetForm,addPetForm,addVisitForm ,clinicController,addOwnerForm,editOwnerForm,org.s pringframework.context.annotation.internalConfigur ationAnnotationProcessor,org.springframework.conte xt.annotation.internalAutowiredAnnotationProcessor ,org.springframework.context.annotation.internalRe quiredAnnotationProcessor,org.springframework.cont ext.annotation.internalCommonAnnotationProcessor,o rg.springframework.context.annotation.internalPers istenceAnnotationProcessor,org.springframework.web .servlet.mvc.annotation.AnnotationMethodHandlerAda pter#0,org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver#0,org.springframework. web.servlet.view.ContentNegotiatingViewResolver#0, org.springframework.web.servlet.view.BeanNameViewR esolver#0,org.springframework.web.servlet.view.Int ernalResourceViewResolver#0,visits,vets,marshaller ,messageSource]; parent: org.springframework.beans.factory.support.DefaultL istableBeanFactory@583548da>
    2011-05-07 16:50:36,176 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@10d9f1e3: defining beans [findOwnersForm,editPetForm,addPetForm,addVisitForm ,clinicController,addOwnerForm,editOwnerForm,org.s pringframework.context.annotation.internalConfigur ationAnnotationProcessor,org.springframework.conte xt.annotation.internalAutowiredAnnotationProcessor ,org.springframework.context.annotation.internalRe quiredAnnotationProcessor,org.springframework.cont ext.annotation.internalCommonAnnotationProcessor,o rg.springframework.context.annotation.internalPers istenceAnnotationProcessor,org.springframework.web .servlet.mvc.annotation.AnnotationMethodHandlerAda pter#0,org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver#0,org.springframework. web.servlet.view.ContentNegotiatingViewResolver#0, org.springframework.web.servlet.view.BeanNameViewR esolver#0,org.springframework.web.servlet.view.Int ernalResourceViewResolver#0,visits,vets,marshaller ,messageSource]; parent: org.springframework.beans.factory.support.DefaultL istableBeanFactory@583548da>
    2011-05-07 16:50:36,177 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Context initialization failed>
    org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'findOwnersForm' defined in file [/opt/alfresco/tomcat/webapps/petclinic/WEB-INF/classes/org/springframework/samples/petclinic/web/FindOwnersForm.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.samples.petclinic.Clinic]: : No matching bean of type [org.springframework.samples.petclinic.Clinic] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [org.springframework.samples.petclinic.Clinic] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
    at org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:698)
    at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:192)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:984)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:886)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:479)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 90)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:287 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:557)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:842)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:416)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 43)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 59)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:340 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:307)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.allocate( StandardWrapper.java:809)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:852)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [org.springframework.samples.petclinic.Clinic] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.raiseNoSuchBeanDefinitionExcept ion(DefaultListableBeanFactory.java:896)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.doResolveDependency(DefaultList ableBeanFactory.java:765)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.resolveDependency(DefaultListab leBeanFactory.java:680)
    at org.springframework.beans.factory.support.Construc torResolver.resolveAutowiredArgument(ConstructorRe solver.java:771)
    at org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:691)
    ... 30 more
    2011-05-07 16:50:37,456 DEBUG [org.springframework.security.web.FilterChainProxy] - <Converted URL to lowercase, from: '/static/styles/petclinic.css'; to: '/static/styles/petclinic.css'>
    2011-05-07 16:50:37,463 DEBUG [org.springframework.security.web.FilterChainProxy] - <Candidate is: '/static/styles/petclinic.css'; pattern is /static/**; matched=true>
    2011-05-07 16:50:37,463 DEBUG [org.springframework.security.web.FilterChainProxy] - </static/styles/petclinic.css has an empty filter list>
    2011-05-07 16:50:37,464 DEBUG [org.springframework.security.web.FilterChainProxy] - <Converted URL to lowercase, from: '/static/images/springsource-logo.png'; to: '/static/images/springsource-logo.png'>
    2011-05-07 16:50:37,482 DEBUG [org.springframework.security.web.FilterChainProxy] - <Converted URL to lowercase, from: '/static/images/banner-graphic.png'; to: '/static/images/banner-graphic.png'>
    2011-05-07 16:50:37,482 DEBUG [org.springframework.security.web.FilterChainProxy] - <Candidate is: '/static/images/banner-graphic.png'; pattern is /static/**; matched=true>
    2011-05-07 16:50:37,482 DEBUG [org.springframework.security.web.FilterChainProxy] - </static/images/banner-graphic.png has an empty filter list>
    2011-05-07 16:50:37,482 DEBUG [org.springframework.security.web.FilterChainProxy] - <Candidate is: '/static/images/springsource-logo.png'; pattern is /static/**; matched=true>
    2011-05-07 16:50:37,482 DEBUG [org.springframework.security.web.FilterChainProxy] - </static/images/springsource-logo.png has an empty filter list>

    Any thoughts?

  • #2
    Please use code tags when posting stacktraces.

    Code:
    No matching bean of type [org.springframework.samples.petclinic.Clinic] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
    You're missing the bean definition for Clinic. Either declare it in xml or be sure that the package is scanned with context:component-scan.

    Comment

    Working...
    X