Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2006, 07:08 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Portsmouth, Hampshire, United Kingdom.
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default problem with JDBC realm

Hi Guys,

I am having problems with creating a JDBC realm in my server.xml. This is how I have configured the server.xml so far:

    <Realm className="org.apache.catalina.realm.JDBCRealm"
        debug="99"
                 driverName="com.mysql.jdbc.Driver"
              connectionURL="jdbc:mysql://localhost/singlesignon"
             connectionName="root"
        connectionPassword="password"
                  userTable="users"
        userNameCol="Username"
        userCredCol="Password"
              userRoleTable="userroles"
        roleNameCol="Role" />
</Context>

Under the context is the following:

<!--
<Valve className="org.apache.catalina.valves.RequestDumpe rValve"/>
-->



<!-- This Realm uses the UserDatabase configured in the global JNDI
     resources under the key "UserDatabase". Any edits
     that are performed against this UserDatabase are immediately
     available for use by the Realm. -->


<Realm className="org.apache.catalina.realm.UserDatabaseR ealm"
resourceName="UserDatabase"/>



<!-- Comment out the old realm but leave here for now in case we
     need to go back quickly -->

****COULD SOME ONE PLEASE EXPLAIN WHAT THE COMMENT ABOVE MEANS??****

<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->

<!-- Replace the above Realm with one of the following to get a Realm
     stored in a database and accessed via JDBC -->

Thanks Guys

Adz - Learning The J2EE Ways.
__________________
Adz - Learning The J2EE Ways.
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2009, 06:32 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by aadz5
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->

****COULD SOME ONE PLEASE EXPLAIN WHAT THE COMMENT ABOVE MEANS??****

<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
What that means is the Realm line that contains the MemoryRealm entry has been commented so it doesn't interfere with the Realm line above that is using the UserDatabase. Surrounding the line with "<!-- " and " -->" comments it so it is not read as part of the configuration. But leaving the line there in case you want to revert to the earlier behavior/configuration quickly. (Delete the "<!-- " line and the " -->" line from around the "<Realm className="org.apache.catalina.realm.MemoryRealm" />" line and put the same lines around the "<Realm className="org.apache.catalina.realm.UserDatabaseR ealm" ResourceName="UserDatabase"/>" line and restart the Tomcat server.)

Now, a couple things that I notice as differences between what you have posted above and what I have in our servers that is working are:

1.) In our configuration, we have the port and database names in the connectionURL (e.g. "jdbc:mysql://127.0.0.1:3306/test" where 'test' = the name of the database. So, your database is called 'singlesignon'?)

2.) I notice that you are using:
Code:
        userTable="users"
        userNameCol="Username"
        userCredCol="Password"
Are the columns in your database for username and password using capitals at the beginning of their names? Case sensitivity can be an issue with these.

HTH.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with JDBC Poman Prashant Java Databases 2 June 20th, 2007 02:06 AM
problem with jdbc protozoa JSP Basics 3 December 30th, 2006 06:08 AM
Error ORA-27101: shared memory realm does not exis rajan_sood Oracle 0 October 17th, 2005 12:53 PM
Cannot load JDBC driver class with com.mysql.jdbc. dzis Apache Tomcat 0 January 29th, 2004 11:57 AM
Cannot load JDBC driver class with com.mysql.jdbc. dzis MySQL 0 January 29th, 2004 11:31 AM



All times are GMT -4. The time now is 10:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.