• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

How to use DataSourceRealm?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to build an access control mechanism for a JSF web application on Tomcat 6. Since I already have a database with users, I was going for a DataSourceRealm.
First, I've created another table called user_roles that has only two columns: useraname and role.
Then, I've added the following rows:



Next, I edited conf/server.xml to contain this:


and I edited my web.xml to contain this:


No exceptions are raised during Tomcat startup. Now, when I try to access the app through http://localhost:8080/Test/, the login dialog pops up but no matter what I type in - nothing happens. usertest/usertest doesn't work.
I tried shuting down MySQL to see if an exception would be raised when I attempt to login, but everything seems the same. So, it must something in my server.xml is wrongly configured but I don't know what.
Please guys, give it a shot. I'd be very, very grateful.
[ November 19, 2008: Message edited by: Veggen Skrikk ]
 
Sheriff
Posts: 27526
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Veggen Skrikk", please check your private messages for an important administrative matter.
 
Bojan Tomic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this exact same configuration with JDBCRealm, and it works fine, so the error must be in the DataSource configurations, but I still can't discover it.

I hope this helps...
 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I face the same problem now. JDBCRealm works, but DataSourceRealm not.
@Bojan, did you happen to fix it?

Thanks!
 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Figured it out. I had to set

localDataSource="true"

in the Realm definition
 
Bojan Tomic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't fixed it. I'll try your solution.
Thanks for posting it.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic