Re: problem accessing datasource in 5.5.4 application

2004-11-16 Thread Remy Maucherat
On Tue, 16 Nov 2004 02:54:23 -0500, Scott Mueller
[EMAIL PROTECTED] wrote:
 Someone please help me.  The same code that was working fine in tomcat
 5.0.19 does not work anymore in 5.5.4 for accessing the database.

I don't see how it could have worked without a ResourceLink element
for your context. You can define the ResourceLink globally in
conf/context.xml if all your contexts will need it.

-- 
x
Rémy Maucherat
Developer  Consultant
JBoss Group (Europe) SàRL
x

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



RE: problem accessing datasource in 5.5.4 application

2004-11-16 Thread Allistair Crossley
this is all in my blog ..

http://www.adcworks.com/blog/index.php/archives/2004/11/14/getting-up-and-running-with-tomcat-55

 -Original Message-
 From: Remy Maucherat [mailto:[EMAIL PROTECTED]
 Sent: 16 November 2004 11:06
 To: Tomcat Users List
 Subject: Re: problem accessing datasource in 5.5.4 application
 
 
 On Tue, 16 Nov 2004 02:54:23 -0500, Scott Mueller
 [EMAIL PROTECTED] wrote:
  Someone please help me.  The same code that was working 
 fine in tomcat
  5.0.19 does not work anymore in 5.5.4 for accessing the database.
 
 I don't see how it could have worked without a ResourceLink element
 for your context. You can define the ResourceLink globally in
 conf/context.xml if all your contexts will need it.
 
 -- 
 x
 Rémy Maucherat
 Developer  Consultant
 JBoss Group (Europe) SàRL
 x
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Developers of QuickAddress Software
a href=http://www.qas.com;www.qas.com/a
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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



RE: problem accessing datasource in 5.5.4 application

2004-11-16 Thread Scott Mueller
Actually, your log was pretty nice.  I didn't know about that ROOT issue
thanks.  It turned out that I had the following in my ispmanager.xml file:
Context docBase=ispmanager path=
  Realm className=org.apache.catalina.realm.DataSourceRealm
dataSourceName=data/ispmanagerpg debug=99 roleNameCol=Rolename
userCredCol=Password userNameCol=Username userRoleTable=Account_Roles
userTable=Account/
  Resource auth=Container description=IspManager database
name=data/ispmanagerpg type=javax.sql.DataSource/
  ResourceLink global=data/ispmanagerpg name=data/ispmanagerpg
type=javax.sql.DataSource/
/Context  

That worked fine in 5.0.x.  Not in 5.5.4, so I removed the 2 Resource*
elements and it still didn't work.  What finally worked was ONLY removing
the Resource element.

-Original Message-
From: Allistair Crossley [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 16, 2004 6:09 AM
To: Tomcat Users List; Remy Maucherat
Subject: RE: problem accessing datasource in 5.5.4 application

this is all in my blog ..

http://www.adcworks.com/blog/index.php/archives/2004/11/14/getting-up-and-ru
nning-with-tomcat-55

 -Original Message-
 From: Remy Maucherat [mailto:[EMAIL PROTECTED]
 Sent: 16 November 2004 11:06
 To: Tomcat Users List
 Subject: Re: problem accessing datasource in 5.5.4 application
 
 
 On Tue, 16 Nov 2004 02:54:23 -0500, Scott Mueller
 [EMAIL PROTECTED] wrote:
  Someone please help me.  The same code that was working 
 fine in tomcat
  5.0.19 does not work anymore in 5.5.4 for accessing the database.
 
 I don't see how it could have worked without a ResourceLink element
 for your context. You can define the ResourceLink globally in
 conf/context.xml if all your contexts will need it.
 
 -- 
 x
 Rémy Maucherat
 Developer  Consultant
 JBoss Group (Europe) SàRL
 x
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Developers of QuickAddress Software
a href=http://www.qas.com;www.qas.com/a
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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



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



RE: problem accessing datasource in 5.5.4 application

2004-11-16 Thread Scott Mueller
Hi Remy,

Yes, what you said worked thanks!  I had a ResourceLink previously, but I
ALSO had a Resource element without the attributes in my context.xml file.
That didn't work, so I removed both Resource* elements from my context.xml.
That didn't work either.  Removing JUST the Resource element worked:

  Resource auth=Container description=IspManager database
name=data/ispmanagerpg type=javax.sql.DataSource/
  ResourceLink global=data/ispmanagerpg name=data/ispmanagerpg
type=javax.sql.DataSource/
/Context  

That worked fine in 5.0.x.  Not in 5.5.4, so I removed the 2 Resource*
elements and it still didn't work.  What finally worked was ONLY removing
the Resource element.

-Original Message-
From: Remy Maucherat [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 16, 2004 6:06 AM
To: Tomcat Users List
Subject: Re: problem accessing datasource in 5.5.4 application

On Tue, 16 Nov 2004 02:54:23 -0500, Scott Mueller
[EMAIL PROTECTED] wrote:
 Someone please help me.  The same code that was working fine in tomcat
 5.0.19 does not work anymore in 5.5.4 for accessing the database.

I don't see how it could have worked without a ResourceLink element
for your context. You can define the ResourceLink globally in
conf/context.xml if all your contexts will need it.

-- 
x
Rémy Maucherat
Developer  Consultant
JBoss Group (Europe) SàRL
x

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



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



problem accessing datasource in 5.5.4 application

2004-11-15 Thread Scott Mueller
Someone please help me.  The same code that was working fine in tomcat
5.0.19 does not work anymore in 5.5.4 for accessing the database.  I have
the correct postgresql (jdk1.5 compatible) driver in the common/lib
directory.  In server.xml, I have the following resource as a child of the
GlobalNamingResources element:

Resource name=data/ispmanagerpg auth=Container

type=javax.sql.DataSource driverClassName=org.postgresql.Driver

url=jdbc:postgresql://manager.acceleratebiz.com/xxx

username=xxx password=xxx maxActive=20 maxIdle=10
maxWait=-1/

 

That seems to work fine, because in my
webapps/ispmanager/META-INF/context.xml file, I have the following Realm:

Context docBase=ispmanager path=

  Realm className=org.apache.catalina.realm.DataSourceRealm
dataSourceName=data/ispmanagerpg debug=99 roleNameCol=Rolename
userCredCol=Password userNameCol=Username userRoleTable=Account_Roles
userTable=Account/

/Context

 

This works perfectly.  I can login with the correct username/password in my
postgresql database and it works as expected.  The problem is when actually
logged in and referencing a servlet that accesses the database through the
data/ispmanagerpg datasource.  It gives the error below.  This was working
fine in 5.0.19 as I explained above.  Not sure what's different or what I
may have inadvertently changed. I have the correct resource-ref element in
my WEB-INF/web.xml file.

 

2004-11-16 03:41:48,354 ERROR [http-69.60.97.166-443-Processor25]
servlet.CustomXmlProducer (CustomXmlProducer.java:60) - unable to get result
set for this entity

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null'

at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:780)

at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)

at
com.acceleratebiz.manager.util.Database.getConnection(Database.java:31)

at
com.acceleratebiz.manager.servlet.CustomXmlProducer.getCustomerId(CustomXmlP
roducer.java:54)

at
com.acceleratebiz.manager.servlet.CustomXmlProducer.initialize(CustomXmlProd
ucer.java:41)

at
com.acceleratebiz.manager.controlpanel.Traffic.produceXml(Traffic.java:30)

at org.mis.xsltfront.servlet.XmlSource.produceXml(XmlSource.java:33)

at org.mis.xsltfront.servlet.XsltServlet.doGet(XsltServlet.java:56)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)

at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:482)

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)

at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)

at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:731)

at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:526)

at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)

at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.NullPointerException

at java.util.StringTokenizer.init(StringTokenizer.java:182)

at org.postgresql.Driver.parseURL(Driver.java:251)

at org.postgresql.Driver.acceptsURL(Driver.java:159)

at java.sql.DriverManager.getDriver(DriverManager.java:232)

at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:773)

... 24 more

 

 

The last 7 lines of my web.xml file if it helps anyone:

resource-ref

descriptionispmanager database/description

res-ref-namedata/ispmanagerpg/res-ref-name

res-typejavax.sql.DataSource/res-type

res-authContainer/res-auth

/resource-ref

/web-app

 

Scott Mueller

AccelerateBiz Managed Hosting

http://www.acceleratebiz.com http://www.acceleratebiz.com/ 

Phone: (800) 360-7360

Fax: (270) 778-3081