Hi,
I'm trying to use Turbine for the first time, so please excuse me if the
question seems obvious.
I've installed Turbine and Velocity and have both of their jar files in
tomcat/common/lib . Tomcat reports
that Turbine is initialized on startup. The following code:
import org.apache.turbine.services.TurbineServices;
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.util.db.adapter.DB;
import org.apache.turbine.util.db.map.DatabaseMap;
.....
try {
DBConnection dbCon = TurbineDB.getConnection();
}catch(TurbineException te) {
System.out.println("TurbineException: " + e.getMessage());
e.printStackTrace();
}
results in the following error in the Tomcat console:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/stratum/configuration/Configuration
at
org.apache.turbine.services.db.TurbineDB.getPoolBroker(TurbineDB.java:340)
at
org.apache.turbine.services.db.TurbineDB.getConnection(TurbineDB.java:199)
at com.egps.factories.test.main(test.java:30)
This message is not coming from the catch() statment.
Please note that I'm using an example from a book called 'MySQL and JSP Web
Applications' and
the instructions for installing Turbine are probably outdated. I do not find
any reference to
'org/apache/stratum/configuration/Configuration' in either of the .jar files
I downloaded from the
Turbine site. I downloaded and installed version 2.2-b1. The entry in the
TurbineResources.properties
file follows:
# -------------------------------------------------------------------
#
# S E R V I C E S
#
# -------------------------------------------------------------------
# Classes for Turbine Services should be defined here.
# Format: services.[name].classname=[implementing class]
#
# To specify properties of a service use the following syntax:
# service.[name].[property]=[value]
services.PoolBrokerService.classname=org.apache.turbine.services.db.TurbineP
oolBrokerService
services.MapBrokerService.classname=org.apache.turbine.services.db.TurbineMa
pBrokerService
services.loggingService.classname=org.apache.turbine.services.logging.Turbin
eLoggingService
# -------------------------------------------------------------------
#
# D A T A B A S E S E T T I N G S
#
# -------------------------------------------------------------------
# These are your database settings. Look in the
# org.apache.turbine.util.db.pool.* packages for more information.
# The default driver for Turbine is for MySQL.
#
# The parameters to connect to the default database. You MUST
# configure these properly.
# -------------------------------------------------------------------
database.default.driver=org.gjt.mm.mysql.Driver
database.default.url=jdbc:mysql://localhost/EGPS
database.default.username=test
database.default.password=test
# The number of database connections to cache per ConnectionPool
# instance (specified per database).
database.default.maxConnections=50
# The amount of time (in milliseconds) that database connections will be
# cached (specified per database).
#
# Default: one hour = 60 * 60 * 1000
database.default.expiryTime=3600000
# The amount of time (in milliseconds) a connection request will have to
wait
# before a time out occurs and an error is thrown.
#
# Default: ten seconds = 10 * 1000
database.connectionWaitTimeout=10000
# The interval (in milliseconds) between which the PoolBrokerService logs
# the status of it's ConnectionPools.
#
# Default: No logging = 0 = 0 * 1000
database.logInterval=0
# These are the supported JDBC drivers and their associated Turbine
# adaptor. These properties are used by the DBFactory. You can add
# all the drivers you want here.
database.adaptor=DBMM
database.adaptor.DBMM=org.gjt.mm.mysql.Driver
# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.
database.idbroker.cleverquantity=true
# -------------------------------------------------------------------
#
# P E E R S
#
# -------------------------------------------------------------------
# Supplies Turbine with information about the database schema, which
# can simplify any required Peer classes.
#
# Default: org.apache.turbine.util.db.map.TurbineMapBuilder
# -------------------------------------------------------------------
# -------------------------------------------------------------------
#
# L O G S
#
# -------------------------------------------------------------------
# This is the configuration for the logging system. In most cases
# you don't need to modify anything. However, if you wish to add more
# facilities or modify the existing settings, then you can do so.
#
# destination.file: A path relative to the web app root
# -------------------------------------------------------------------
services.LoggingService.facilities=system,bfg
services.LoggingService.default=system
# A facility for system logging.
services.LoggingService.system.destination.file=logs/system.log
services.LoggingService.system.className=org.apache.turbine.services.logging
.FileLogger
services.LoggingService.system.level=INFO
# A facility for logging BFG messages
services.LoggingService.bfg.destination.file=logs/bfg.log
services.LoggingService.bfg.className=org.apache.turbine.services.logging.Fi
leLogger
services.LoggingService.bfg.level=DEBUG
And the entry in the web.xml file is:
<servlet>
<servlet-name>turbine-init</servlet-name>
<servlet-class>com.egps.TurbineInit</servlet-class>
<init-param>
<param-name>turbine-resource-directory</param-name>
<param-value>/WEB-INF/TurbineResources.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>