RE: Tomcat as W2K3 service

2004-11-08 Thread Derrick Koes
 

Using the resource as a global resource solves the problem.


-Original Message-
From: Derrick Koes 
Sent: Friday, November 05, 2004 7:56 AM
To: '[EMAIL PROTECTED]'
Subject: Tomcat as W2K3 service


Configuration:
W2K3 Server
IIS 6.0
JK2
Tomcat 5.0.24
SQL Server 2000


Starting tomcat (and therefore my web application) as a service produces
an undesireable side effect not seen when starting from command line or
when using the tomcat manager to stop/start my web application.

I have a startup servlet that uses the datasource configured in my
context in its init method.  So, JNDI and therefore my context need to
be available on startup.
JNDI does not appear to be available, or at least my context isn't
available because I can't get my datasource.  Has anyone else seen this
in Tomcat 5.0.x?

Does anyone have a workaround?  My workaround right now is to stop/start
my web application from the tomcat manager
(http://localhost:8080/manager/html).  This isn't the best because when
the machine reboots this step must be done.  I can't rely on the service
starting.

Thanks for the help.

?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/

!-- Using global resources fixes a bug when tomcat is run as a Windows Service. --
  GlobalNamingResources
Environment 
name=hibernate.dialect 
value=net.sf.hibernate.dialect.SQLServerDialect 
override=false
type=java.lang.String
description=Hibernate dialect: net.sf.Hibernate.dialect.[SQLServerDialect|OracleDialect|Oracle9Dialect]/
Resource name=com/skillsoft/mgs/mail/session type=javax.mail.Session/
Resource 
name=com/skillsoft/ilt/jdbc
scope=Shareable 
type=javax.sql.DataSource/
ResourceParams name=com/skillsoft/ilt/jdbc
  parameter
nameurl/name
valuejdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;sendStringParameterAsUnicode=false;databaseName=MDB/value
  /parameter
  parameter
namevalidationQuery/name
valueSELECT iltVersion FROM iltVersion WHERE versionid IN (SELECT param_val FROM master_parameters WHERE param_name=apos;dbVersionapos;)/value
  /parameter
  parameter
namemaxIdle/name
value10/value
  /parameter
  parameter
namemaxActive/name
value10/value
  /parameter
  parameter
namedriverClassName/name
valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value
  /parameter
  parameter
namemaxWait/name
value5000/value
  /parameter
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
nameusername/name
valuesa/value
  /parameter
  parameter
namepassword/name
value/value
  /parameter
/ResourceParams
ResourceParams name=com/skillsoft/mgs/mail/session
  parameter
namemail.smtp.host/name
!-- This will need to be replaced with a real SMTP server at installation. --
value@TODO/value
  /parameter
  parameter
namemail.smtp.port/name
value25/value
  /parameter
  parameter
namemail.smtp.sendpartial/name
valuetrue/value
  /parameter
/ResourceParams

Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be updated and saved name=UserDatabase type=org.apache.catalina.UserDatabase/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
  /GlobalNamingResources

  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2 disableUploadTimeout=true port=8080 redirectPort=8443
/Connector
Connector port=8009 protocol=AJP/1.3 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler disableUploadTimeout=true redirectPort=8443
/Connector
Engine defaultHost=localhost jvmRoute=tomcat-server:8009 name=Catalina
  Host appBase=webapps name=localhost
Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_log. suffix=.txt timestamp=true/
Valve className=org.apache.catalina.valves.RequestDumperValve debug=9/
  /Host
  Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/
  Realm className=org.apache.catalina.realm.UserDatabaseRealm/
/Engine
  /Service
/Server
?xml version='1.0' encoding='utf-8'?

Context 
path=/ilt
docBase=P:/ILT
workDir=D:/ILTWork
crossContext=true 
reloadable=true
debug=0
  
!-- 
The workDir attribute value MUST match the tempDir

Tomcat as W2K3 service

2004-11-05 Thread Derrick Koes

Configuration:
W2K3 Server
IIS 6.0
JK2
Tomcat 5.0.24
SQL Server 2000


Starting tomcat (and therefore my web application) as a service produces
an undesireable side effect not seen when starting from command line or
when using the tomcat manager to stop/start my web application.

I have a startup servlet that uses the datasource configured in my
context in its init method.  So, JNDI and therefore my context need to
be available on startup.
JNDI does not appear to be available, or at least my context isn't
available because I can't get my datasource.  Has anyone else seen this
in Tomcat 5.0.x?

Does anyone have a workaround?  My workaround right now is to stop/start
my web application from the tomcat manager
(http://localhost:8080/manager/html).  This isn't the best because when
the machine reboots this step must be done.  I can't rely on the service
starting.

Thanks for the help.


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