You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Leina Last <ey...@yahoo.com> on 2003/11/14 11:00:48 UTC

jar file in lib directory

Hi
 
I'm connecting to a sql server and put mssqlserver.jar in the jdk directory(j2sdk1.4.0) to get to the SQLServerDriver class.
 
I would like to put the mssqlserver.jar file in the turbine structure \lib\ directory and not in the jdk directory. Something like tdk\apps\app\WEB-INF\lib\mssqlserver.jar.
 
Is it possible and how can I manage to do it? Need to make changes in TurbineResources.properties or any other config file?
 
I got the following runtime error after placing the jar file in the turbine directory structure:
 Exception:  java.lang.NullPointerException
 Stack Trace follows:
 java.lang.NullPointerException
 at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
 
Appreciate the help
Thanks
L
 
 


---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: jar file in lib directory

Posted by Loïc QUERAN <lo...@gicm.fr>.
Hi,

http://db.apache.org/torque/mssql-howto.html gives useful indications I 
followed and my app is ok.

My msbase, mssqlserver, msutil jars are in myapp/WEB-INF/lib.

You can find "my" torque.properties hereafter. Adapt ipaddr, user and password 
to your situation.

Loïc

# -------------------------------------------------------------------
# $Id: Torque.master,v 1.9 2003/08/19 19:09:44 mpoeschl Exp $
#
# This is the configuration file for Torque.
#
# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------

torque.applicationRoot = .

# -------------------------------------------------------------------
#
#  L O G G I N G
#
# -------------------------------------------------------------------
# We use Log4J for all Torque logging and we embed the log4j
# properties within our application configuration.
# -------------------------------------------------------------------

# This first category is required and the category
# must be named 'default'. This is used for all logging
# where an explicit category is not specified.

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = 
${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c - 
%m%n
log4j.appender.org.apache.torque.append = false

# -------------------------------------------------------------------
#
#  D E F A U L T S
#
# -------------------------------------------------------------------
#
# These values kick in, if you don't explicitly override them in your
# various database settings. At the moment they're only used if you
# configure the TorqueDataSourceFactory of the Jdbc2PoolDataSourceFactory
# as your data source provider. It does not work with JNDI.
#
# The example is shown for TorqueDataSource.
#
# -------------------------------------------------------------------

# If > 0, then a monitoring thread is started for every pool to
# display the number of created, available and checked out connections
# The interval is in seconds.
torque.defaults.pool.logInterval = 0

# Time to wait for a connection to the databas in Seconds.
torque.defaults.pool.connectionWaitTimeout = 10

# Maximum number of connections cached in a database definition. Note
# that, if you have multiple database definitions which access the
# same database URL, they don't share the connections but you have
# multiple pools and each has this maximum number. So if you have a
# connection licensed database engine, you must multiply this number by
# the number of times you use a specific database URL.
torque.defaults.pool.defaultMaxConnections = 80

# Lifetime of a connection in the pool. Defaults to one hour
torque.defaults.pool.maxExpiryTime = 3600

# Sets the driver for the data sources.
torque.defaults.connection.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver

# Sets the URL for the datasources
torque.defaults.connection.url = 
jdbc:microsoft:sqlserver://10.154.99.24:1433;DatabaseName=myapp;SelectMethod=cursor

# Sets login and password for the data sources.
torque.defaults.connection.user = jdbcuser
torque.defaults.connection.password = jdbcuser

# -------------------------------------------------------------------
#
#  T O R Q U E  P R O P E R T I E S
#
# -------------------------------------------------------------------
# These are your database settings. Look in the
# org.apache.torque.pool.* packages for more information.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

torque.database.default=myapp
torque.database.myapp.adapter=mssql

## Using torque's old pool
## this implementation is deprecated and has some known bugs!!!!
## you should use commons-dbcp
#torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
#torque.dsfactory.myapp.pool.defaultMaxConnections=10
#torque.dsfactory.myapp.pool.maxExpiryTime=3600
#torque.dsfactory.myapp.pool.connectionWaitTimeout=10
#torque.dsfactory.myapp.connection.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver
#torque.dsfactory.myapp.connection.url = 
jdbc:microsoft:sqlserver://ipaddr:1433;DatabaseName=myapp;SelectMethod=cursor
#torque.dsfactory.myapp.connection.user = auser
#torque.dsfactory.myapp.connection.password = apassword

## Using commons-dbcp 
torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
#torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.PerUserPoolDataSourceFactory
torque.dsfactory.myapp.pool.defaultMaxActive=10
torque.dsfactory.myapp.pool.testOnBorrow=true
torque.dsfactory.myapp.pool.validationQuery=@VALIDATION_QUERY@
torque.dsfactory.myapp.connection.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.dsfactory.myapp.connection.url = 
jdbc:microsoft:sqlserver://ipaddr:1433;DatabaseName=myapp;SelectMethod=cursor
torque.dsfactory.myapp.connection.user = jdbcuser
torque.dsfactory.myapp.connection.password = jdbcuser


## Using jndi
#torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
#torque.dsfactory.myapp.jndi.path=jdbc/myapp
#torque.dsfactory.myapp.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.myapp.jndi.java.naming.factory.url.pkgs = org.apache.naming

#torque.dsfactory.myapp.datasource.classname=org.apache.torque.pool.TorqueClassicDataSource
#torque.dsfactory.myapp.datasource.dataSourceName=jdbc/DBmyapp
#torque.dsfactory.myapp.datasource.jndiEnvironment.java.naming.factory.initial 
= org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.myapp.datasource.jndiEnvironment.java.naming.factory.url.pkgs 
= org.apache.naming
#torque.dsfactory.myapp.datasource.defaultMaxConnections=10

## ConnectionPoolDataSource
#torque.dsfactory.myapp.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
#torque.dsfactory.myapp.jndi.path=jdbc/DBmyapp
#torque.dsfactory.myapp.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
#torque.dsfactory.myapp.jndi.java.naming.factory.url.pkgs = org.apache.naming
#torque.dsfactory.myapp.datasource.classname=org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
#torque.dsfactory.myapp.datasource.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver
#torque.dsfactory.myapp.datasource.url = 
jdbc:microsoft:sqlserver://ipaddr:1433;DatabaseName=myapp;SelectMethod=cursor
#torque.dsfactory.myapp.datasource.user = jdbcuser
#torque.dsfactory.myapp.datasource.password = jdbcuser

# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.

torque.idbroker.cleverquantity=true

# Determines whether the managers cache instances of the business objects.
# And also whether the MethodResultCache will really cache results.

torque.manager.useCache = true




On Friday 14 November 2003 11:00 am, Leina Last wrote:
> Hi
>
> I'm connecting to a sql server and put mssqlserver.jar in the jdk
> directory(j2sdk1.4.0) to get to the SQLServerDriver class.
>
> I would like to put the mssqlserver.jar file in the turbine structure \lib\
> directory and not in the jdk directory. Something like
> tdk\apps\app\WEB-INF\lib\mssqlserver.jar.
>
> Is it possible and how can I manage to do it? Need to make changes in
> TurbineResources.properties or any other config file?
>
> I got the following runtime error after placing the jar file in the turbine
> directory structure: Exception:  java.lang.NullPointerException
>  Stack Trace follows:
>  java.lang.NullPointerException
>  at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
>
> Appreciate the help
> Thanks
> L
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org