Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Integrating Spring & JDBC into JSF2 login page

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used a properly running example project (documentation) to create a simple JSF login page working with Spring Security on Tomcat 7 using Eclipse. The above example stores usernames, passwords and roles in applicationContext-security.xml in the following format:

I want to modify it so that I can use authentication database through JDBC. After making a simple modification, I am no longer able to access my project on the server (404) due to an error (Eclipse does not provide details, or maybe I don't know where to look). Could you please give me some suggestions on what might be going wrong? I'm not quite sure whether it is Spring or Eclipse/Tomcat issue... Thanks.

Below is a complete copy of my updated applicationContext-security.xml:

Lyubomir Tsvetanov
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is solved! I had to remove this:

As it created more than one instance of userDetailsService, which caused the error.
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<jdbc-user-service data-source-ref="dataSource"/>

<beans:bean id="userDetailsService" class="">
<beans:property name="dataSource" ref="dataSource"/>

are both identical beans. However, while there are two UserDetailsService implementations as beans, the Authentication Manager will only use one of them. In my xml at a company I worked at, we had two UserDetailsService implementations as beans and it worked fine. Anyway….

Nice that your resolved it and I apologize that when I looked at your post the other day I didn't give it enough time to really look at it and find your issue for you quicker.

If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic