Announcement Announcement Module
Collapse
No announcement yet.
No bean named 'clientDetails' is defined Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No bean named 'clientDetails' is defined

    In my application I have applicationContext.xml and dispatcher-servlet.xml. I am following the example I found from M5 release https://gist.github.com/1319529 I am using 1.0.0RC3 version of OAUTH2.

    oauth:authorization-server and <oauth:client-details-service id="clientDetails"> are in dispatcher-servlet.xml while the rest of the oauth configuration is in applicationContext.xml

    I seem to be missing clientDetails bean or loosing it between 2 contexts. Here is the error I am getting.

    Please help.

    Code:
    2012-10-17 00:35:33,565 [Thread-2] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve ref
    erence to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception
     is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChai
    n#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.authentication.www.BasicAuthenticationFilter] while setting co
    nstructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner be
    an)#3': Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' while setting bean property 'authenticationMa
    nager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authe
    ntication.ProviderManager#0': Cannot resolve reference to bean 'clientAuthenticationManager' while setting constructor argument; nested exception is o
    rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientAuthenticationManager': Cannot resolve reference to bean 
    'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting constructor argument with key [0]; nested exception is org
    .springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthentication
    Provider#0': Cannot resolve reference to bean 'clientDetailsUserService' while setting bean property 'userDetailsService'; nested exception is org.spr
    ingframework.beans.factory.BeanCreationException: Error creating bean with name 'clientDetailsUserService' defined in file [/home/igor/workspaces/S
    TS/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/test.OAuthRC3/WEB-INF/classes/META-INF/spring/applicationContex
    t-security.xml]: Cannot resolve reference to bean 'clientDetails' while setting constructor argument; nested exception is org.springframework.beans.fa
    ctory.NoSuchBeanDefinitionException: No bean named 'clientDetails' is defined
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    Last edited by igorsf; Oct 17th, 2012, 10:22 AM.

  • #2
    Please use [ code][/code ] tags so that it remains readable...

    I suggest a read on the spring reference guide and especially about applicationcontext hierarchies. In short the parent (ContextLoaderListener) cannot see beans in the child (DispatcherServlet) so your beans in the root context know nothing about the ones in the DispatcherServlet.

    Comment

    Working...
    X