Re: help? JNDI Datasource HOW-TO

2004-02-04 Thread daniel
I found out that the mysql-connector-java-3.0.10-stable-bin.jar needs to be
in the \common\lib directory.
that was all that i over looked :(

thanks eveybody

- Original Message - 
From: Kumar Abhay-CAK203C [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 3:21 PM
Subject: RE: help? JNDI Datasource HOW-TO


 Hello,

 I am having the same problem since last 3 days and no final solution yet I
hv posted the msg 2 time to this gr but all in vain
 Pls share it with me if u hv any solution..

 Abhay


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 03, 2004 1:48 PM
 To: Tomcat Users List
 Subject: help? JNDI Datasource HOW-TO


 i have followed the example but changed the location of the database to
another machine. Tomcat 5.0.18

 the test.jsp returns

 Results
 Foo Not Connected
 Bar -1

 checking the DBTest log i get :


 2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:
Resource parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB,
parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory,
url=jdbc:mysql://internal ip address:3306/javatest?autoReconnect=true,
password=password, maxWait=1, maxActive=100,
driverClassName=org.gjt.mm.mysql.Driver, username=Daniel, maxIdle=30}]
 2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:
Adding resource ref jdbc/TestDB
 2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:
ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factory
ClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shar
eable},{type=auth,content=Container},{type=factory,content=org.apache.common
s.dbcp.BasicDataSourceFactory},{type=url,content=jdbc:mysql://internal ip
address:3306/javatest?autoReconnect=true},{type=password,content=password
},{type=maxWait,content=1},{type=maxActive,content=100},{type=driverClas
sName,content=org.gjt.mm.mysql.Driver},{type=username,content=Daniel},{type=
maxIdle,content=30}]
 2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:
Resource parameters for UserTransaction = null

 at this point im stumped.

 server.xml is :::

 Server port=8005 shutdown=SHUTDOWN debug=0
 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/ Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/ GlobalNamingResources Environment name=simpleValue
type=java.lang.Integer value=30/ Resource name=UserDatabase
auth=Container type=org.apache.catalina.UserDatabase description=User
database that can be updated and saved /Resource 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 port=8080 maxThreads=150 minSpareThreads=25
maxSpareThreads=75 enableLookups=false redirectPort=8443
acceptCount=100 debug=0 connectionTimeout=2
disableUploadTimeout=true/ Connector port=8009 enableLookups=false
redirectPort=8443 debug=0 protocol=AJP/1.3/ Engine name=Catalina
defaultHost=localhost debug=0 Logger
className=org.apache.catalina.logger.FileLogger prefix=catalina_log.
suffix=.txt timestamp=true/ Realm
className=org.apache.catalina.realm.UserDatabaseRealm debug=0
resourceName=UserDatabase/ Host name=localhost debug=0
appBase=webapps unpackWARs=true autoDeploy=true Logger
className=org.apache.catalina.logger.FileLogger directory=logs
prefix=localhost_log. suffix=.txt timestamp=true/ Context
path=/DBTest docBase=DBTest debug=5 reloadable=true
crossContext=true Logger
className=org.apache.catalina.logger.FileLogger
 prefix=localhost_DBTest_log. suffix=.txt
 timestamp=true/
 Resource name=jdbc/TestDB
 auth=Container
 type=javax.sql.DataSource/
 ResourceParams name=jdbc/TestDB
 parameter
 namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
 namemaxActive/name
 value100/value
 /parameter
 parameter
 namemaxIdle/name
 value30/value
 /parameter
 parameter
 namemaxWait/name
 value1/value
 /parameter
 parameter
 nameusername/name
 valueDaniel/value
 /parameter
 parameter
 namepassword/name
 valuepassword/value
 /parameter
 parameter
 namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value
 /parameter
 parameter
 nameurl/name
valuejdbc:mysql://ipaddress:3306/javatest?autoReconnect=true/value
 /parameter
 /ResourceParams
 /Context
 /Host
 /Engine
 /Service
 /Server


 /DBTest/WEB-INF/web.xml:::

 ?xml version=1.0 encoding=ISO-8859-1?
 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
 web-app
 display-namedbtest/display-name
 description
 Welcome to dbtest
 /description
 descriptionMySQL Test App/description
 resource-ref
 descriptionDB Connection/description
res-ref

RE: help? JNDI Datasource HOW-TO

2004-02-03 Thread Kumar Abhay-CAK203C
Hello,

I am having the same problem since last 3 days and no final solution yet I hv posted 
the msg 2 time to this gr but all in vain
Pls share it with me if u hv any solution..

Abhay


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 03, 2004 1:48 PM
To: Tomcat Users List
Subject: help? JNDI Datasource HOW-TO


i have followed the example but changed the location of the database to another 
machine. Tomcat 5.0.18

the test.jsp returns

Results
Foo Not Connected
Bar -1 

checking the DBTest log i get :


2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:   Resource 
parameters for jdbc/TestDB = ResourceParams[name=jdbc/TestDB, 
parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory, 
url=jdbc:mysql://internal ip address:3306/javatest?autoReconnect=true, 
password=password, maxWait=1, maxActive=100, 
driverClassName=org.gjt.mm.mysql.Driver, username=Daniel, maxIdle=30}]
2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:   Adding 
resource ref jdbc/TestDB
2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:   
ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=url,content=jdbc:mysql://internal
 ip 
address:3306/javatest?autoReconnect=true},{type=password,content=password},{type=maxWait,content=1},{type=maxActive,content=100},{type=driverClassName,content=org.gjt.mm.mysql.Driver},{type=username,content=Daniel},{type=maxIdle,content=30}]
2004-02-03 14:19:36 NamingContextListener[/Catalina/localhost/DBTest]:   Resource 
parameters for UserTransaction = null

at this point im stumped.

server.xml is :::

Server port=8005 shutdown=SHUTDOWN debug=0
Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ 
Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener 
debug=0/ GlobalNamingResources Environment name=simpleValue 
type=java.lang.Integer value=30/ Resource name=UserDatabase auth=Container 
type=org.apache.catalina.UserDatabase description=User database that can be updated 
and saved /Resource 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 port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 
enableLookups=false redirectPort=8443 acceptCount=100 debug=0 
connectionTimeout=2 disableUploadTimeout=true/ Connector port=8009 
enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3/ Engine 
name=Catalina defaultHost=localhost debug=0 Logger 
className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt 
timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm 
debug=0 resourceName=UserDatabase/ Host name=localhost debug=0 
appBase=webapps unpackWARs=true autoDeploy=true Logger 
className=org.apache.catalina.logger.FileLogger directory=logs 
prefix=localhost_log. suffix=.txt timestamp=true/ Context path=/DBTest 
docBase=DBTest debug=5 reloadable=true crossContext=true Logger 
className=org.apache.catalina.logger.FileLogger
prefix=localhost_DBTest_log. suffix=.txt
timestamp=true/
Resource name=jdbc/TestDB
auth=Container
type=javax.sql.DataSource/
ResourceParams name=jdbc/TestDB
parameter
namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
namemaxActive/name
value100/value
/parameter
parameter
namemaxIdle/name
value30/value
/parameter
parameter
namemaxWait/name
value1/value
/parameter
parameter
nameusername/name
valueDaniel/value
/parameter
parameter
namepassword/name
valuepassword/value
/parameter
parameter
namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value
/parameter
parameter
nameurl/name 
valuejdbc:mysql://ipaddress:3306/javatest?autoReconnect=true/value
/parameter
/ResourceParams
/Context
/Host
/Engine
/Service
/Server


/DBTest/WEB-INF/web.xml:::

?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN 
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-namedbtest/display-name
description
Welcome to dbtest
/description
descriptionMySQL Test App/description
resource-ref
descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
/web-app


/DBTest/test.jsp

html
head
titleDB Test/title
/head
body
%
foo.DBTest tst = new foo.DBTest();
tst.init();
%
h2Results/h2
Foo %= tst.getFoo() %br/
Bar %= tst.getBar() %
/body
/html


/DBTest/WEB-INF/foo/DBTest.class

package foo;

import javax.naming.*;
import javax.sql.*;
import java.sql.*;


Re: help? JNDI Datasource HOW-TO

2004-02-03 Thread Liem Do
 I am having the same problem since last 3 days and no final solution yet I
hv posted the msg 2 time to this gr but all in vain
 Pls share it with me if u hv any solution..


 /DBTest/WEB-INF/foo/DBTest.class


Not sure if this is the problem but your class file should be under:
/DBTest/WEB-INF/classes/foo/DBTest.class

Everything else looks ok.


HTH,
Liem


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



Re: help? JNDI Datasource HOW-TO

2004-02-03 Thread daniel
oh oops. Thats where i have it otherwise i would never have goten the jsp to
display info.

thanks,
Daniel Schulken
- Original Message - 
From: Liem Do [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 3:52 PM
Subject: Re: help? JNDI Datasource HOW-TO


  I am having the same problem since last 3 days and no final solution yet
I
 hv posted the msg 2 time to this gr but all in vain
  Pls share it with me if u hv any solution..
 
 
  /DBTest/WEB-INF/foo/DBTest.class
 

 Not sure if this is the problem but your class file should be under:
 /DBTest/WEB-INF/classes/foo/DBTest.class

 Everything else looks ok.


 HTH,
 Liem


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




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004


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