• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LifeCycleException & SQLException - connecting to mysql from tomcat with basic auth

 
John Belden
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am having trouble accessing my mysql database for basic authentication (see error message below), and I'm not sure where the problem is. When I uncomment the MemoryRealm line in server.xml I can access all the files in my .../webapps/murach folder (though I still can't make a database connection). When I comment out the MemoryRealm line, and instead uncomment the JDBCRealm block I cannot access any of my files or my database connection.

Below is the error message I'm getting, along with my server.xml, web.xml, and mysql script.

I appreciate any help you can provide. Please let me know if you'd like me to post additional files or complete copies of my web.xml or server.xml files. Thank you in advance for your assistance.


FILE: /usr/local/jakarta-tomcat-4.0.1/logs/catalina.out


IMPORTANT FILE PATHS:


FILE: jakarta-tomcat-4.0.1/server.xml


FILE: /usr/local/jakarta-tomcat-4.0.1/webapps/murach/WEB-INF/web.xml


FILE: uploaded script for "users" - mysql database

[CODE]
DROP DATABASE IF EXISTS users;

CREATE DATABASE users;

USE users;

CREATE TABLE UserList (
user_name VARCHAR(50) NOT NULL,
user_pass VARCHAR(50) NOT NULL,

PRIMARY KEY (user_name)
);

CREATE TABLE Roles (
user_name VARCHAR(50) NOT NULL,
role_name VARCHAR(50) NOT NULL,

PRIMARY KEY (user_name)
);

INSERT INTO UserList VALUES
('john', 'smith'),
('karl', 'johnson'),
('kevin', 'berman'),
('stu', 'mendel');

INSERT INTO Roles VALUES
('john', 'admin'),
('karl', 'student'),
('kevin', 'student'),
('stu', 'guest');

[/CODE/
[ May 02, 2005: Message edited by: John Belden ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Welcome to JavaRanch!

Are you able to access the database from the command line?
 
John Belden
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Typing...

/usr/local/mysql/bin$ mysql -u root

lets me access the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic