Hi!

I am trying to initialize a standalone turbine instance within another servlet
framework. Therefore I have an initialization servlet that reads:

public void init() {
        String prefix =  getServletContext().getRealPath("/");

        Category log = Category.getInstance(InitServlet.class.getName());
        log.info("configured logging");

        /*
         * Configure and set up turbine.
         */
        String turbineinitfile = getInitParameter("turbineinitfile");
        if (turbineinitfile != null) {
            log.info("configuring turbine from "+prefix+turbineinitfile);
            TurbineConfig config = new TurbineConfig(".",
prefix+turbineinitfile);
            log.info("initializing turbine");
            config.init();
            log.info("initialized turbine");

            /*
             * Now try to use the turbine logging service.
             */
            try {
                Log.info("turbine initialization done");
            }
            catch (Exception e) {
                log.error("turbine logging threw exception: "+e.getMessage());
            }
        }

        log.info("service initialization done");
}

This does not work. Calling Log.info results in a
"java.lang.ExceptionInInitializerError:
org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
service LoggingService requested"
exception.

prefix+turbineinitfile contain the absolute path to the
TurbineResources.properties file, the file is attached.

What am I doing wrong?

TIA,
Erich
-- 
Dr. Erich Meier, Software Process Improvement
method park, Wetterkreuz 19a, 91058 Erlangen, Germany
Tel. +49-9131-97206-316  mailto:[EMAIL PROTECTED]
Fax. +49-9131-97206-200  http://www.methodpark.de/
# -------------------------------------------------------------------
# $Id$
#
# This is the configuration file for Turbine.
#
# Note that strings containing "," (comma) characters must backslash 
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------

# -------------------------------------------------------------------
# 
#  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,debug,security
services.LoggingService.default=system
services.LoggingService.loggingConfig=org.apache.turbine.services.logging.PropertiesLoggingConfig

# A facility for system logging.
services.LoggingService.system.destination.file=turbine.log
services.LoggingService.system.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.system.level=INFO

# A facility for the scheduler service
# To disable started/stopped messages set the level to ERROR
services.LoggingService.scheduler.destination.file=turbine.log
services.LoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.scheduler.level=INFO

# A facility for debugging applications. Messages will go both
# to the log file and the server console.
services.LoggingService.debug.destination.file=turbine.log
services.LoggingService.debug.destination.console=true
services.LoggingService.debug.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.debug.level=INFO

# A facility for SQL query logging
# To enable SQL query logging, set the system and sql log level to DEBUG
services.LoggingService.sql.destination.file=turbine.log
services.LoggingService.sql.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.sql.level=ERROR

# A facility for security audit. NOTE! As of 23 Jan 2001
# Turbine does not have any standard security auditing
# functionality. It's up to your application.
services.LoggingService.security.destination.file=turbine.log
services.LoggingService.security.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.security.level=INFO

# An example configuration for automatic log rotation using Log4Java
# This will keep the log file size under 1MB and save up to 5 backup copies
services.LoggingService.rotation.destination.file=turbine.log
services.LoggingService.rotation.file.size=1048576
services.LoggingService.rotation.file.backups=5
services.LoggingService.rotation.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.rotation.level=INFO

# An example configuration for using *NIX syslogd with Log4Java
services.LoggingService.syslog.destination.syslogd.host=my.syslog.server.com
services.LoggingService.syslog.destination.syslogd.facility=LOG_DAEMON
services.LoggingService.syslog.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.syslog.level=INFO

# An example configuration for using remote Log4Java server
services.LoggingService.remote.destination.remote.host=my.remote.server.com
services.LoggingService.remote.destination.remote.port=1099
services.LoggingService.remote.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.remote.level=INFO

# An example configuration for sending error reports as email with Log4Java
# notes: 
# * uses 'mail.server' as SMTP server to send mail through
# * log4j will send the email when an ERROR is logged, with
#   'buffer.size' previous (non-ERROR) logs included in the email
# * configured to log to a file as well otherwise stacktraces are lost
services.LoggingService.email.destination.file=turbine.log
services.LoggingService.email.destination.email.from=root@localhost
services.LoggingService.email.destination.email.to=root@localhost
services.LoggingService.email.destination.email.subject=Turbine Error Report
services.LoggingService.email.destination.email.buffer.size=512
services.LoggingService.email.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.email.level=INFO

# -------------------------------------------------------------------
# 
#  M A I L  S E R V E R 
#
# -------------------------------------------------------------------
# Your mail server for outgoing email.
#
# Default: null
# -------------------------------------------------------------------

mail.server=

# -------------------------------------------------------------------
# SMTP-From header for your outgoing messages
#
# All failed delivery messages will be returned to this address.
# If unset, these messages will be sent to the address in the 
# From header (standard behaviour)
#
# Default: null
# -------------------------------------------------------------------

mail.smtp.from=

# -------------------------------------------------------------------
# 
#  M O D U L E  C A C H I N G
#
# -------------------------------------------------------------------
# This determines whether or not to cache the modules in memory.  For
# development, turn this off.  For production, turn this on.
#
# Default: false
# -------------------------------------------------------------------

module.cache=false

# If module.cache=true, then how large should we make the hashtables
# by default.

action.cache.size=20
layout.cache.size=10
navigation.cache.size=10
page.cache.size=5
screen.cache.size=50
scheduledjob.cache.size=10

# -------------------------------------------------------------------
# 
#  M O D U L E  P A C K A G E S
#
# -------------------------------------------------------------------
# This is the "classpath" for Turbine.  In order to locate your own
# modules, you should add them to this path.  For example, if you have
# com.company.actions, com.company.screens, com.company.navigations,
# then this setting would be "com.company,org.apache.turbine.modules".
# This path is searched in order.  For example, Turbine comes with a
# screen module named "Login".  If you wanted to have your own screen
# module named "Login", then you would specify the path to your
# modules before the others.
#
# Default: org.apache.turbine.modules
# -------------------------------------------------------------------

module.packages=org.apache.turbine.modules

# -------------------------------------------------------------------
# 
#  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:3306/pkit
database.default.username=username
database.default.password=password

# The number of database connections to cache per ConnectionPool
# instance (specified per database).

database.default.maxConnections=3

# 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
# -------------------------------------------------------------------

database.maps.builder=org.apache.turbine.util.db.map.TurbineMapBuilder

# -------------------------------------------------------------------
# 
#  M E S S A G E S
#
# -------------------------------------------------------------------
# Note that strings containing "," (comma) characters must backslash 
# escape the comma (i.e. '\,')

# The message that can be displayed before a user logs in.

login.message=Thank you for your visit. Please log into the system.

# The message that can be displayed when no screen is defined.

login.message.noscreen=There has been an error. Your session is valid but the screen 
variable is not defined.

# The message that can be displayed when a user enters an incorrect
# password or username.

login.error=Sorry your username or password is incorrect!

# The message that can be displayed when a user logs out.

logout.message=Thank you for using the system. Please come back soon.

# -------------------------------------------------------------------
# 
#  S E C U R E  S O C K E T S  L A Y E R
#
# -------------------------------------------------------------------
# Whether the web server is able to use SSL.  Links in Turbine can
# check this property to determine if SSL can be used.
#
# Default: true
# -------------------------------------------------------------------

use.ssl=false

# -------------------------------------------------------------------
# 
#  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]
#
# The order that these services is listed is important! The
# order that is stated here is the order in which the services
# will be initialized. Keep this is mind if you have services
# that depend on other services during initialization.
# -------------------------------------------------------------------
services.ResourceService.classname=org.apache.turbine.services.resources.TurbineResourceService
services.LoggingService.classname=org.apache.turbine.services.logging.TurbineLoggingService
services.FactoryService.classname=org.apache.turbine.services.factory.TurbineFactoryService
services.PoolService.classname=org.apache.turbine.services.pool.TurbinePoolService
services.RunDataService.classname=org.apache.turbine.services.rundata.TurbineRunDataService
services.ServletService.classname=org.apache.turbine.services.servlet.TurbineServletService
services.AssemblerBrokerService.classname=org.apache.turbine.services.assemblerbroker.TurbineAssemblerBrokerService
services.LocalizationService.classname=org.apache.turbine.services.localization.TurbineLocalizationService
services.MimeTypeService.classname=org.apache.turbine.services.mimetype.TurbineMimeTypeService
services.GlobalCacheService.classname=org.apache.turbine.services.cache.TurbineGlobalCacheService
services.SchedulerService.classname=org.apache.turbine.services.schedule.TurbineSchedulerService
#services.XmlRpcService.classname=org.apache.turbine.services.xmlrpc.TurbineXmlRpcService
services.UniqueIdService.classname=org.apache.turbine.services.uniqueid.TurbineUniqueIdService
services.UploadService.classname=org.apache.turbine.services.upload.TurbineUploadService
services.SecurityService.classname=org.apache.turbine.services.security.db.DBSecurityService
services.PoolBrokerService.classname=org.apache.turbine.services.db.TurbinePoolBrokerService
services.MapBrokerService.classname=org.apache.turbine.services.db.TurbineMapBrokerService
services.PullService.classname=org.apache.turbine.services.pull.TurbinePullService
#services.IntakeService.classname=org.apache.turbine.services.intake.TurbineIntakeService
services.TemplateService.classname=org.apache.turbine.services.template.TurbineTemplateService
services.XSLTService.classname=org.apache.turbine.services.xslt.TurbineXSLTService

# Turn on the appropriate template service.
#services.VelocityService.classname=org.apache.turbine.services.velocity.TurbineVelocityService

# -------------------------------------------------------------------
#
#  R U N   D A T A   S E R V I C E
#
# -------------------------------------------------------------------
# Default implementations of base interfaces for request processing.
# Additional configurations can be defined by using other keys
# in the place of the <default> key.  
# -------------------------------------------------------------------

services.RunDataService.default.run.data=org.apache.turbine.services.rundata.DefaultTurbineRunData
services.RunDataService.default.parameter.parser=org.apache.turbine.util.parser.DefaultParameterParser
services.RunDataService.default.cookie.parser=org.apache.turbine.util.parser.DefaultCookieParser

# -------------------------------------------------------------------
#
#  C A C H E   S E R V I C E
#
# -------------------------------------------------------------------

# Interval at which the cache will be checked. The default is
# 5000ms or 5 seconds.

services.GlobalCacheService.cache.check.frequency = 5000

# -------------------------------------------------------------------
# 
#  A S S E M B L E R  B R O K E R  S E R V I C E
#
# -------------------------------------------------------------------
# A list of AssemblerFactory classes that will be registered 
# with TurbineAssemblerBrokerService
# -------------------------------------------------------------------

services.AssemblerBrokerService.screen=org.apache.turbine.services.assemblerbroker.util.java.JavaScreenFactory
#services.AssemblerBrokerService.screen=org.apache.turbine.services.assemblerbroker.util.python.PythonScreenFactory
services.AssemblerBrokerService.action=org.apache.turbine.services.assemblerbroker.util.java.JavaActionFactory
services.AssemblerBrokerService.layout=org.apache.turbine.services.assemblerbroker.util.java.JavaLayoutFactory
services.AssemblerBrokerService.page=org.apache.turbine.services.assemblerbroker.util.java.JavaPageFactory
services.AssemblerBrokerService.navigation=org.apache.turbine.services.assemblerbroker.util.java.JavaNavigationFactory
services.AssemblerBrokerService.scheduledjob=org.apache.turbine.services.assemblerbroker.util.java.JavaScheduledJobFactory

# -------------------------------------------------------------------
# 
#  U P L O A D  S E R V I C E
#
# -------------------------------------------------------------------

# Whether the files should be automatically picked up by
# ParameterParser.

services.UploadService.automatic=true

#
# The directory where files will be temporarily stored.
#
services.UploadService.repository=.

#
# The maximum size of a request that will be processed.
#
services.UploadService.size.max=1048576

#
# The maximum size of a request that will have it's elements cached in
# memory by TurbineUploadService class.
#
services.UploadService.size.threshold=10240

# -------------------------------------------------------------------
# 
#  L O C A L I Z A T I O N  S E R V I C E
#
# -------------------------------------------------------------------

# Default ResourceBundle and language/country codes used by the
# TurbineLocalizationService.
#
locale.default.bundle=MyBundle
locale.default.language=en
locale.default.country=US

#
# This will set the charset= portion of the ContentType: header.
# Leave commented out unless you want to return stuff as a different
# charset.
#
# locale.default.charset=

# -------------------------------------------------------------------
# 
#  M I M E T Y P E  S E R V I C E
#
# -------------------------------------------------------------------

# This property specifies a file containing mappings between MIME 
# content types and the corresponding file name extensions. The
# service itself contains a hardcoded set of most common mappings. 
# The file must use the same syntax as the mime.types file of 
# the Apache Server, i.e. 
# <mimetype> <ext1> <ext2>...
#
#services.MimeTypeService.mime.types=/WEB-INF/conf/mime.types

# This property specifies a file containing mappings between locales 
# and the corresponding character encodings. The service itself 
# contains a hardcoded set of most common mappings. 
# The file should use the Java property file syntax, i.e. 
# <lang_country_variant>=<charset>
#
#services.MimeTypeService.charsets=/WEB-INF/conf/charset.properties

# -------------------------------------------------------------------
# 
#  S C H E D U L E R  S E R V I C E
#
# -------------------------------------------------------------------

#
# Set enabled to true to start the scheduler.
#
# Default = false
#
scheduler.enabled=false


# -------------------------------------------------------------------
# 
#  S E C U R I T Y  S E R V I C E
#
# -------------------------------------------------------------------

#
# This is the class that implements the User interface.
# You want to override this setting only if you want your User 
# implementation to provide application specific addtional 
# functionality.
#
# Default: org.apache.turbine.om.security.TurbineUser
#

services.SecurityService.user.class=org.apache.turbine.om.security.TurbineUser

#
# This setting is DBSecurityService specific - this class is consulted for the names
# of the columns in the users' tables for the purpose of creating join queries. 
# If you use your own User implementation in conjunction with DBSecurityService,
# it's peer class must implement org.apache.turbine.om.security.peer.UserPeer 
interface,
# and you need to specify the name of the peer class here.
#
# Defalut: org.apache.turbine.om.security.peer.TurbineUserPeer
#
services.SecurityService.userPeer.class=org.apache.turbine.om.security.peer.TurbineUserPeer

#
# This is the class that implements UserManager interface.
# Override this setting if you want your User information stored
# on a different medium (LADP directory is a good example).
# Default implementation uses Peers and a relational database .
#

services.SecurityService.user.manager=org.apache.turbine.services.security.db.DBUserManager

#
# This is used by the SecurityService to make the password checking
# secure. When enabled, passwords are transformed by a one-way
# function into a sequence of bytes that is base64 encoded.
# It is impossible to guess the plain-text form of the password
# from the representation. When user logs in, the entered password
# is transformed the same way and then compared with stored value.
#
# Default: false
#

services.SecurityService.secure.passwords=false

#
# This property lets you choose what digest algorithm will be used
# for encrypting passwords. Check documentation of your JRE for
# available algorithms.
#
# Default: SHA
#

services.SecurityService.secure.passwords.algorithm=SHA

# Configuration for the LDAP Security Service implementation

#services.SecurityService.ldap.security.athentication=simple
#services.SecurityService.ldap.port=<LDAP PORT>
#services.SecurityService.ldap.host=<LDAP HOST>
#services.SecurityService.ldap.admin.username=<ADMIN USERNAME>
#services.SecurityService.ldap.admin.password=<ADMIN PASSWORD>
#services.SecurityService.ldap.user.basesearch=<SEARCH PATTERN>
#services.SecurityService.ldap.user.search.filter=<SEARCH FILTER>
#services.SecurityService.ldap.dn.attribute=userPrincipalName
#services.SecurityService.ldap.provider=com.sun.jndi.ldap.LdapCtxFactory

# -------------------------------------------------------------------
# 
#  P O O L  S E R V I C E
#
# -------------------------------------------------------------------

# Default capacity of pools of the Object pooling service.
#
# Default: 128
services.PoolService.pool.capacity = 128

# Class specific capacities used instead of the default if specified.
#
#services.PoolService.pool.capacity.org.apache.turbine.services.rundata.DefaultTurbineRunData=512

# -------------------------------------------------------------------
# 
#  F A C T O R Y  S E R V I C E
#
# -------------------------------------------------------------------

# A comma separated list of classloaders (very optional)
#
# Example: org.foo.bar.MyClassLoader, org.ack.joe.YourClassLoader
#
#services.FactoryService.class.loaders=

# Customized factories to be used instead of the default factory.
# E.g. to instantiate XML parsers, SSL sockets, etc., which require
# specific instantiation not supported by the default factory.
# The property name is prefixed with "factory" followed by the
# name of the production class. The value is the class name of
# the factory implementing the Factory interface. The factory
# will be instantiated by using the service itself.
#
# Examples:
#
# 
services.FactoryService.factory.javax.xml.parsers.DocumentBuilder=org.foo.xml.DomBuilderFactory
# 
services.FactoryService.factory.javax.xml.parsers.SAXParser=org.foo.xml.SaxParserFactory
# 
services.FactoryService.factory.java.net.ServerSocket=org.foo.net.SslServerSocketFactory

#--------------------------------------------------------------------
#
# This variable controls the case folding applied to URL variable
# names.
#
# Allowed values: none, lower, upper
# Default: lower
#

url.case.folding=lower

# -------------------------------------------------------------------
# 
#  A D D I T I O N A L  P R O P E R T I E S
#
# -------------------------------------------------------------------
# The full path name to an additional properties file. Properties in 
# this file will be included in this property set. Duplicate name 
# values will be replaced, so be careful.
#
# Default: none
# -------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to