I saw your posts re: Please help with ...  . I don't think the nightly build will get me very far but looks like you've been there so....can I ask you about the following:
Win 98 with Tomcat running example ok and MySql running its example db's ok.  Downloaded jdbc driver for the db called mm.mysql and tried to follow the instructions.
I have a jsp  that (when "login" is clicked) uses a bean called "sessionmanager" which in turn uses a bean called "connectionpool" to get a connection to a db called "idpassword" which I created on MySql.  Could someone give an old guy like me some VERY specific, detailed instructions about how to configure these three so it will run?  Currently, when I click "login" I get an "error 500 cannot create instance of bean sessionmanger"  I'm confident its in the classpath or perhaps a config file because the the jsp, sessionmanager etc  is all example code from Paul Tremblett's book: Instant Java Server Pages (copywrite 2000,Mcgraw-Hill).
Here's what I have set up now:
Location of the jsp called login2.jsp is
GameD/tomcat/webapps/login/jsp/login2.jsp
Location of sessionmanager is
GameD/tomcat/webapps/login/Web-inf/
classes/com/instantjsp/SessionManager.class
Location of ConnectionPool is
GameD/tomcat/webapps/login/Web-inf/
classes/com/javaservlets/jdbc/ConnectionPool.class
Also located same directory as ConnectionPool.class is Connection.cfg which looks like this:

#ConnectionPool.cfg

JDBCDriver=mm.mysql.Driver

JDBCConnectionURL=jdbc:mysql://localhost:8080/login/Web-inf/idpassword

ConnectionPoolSize=50

ConnectionPoolMax=250

ConnectionUseCount=5

ConnectionTimeout = 2

User=

Password=

I don't think I ever set a password in MySql.

Here's what the beginning of login2.jsp looks like:

<jsp:useBean id="sessionManager" class="com.instantjsp.SessionManager"

scope="application" />

<jsp:useBean id="credentials" class="com.instantjsp.UserCredentials"

scope="session" />

<%

if (sessionManager.alreadyLoggedIn(credentials)) {

%>

<jsp:forward page="LogoutFirst.jsp" />

<%

}

%>

<html>

<head>

Here is the beginning of SessionManager.java:

package com.instantjsp;

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Enumeration;

import java.util.Hashtable;

import java.util.Vector;

import javax.servlet.ServletContext;

import javaservlets.jdbc.ConnectionPool;

public class SessionManager {

private Hashtable currentLogins;

private ConnectionPool connectionPool;

private static final int TIMEOUT_MINUTES = 5;

private static final long ONE_MINUTE = 60000L;

private static final String POOL_CFG_FILE =

"javaservlets/jdbc/SessionManagerConnectionPool.cfg";

private static final String SELECT_PASSWORD =

"SELECT password FROM idpassword WHERE userid = ";

 Here is the beginning of ConnectionPool.java:

 

/*

* @(#)ConnectionPool

*

* Copyright (c) 1998 Karl Moss. All Rights Reserved.

*

* You may study, use, modify, and distribute this software for any

* purpose provided that this copyright notice appears in all copies.

*

* This software is provided WITHOUT WARRANTY either expressed or

* implied.

*

* @author Karl Moss

* @version 1.0

* @date 11Mar98

*

*/

package javaservlets.jdbc;

import java.sql.*;

/**

* <p>This class serves as a JDBC connection repository. Since

* creating database connections is one of the most time

* intensive aspects of JDBC, we'll create a pool of connections.

* Each connection can be used and then replaced back into the

* pool.

*

* <p>A properties file 'ConnectionPool.cfg' will be used to

* specify the types of JDBC connections to create, as well as

* the minimum and maximum size of the pool. The format of

* the configuration file is:

*

* #(comment)

* JDBCDriver=<JDBC driver name>

* JDBCConnectionURL=<JDBC Connection URL>

* ConnectionPoolSize=<minimum size of the pool>

* ConnectionPoolMax=<maximum size of the pool, or -1 for none>

* ConnectionUseCount=<maximum usage count for one connection>

* ConnectionTimeout=<maximum idle lifetime (in minutes) of

* a connection>

* <other property for JDBC connection>=<value>

*

* <p>Any number of additional properties may be given (such

* as username and password) as required by the JDBC driver.

*

*/

public class ConnectionPool

implements javaservlets.timer.TimerListener

{

// JDBC Driver name

String m_JDBCDriver;

// JDBC Connection URL

String m_JDBCConnectionURL;

// Minimum size of the pool

int m_ConnectionPoolSize;

// Maximum size of the pool

int m_ConnectionPoolMax;

// Maximum number of uses for a single connection, or -1 for

// none

int m_ConnectionUseCount;

// Maximum connection idle time (in minutes)

int m_ConnectionTimeout;

// Additional JDBC properties

java.util.Properties m_JDBCProperties;

// The Connection pool. This is a vector of ConnectionObject

// objects

java.util.Vector m_pool;

// The maximum number of simultaneous connections as reported

// by the JDBC driver

int m_MaxConnections = -1;

// Our Timer object

javaservlets.timer.Timer m_timer;

/**

* <p>Initializes the ConnectionPool object using

* 'ConnectionPool.cfg' as the configuration file

*

* @return true if the ConnectionPool was initialized

* properly

*/

public boolean initialize() throws Exception

I have placed the jdbc db driver called mysql_both_comp.jar in :

GameD/tomcat/webapps/login/Web-inf/lib
 
Oh yeah heres what my autoexec file looks like:
 
@C:\PROGRA~1\NORTON~1\NORTON~2\NAVDX.EXE /Startup

REM To make a DOS Boot Diskette; See the file C:\DOSBOOT\DOSBOOT.TXT

@Echo off

path C:\WINDOWS;C:\WINDOWS\COMMAND;C:\GameD\jdk1.3\bin

set TOMCAT_HOME=C:\GameD\tomcat

set JAVA_HOME=C:\GameD\jdk1.3

set CLOUDSCAPE_INSTALL=C:\Cloudscape_3.5

SET CLASSPATH=%CLOUDSCAPE_INSTALL%\lib\cloudscape.jar;

%CLOUDSCAPE_INSTALL%\lib\tools.jar;

%CLOUDSCAPE_INSTALL%\demo\programs\tours;.;

%CLOUDSCAPE_INSTALL%\frameworks\cloudconnect\bin;

%CLOUDSCAPE_INSTALL%\frameworks\embedded\bin;

%CLOUDSCAPE_INSTALL%\frameworks\RmiJdbc\bin;

 

REM ..

rem - By Windows Setup - mscdex.exe /d:IDECD000 /L:M

REM ISJE_SECTION_BEGIN

Set PATH=C:\Cloudscape_3.5\jre\bin;C:\PROGRA~1\INTERN~1\;;C:\WINDOWS;c:\windows;c:\windows\COMMAND;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\GAMED\JDK1.3\BIN

C:\> set CLASSPATH=C:\GameD\MySQL\jdbc driver\mm.mysql.jdbc-2.0pre5%CLASSPATH%

REM ISJE_SECTION_END

Its a lot of stuff to look through but maybe someone out there likes puzzles and is willing to help an increasingly frustrated jsp user wannabe. :)
 

Reply via email to