Re: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-10-22 Thread vijaya prasad pala
Hi Jason,

I tried as u said. But same exception is getting.
I am using tomcat4.1.27, sqlserver 2000.
can u send me ur connection pooling code.
Thank you.

vijay
--- El Toro <[EMAIL PROTECTED]> wrote:
> Where are your jdbc for sql server jars?  Put all
> three under /%TOMCAT_HOME%/common/lib.
> 
> Also, your factoryClassName should be:
> 
>
factoryClassName=org.apache.naming.factory.ResourceFactory
> 
> I'm currently using connection pooling with sql
> server
> and thats the only things i can see that might cause
> you problems.  Also, make sure you don't have any
> duplicate entries for the jdbc for sql server jars
> in
> your classpath.
> 
> Hope That Helps,
> 
> Jason
> 
> --- vijaya prasad pala <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> > 
> > From one week i am trying to solve this problem.
> > Please any one help me.
> > if i am connection directly its ok. but if i am
> > using
> > connection pooling this exception is comming.
> > 
> > my connection pooling syntax in server.xml is
> >
>
--
> > > type="javax.sql.DataSource"/>
> >
> >  
> >factory
> >   
> >
>
org.apache.commons.dbcp.BasicDataSourceFactory
> >  
> >  
> >driverClassName
> >   
> >
>
com.microsoft.jdbc.sqlserver.SQLServerDriver
> >  
> >  
> >url
> >   
> >
>
jdbc:microsoft:sqlserver://vijay2k:1433;databasename=eDMS
> >  
> >  
> >username
> >sa
> >  
> >  
> >password
> >sa
> >  
> >  
> >maxActive
> >20
> >  
> >  
> >maxIdle
> >10
> >  
> >  
> >maxWait
> >-1
> >  
> >
> >
>
-
> >   web.xml
> > ---
> > 
> >  > PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> > Application 2.3//EN"
> > "http://java.sun.com/dtd/web-app_2_3.dtd";>
> > 
> > 
> >   jdbc/edmsCP
> >   javax.sql.DataSource
> >   Container
> > 
> > 
> >
>
---
> > Here is my code.. 
> > ---
> >  public Connection getConnection()
> >  {
> >   Connection conn = null;
> >   try
> >   {
> >Context initCtx = new InitialContext();
> >Context envCtx = (Context)
> > initCtx.lookup("java:comp/env");
> > 
> >if(envCtx == null )
> >  throw new Exception("No Context");
> >else
> >  System.out.println("Context Ok -> " +
> envCtx);
> > 
> >DataSource ds = (DataSource)
> > envCtx.lookup("jdbc/edmsCP");
> > 
> >System.out.println("DataSource ->" + ds);
> > 
> >if (ds != null)
> > conn = ds.getConnection();
> > 
> >   }
> >   catch(Exception ex)
> >   {
> >System.out.println(ex.getMessage());
> >//ex.printStackTrace();
> >   }finally
> >   {
> >return conn;
> >   }
> >  }
> > ---
> > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product
> > search
> > http://shopping.yahoo.com
> > 
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-10-21 Thread El Toro
Where are your jdbc for sql server jars?  Put all
three under /%TOMCAT_HOME%/common/lib.

Also, your factoryClassName should be:

factoryClassName=org.apache.naming.factory.ResourceFactory

I'm currently using connection pooling with sql server
and thats the only things i can see that might cause
you problems.  Also, make sure you don't have any
duplicate entries for the jdbc for sql server jars in
your classpath.

Hope That Helps,

Jason

--- vijaya prasad pala <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> From one week i am trying to solve this problem.
> Please any one help me.
> if i am connection directly its ok. but if i am
> using
> connection pooling this exception is comming.
> 
> my connection pooling syntax in server.xml is
>
--
> type="javax.sql.DataSource"/>
>
>  
>factory
>   
>
org.apache.commons.dbcp.BasicDataSourceFactory
>  
>  
>driverClassName
>   
>
com.microsoft.jdbc.sqlserver.SQLServerDriver
>  
>  
>url
>   
>
jdbc:microsoft:sqlserver://vijay2k:1433;databasename=eDMS
>  
>  
>username
>sa
>  
>  
>password
>sa
>  
>  
>maxActive
>20
>  
>  
>maxIdle
>10
>  
>  
>maxWait
>-1
>  
>
>
-
>   web.xml
> ---
> 
>  PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd";>
> 
> 
>   jdbc/edmsCP
>   javax.sql.DataSource
>   Container
> 
> 
>
---
> Here is my code.. 
> ---
>  public Connection getConnection()
>  {
>   Connection conn = null;
>   try
>   {
>Context initCtx = new InitialContext();
>Context envCtx = (Context)
> initCtx.lookup("java:comp/env");
> 
>if(envCtx == null )
>  throw new Exception("No Context");
>else
>  System.out.println("Context Ok -> " + envCtx);
> 
>DataSource ds = (DataSource)
> envCtx.lookup("jdbc/edmsCP");
> 
>System.out.println("DataSource ->" + ds);
> 
>if (ds != null)
> conn = ds.getConnection();
> 
>   }
>   catch(Exception ex)
>   {
>System.out.println(ex.getMessage());
>//ex.printStackTrace();
>   }finally
>   {
>return conn;
>   }
>  }
> ---
> 
> 
> 
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-06-20 Thread Roberts, Eric
Hi,

If you have declared your database connection pools ast the GlobalNamingResource 
level, but do not have your contexts declarared in server.xml, you probably need to 
have context.xml files in your META-INF subdirectory which contain your ResourceLink 
definitions for the context.

HTH

-Original Message-
From: Michael Holly [mailto:[EMAIL PROTECTED]
Sent: 18 June 2003 17:21
To: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


In trying to make the move to automate my testing I have come up
against a problem.

First some background.
I am running Tomcat 4.1.18, Java 1.3.1, Win 2k

Part of getting on automated testing was getting the ANT build
to undeploy and then redeploy the war after it got created.
In addition, I decided that it was more convenient to have the
Test classes located in myapp.war instead of a seperate war.

Part of getting this dynamic undeploy/deploy cycle to work was
removing the  from the server.xml. The reason I want to
do this is I have 2 connection pools located there. In a dynamic
deploy tomcat generates it's own context for the app. I found there
were three ways I could do this.

#1. put the connection pool into the  section
of server.xml

#2. create a $APP_NAME.xml file that contains the context of the app
and put it into $TOMCAT_HOME/webapps. Both the Tomcat manager and
Admin apps do this.

#3. Possibly put the context info in the web.xml file for the app.

I have tried both 1 and 2 and I am getting a
java.sql.SQLException: Cannot load JDBC driver class 'null' error
when the DBCP is accessed. The classes12.jar file is located in
$TOMCAT_HOME/common/lib.  It has been renamed from .zip to .jar

Is there something special that I have to do to make the pools
available to my application?

As you can tell from the included files I am using configuring a connection
pool
for two different connections. Below are my files for Option #2 (the one
I would like to go with). Do I have the  defined correctly?
Is there something I am missing?

Some Observations.
The app seems to deploy correctly. ( I can see app in Tomcat manager )
Using the Tomcat Admin facility I can see my DataSources.

WEB.XML-


http://java.sun.com/dtd/web-app_2_3.dtd";>


TSR Application
This is the web configuration for the TSR
application



TestServlet
net.talisen.tsr.servlets.TestServlet



ControllerServlet

net.talisen.tsr.servlets.ControllerServlet



FileDownloadServlet

net.talisen.tsr.servlets.FileDownloadServlet



   StartupServlet

net.talisen.tsr.servlets.StartupServlet
   1






  JUnitEETestServlet
  JUnitEE test runner
  org.junitee.servlet.JUnitEEServlet




TestServlet
/test



StartupServlet
/startup



ControllerServlet
/controller



FileDownloadServlet
/download




  JUnitEETestServlet
  /TestServlet/*




  
   Resource reference to a factory for java.sql.Connection
   instances that may be used for talking to a particular
   database that is configured in the server.xml file.
  

  
 jdbc/oracle_tsr
  
  
 javax.sql.DataSource
  
  
 Container
  
   




  
   Resource reference to a factory for java.sql.Connection
   instances that may be used for talking to a particular
   database that is configured in the server.xml file.
  

  
 jdbc/oracle_myco
  
  
 javax.sql.DataSource
  
  
 Container
  
   

WEB.XML-



TSR.XML-


   
   

   

   
  
 factory

org.apache.commons.dbcp.BasicDataSourceFactory
  
  
 driverClassName
 oracle.jdbc.OracleDriver
  
  
 url
 
 jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver.myco.com)(PORT = 1521)))
(CONNECT_DATA = (SERVER = DEDICATED) (SID = MYCO)))
  
  
 username
 tsr_app
  
  
 password
 actuator
  
  
 maxActive
 20
  
  
 maxIdle
 10
  
  
 maxWait
 -1
  
  
 validationQuery
 select 'validationQuery' from dual
 

RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-03-13 Thread KKolle

Hi Michael,

I sent an email to this list yesterday saying that I figured out the
problemand yes, I only have the JAR under /lib.

Thanks!


   
  
"Tam, Michael" 
  
<[EMAIL PROTECTED]   To: 'Tomcat Users List' <[EMAIL 
PROTECTED]>  
can.gc.ca> cc: 
  
   Subject: RE: java.sql.SQLException: 
Cannot load JDBC driver class 
03/12/2003 11:23'null' 
  
AM 
  
Please respond 
  
to "Tomcat Users   
  
List"  
  
   
  
   
  




Hi Kevin,

You should not put any CLASS in lib at all.  It is the place for jars only.
Get rib of all the MySQL JDBC driver files anywhere in your webapp and put
the mysql jdbc driver jar file into lib and restart tomcat and see if this
will resolve your problem.  By the way, which version of the driver are you
using, I believe the recent versions are changing the url to something like
'com.mysql.jdbc.Driver'.  'org.gjt.mm.mysql.Driver' is still valid but I
believe it will phase out eventually.

Regards,
Michael

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 1:58 PM
To: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


Tomcat version - 4.1.12
MySQL version - 3.23.55-nt
OS - WinNT
JDK - 1.4.1_01

I have researched this problem on the internet and in the documentation for
Tomcat, and I still haven't resolved this issue. So, I'm looking for help
from
someone from this list.

Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp
Here is the error I receive:

java.sql.SQLException: Cannot load JDBC driver class 'null' at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:529)

Referencing this URL -
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html:
1. I have a database and table with 1 row of data
2. Here is the chunk of code that I inserted into my
$CATALINA_HOME/conf/server.xml.

  

   

   

   
   
 factory

org.apache.commons.dbcp.BasicDataSourceFactory
   

   
   
 maxActive
 100
   

   
   
 maxIdle
 30
   

   
   
 maxWait
 1
   

   
   
username
bugtracker
   
   
password
footin
   

   
   
  driverClassName
  org.gjt.mm.mysql.Driver
   

   
   
 url

jdbc:mysql://localhost:3306/bugtracker
   
   
   
3. Here is my web.xml under $CATALINA_HOME/webapps/dbtest/web-inf/web.xml:
 
http://java.sun.com/dtd/web-app_2_3.dtd";>

  MySQL Test App
  
  DB Connection
  jdbc/TestDB
  javax.sql.DataSource
  Container
  


4. Added my DB Driver under
$CATALINA_HOME/webapps/dbtest/lib/org/git/mm/mysql/Driver.class. I also
tried
just putting the jar file under the /lib.

5. Created a JSP and class just like in the example above. I just changed my
select statement inside the class, that's all.

6. I have verified that my database is indeed running.

7. In my.ini (for MySQL), the port setting is NOT commented. The
bind-address IS
commented out.

Thanks for any help!
Kevin


-
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: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-03-12 Thread Tam, Michael
Hi Kevin,

You should not put any CLASS in lib at all.  It is the place for jars only.
Get rib of all the MySQL JDBC driver files anywhere in your webapp and put
the mysql jdbc driver jar file into lib and restart tomcat and see if this
will resolve your problem.  By the way, which version of the driver are you
using, I believe the recent versions are changing the url to something like
'com.mysql.jdbc.Driver'.  'org.gjt.mm.mysql.Driver' is still valid but I
believe it will phase out eventually.

Regards,
Michael

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 1:58 PM
To: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


Tomcat version - 4.1.12
MySQL version - 3.23.55-nt
OS - WinNT
JDK - 1.4.1_01

I have researched this problem on the internet and in the documentation for
Tomcat, and I still haven't resolved this issue. So, I'm looking for help
from
someone from this list.

Here is my URL that I invoke: http://localhost:8080/dbtest/test.jsp
Here is the error I receive:

java.sql.SQLException: Cannot load JDBC driver class 'null' at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:529)

Referencing this URL -
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html:
1. I have a database and table with 1 row of data
2. Here is the chunk of code that I inserted into my
$CATALINA_HOME/conf/server.xml.

  

   

   

   
   
 factory
 
org.apache.commons.dbcp.BasicDataSourceFactory
   

   
   
 maxActive
 100
   

   
   
 maxIdle
 30
   

   
   
 maxWait
 1
   

   
   
username
bugtracker
   
   
password
footin
   

   
   
  driverClassName
  org.gjt.mm.mysql.Driver
   

   
   
 url

jdbc:mysql://localhost:3306/bugtracker
   
   
   
3. Here is my web.xml under $CATALINA_HOME/webapps/dbtest/web-inf/web.xml:
 
http://java.sun.com/dtd/web-app_2_3.dtd";>

  MySQL Test App
  
  DB Connection
  jdbc/TestDB
  javax.sql.DataSource
  Container
  


4. Added my DB Driver under
$CATALINA_HOME/webapps/dbtest/lib/org/git/mm/mysql/Driver.class. I also
tried
just putting the jar file under the /lib.

5. Created a JSP and class just like in the example above. I just changed my
select statement inside the class, that's all.

6. I have verified that my database is indeed running.

7. In my.ini (for MySQL), the port setting is NOT commented. The
bind-address IS
commented out.

Thanks for any help!
Kevin


-
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: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-01-02 Thread Anastasios Angelidis
Doh! Teach me for staying up so late :P

Thanks it works.

shawn wrote:


Try changing this value 


Shouldn't it be jdbc/InfectedDB ?

That's my guess.

Shawn

On Thu, 2003-01-02 at 12:29, Anastasios Angelidis wrote:
 

Hi I downloaded the MySQL Connector/J 2.0.14 JDBC drivers and I copied 
the mysql-connector-java-2.0.14-bin.jar to the common/lib folder...

Here is my server.xml  config...


   
   
   
   
factoryorg.apache.commons.dbcp.BasicDataSourceFactory
   maxActive100
   maxIdle30
   maxWait1
   usernamexx
   passwordxx
   
driverClassNamecom.mysql.jdbc.Driver
   
urljdbc:mysql://localhost:3306/infected
   


Here is my web.xml...


   infected rhythms
 infected rhythms web site
 
   DB Connection
   jdbc/InfectedDB
   javax.sql.DataSource
   Container
   



Then I worte this simple JSP code...

try
{
   Context ctx = new InitialContext();

   DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/InfectedDB");

   Connection conn = ds.getConnection();

   The rest of the code...
}
catch(Exception ex)
{
   ex.printStackTrace();
}

The exception os caught whne trying to get the connection Connection 
conn = ds.getConnection(); Any ideas? Thanks
The stack trace...

java.sql.SQLException: Cannot load JDBC driver class 'null'
   at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
   at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
   at org.apache.jsp.artists_jsp._jspService(artists_jsp.java:57)
   at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

   at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
   at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

   at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
   at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
   at java.lang.Thread.run(Thread.java:536)


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 
   




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: java.sql.SQLException: Cannot load JDBC driver class 'null'

2003-01-01 Thread shawn
Try changing this value 


Shouldn't it be jdbc/InfectedDB ?

That's my guess.

Shawn

On Thu, 2003-01-02 at 12:29, Anastasios Angelidis wrote:
> Hi I downloaded the MySQL Connector/J 2.0.14 JDBC drivers and I copied 
> the mysql-connector-java-2.0.14-bin.jar to the common/lib folder...
> 
> Here is my server.xml  config...
> 
>  crossContext="true">
>  prefix="localhost_infected_log." suffix=".txt" timestamp="true"/>
>  type="javax.sql.DataSource"/>
> 
> 
> 
>factoryorg.apache.commons.dbcp.BasicDataSourceFactory
> maxActive100
> maxIdle30
> maxWait1
> usernamexx
> passwordxx
> 
> 
>driverClassNamecom.mysql.jdbc.Driver
> 
> 
>urljdbc:mysql://localhost:3306/infected
> 
> 
> 
> Here is my web.xml...
> 
> 
> infected rhythms
>   infected rhythms web site
>   
> DB Connection
> jdbc/InfectedDB
> javax.sql.DataSource
> Container
> 
> 
> 
> 
> Then I worte this simple JSP code...
> 
> try
> {
> Context ctx = new InitialContext();
> 
> DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/InfectedDB");
> 
> Connection conn = ds.getConnection();
> 
> The rest of the code...
> }
> catch(Exception ex)
> {
> ex.printStackTrace();
> }
> 
> The exception os caught whne trying to get the connection Connection 
> conn = ds.getConnection(); Any ideas? Thanks
> The stack trace...
> 
> java.sql.SQLException: Cannot load JDBC driver class 'null'
> at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
> at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
> at org.apache.jsp.artists_jsp._jspService(artists_jsp.java:57)
> at 
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at 
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
> at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at 
> 
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
> at 
> 
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
> at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
> at 
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> at 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
> at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
> at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
> at 
> 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
> at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
> at 
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
> at 
> o

RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberto Bouza

Eric,

I'm sure that the context lookup is fine and works both ways with the "/" and
without the "/", why, I tested both ways and I can bind with the JNDI Resource,
if the problem were there then I get like a NamingException or
NamingResourceNotFound beacuse the binding name were wrong. 

Am I right? or I'm missing something?

//Context envCtx = (Context) ctx.lookup("java:/comp/env");
//DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");
DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/art");

Thanks.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberto Bouza

 Eric,

 I tried that, but I still get the same error...

Quoting "Roberts, Eric" <[EMAIL PROTECTED]>:

> Roberto,
> 
> Subtle difference between my code and yours:
> 
>ctx = new InitialContext();
>Context envCtx = (Context) ctx.lookup("java:/comp/env/");
>DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");
> 
> Note the "/" characters after java:/comp/env
> and before jdbc/art
> 
> I was getting the same error with Oracle as you are with PostgreSQL.
> 
> -Original Message-
> From: Roberto Bouza [mailto:[EMAIL PROTECTED]]
> Sent: Donnerstag, 05. Dezember 2002 15:47
> To: Tomcat Users List
> Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null'
> 
> 
> 
>  Well...
> 
>  I forgot to put a part of my .java is like this:
> 
>  -- DBTest.java --
> 
>   Context ctx = new InitialContext();
>   
>   if(ctx == null ) 
>   throw new Exception("Boom - No Context");
>   
>   Context envContext  = (Context)ctx.lookup("java:/comp/env"); 
>   DataSource ds = (DataSource)envContext.lookup("jdbc/art");
> 
>   // I tested both ways
>   //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/art");
> 
>   if (ds != null) {
>  Connection conn = ds.getConnection();
> 
>.
> 
>  --- END DBTest.java ---
> 
>  The weird thing is I create a simple class DB, to load the PostgreSQL
> Driver,
> connect to the database and do some simple queries - The driver is in my
> $CATALINA_HOME/common/lib - and all works fine I can load the driver without
> any
> problem... but, when I used the DBCP - BOOM - java.sql.SQLException:
> Cannot
> load JDBC driver class 'null'...
> 
>  Thanks you for your help.
> 
> -- 
> = Roberto Bouza Fraga   =
> ===
>   Research & Development Engineer
>Ella Cisneros Fontanals Holdings
>  Ph: (305)-860-0116 / Fax:(305)-860-9401
> ===
>e-Mail:[EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 


-- 
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

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




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberts, Eric
Roberto,

Subtle difference between my code and yours:

   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");

Note the "/" characters after java:/comp/env
and before jdbc/art

I was getting the same error with Oracle as you are with PostgreSQL.

-Original Message-
From: Roberto Bouza [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 05. Dezember 2002 15:47
To: Tomcat Users List
Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null'



 Well...

 I forgot to put a part of my .java is like this:

 -- DBTest.java --

  Context ctx = new InitialContext();

  if(ctx == null ) 
throw new Exception("Boom - No Context");

  Context envContext  = (Context)ctx.lookup("java:/comp/env"); 
  DataSource ds = (DataSource)envContext.lookup("jdbc/art");

  // I tested both ways
  //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/art");

  if (ds != null) {
 Connection conn = ds.getConnection();

   .

 --- END DBTest.java ---

 The weird thing is I create a simple class DB, to load the PostgreSQL Driver,
connect to the database and do some simple queries - The driver is in my
$CATALINA_HOME/common/lib - and all works fine I can load the driver without any
problem... but, when I used the DBCP - BOOM - java.sql.SQLException: Cannot
load JDBC driver class 'null'...

 Thanks you for your help.

-- 
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

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


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




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberto Bouza

 Well...

 I forgot to put a part of my .java is like this:

 -- DBTest.java --

  Context ctx = new InitialContext();

  if(ctx == null ) 
throw new Exception("Boom - No Context");

  Context envContext  = (Context)ctx.lookup("java:/comp/env"); 
  DataSource ds = (DataSource)envContext.lookup("jdbc/art");

  // I tested both ways
  //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/art");

  if (ds != null) {
 Connection conn = ds.getConnection();

   .

 --- END DBTest.java ---

 The weird thing is I create a simple class DB, to load the PostgreSQL Driver,
connect to the database and do some simple queries - The driver is in my
$CATALINA_HOME/common/lib - and all works fine I can load the driver without any
problem... but, when I used the DBCP - BOOM - java.sql.SQLException: Cannot
load JDBC driver class 'null'...

 Thanks you for your help.

-- 
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Kristján Bjarni Guðmundsson

Return Receipt
   
Your  RE: java.sql.SQLException: Cannot load JDBC driver class 
document  'null'   
:  
   
was   Kristján Bjarni Guðmundsson/BIS/Dev/REK/Hugvit   
received   
by:
   
at:   05.12.2002 09:54:24  
   





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberts, Eric
Lamy,

If you put your resource in the Global Naming Resources section of server.xml you need 
to put a ResourceLink to that resource in your context.

Below works for me:

   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/name_of_resource_link");



-Original Message-
From: LAMY Olivier [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 05. Dezember 2002 10:14
To: Tomcat Users List
Subject: Re: java.sql.SQLException: Cannot load JDBC driver class 'null'


Normally it's

InitialContext initContext=new InitialContext();
DataSource ds = (DataSource) envCtx.lookup("java:/comp/env/jdbc/art");

I have the same problem. I tried to move my ressources declaration from the
context to the .
And it doesn't work ???

- Original Message -
From: "Roberts, Eric" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 9:45 AM
Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null'


Roberto,

How are you instantiating your datasource?

You need something like:

import javax.naming.Context;
import javax.naming.InitialContext;
.
.
.
   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");

Hope this helps.

-Original Message-
From: Roberto Bouza [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 04. Dezember 2002 23:05
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


 Hi.

 I think I have all the configuration fine, but for some reason when my
DBTest
try to get the connection from the DB I only get this:

 - ERRORS start 

java.sql.SQLException: Cannot load JDBC driver class 'null'
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:529)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.j
ava:312)
at poseidon.ext.DBTest.init(DBTest.java:27)

-- ERRORS end -

 What's done:

 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL
Driver),
commons-collections.jar, commons-pool.jar, commons-dbcp.jar
 2.) My server.xml:

--- SERVER XML starts 

   

  

  
  factory
  org.apache.commons.dbcp.BasicDataSourceFactory
  

  
  driverClassName
  org.postgresql.Driver
  

  
  url

jdbc:postgresql://efch-mia-sr-02.efcholdings.com:5432/efch-art
  

  
  username
  [username]
  

  
  password
  [password]
  

  
  maxActive
  20
  

  
  maxIdle
  10
  

  
  maxWait
  100
  

  

  --- SERVER.XML end --

 All that code inside a context tag.

  3.) My web.xml

 - STARTS ---
   
postgreSQL Art's Datasource
jdbc/art
javax.sql.DataSource
Container
  
   - END ---

5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk
1.4.1

Tomcat starts fine, all works fine but when my DBTest is triying to get
the
connection I get the error mentioned before. I really don't know why tomcat
is
not seeing the Driver if it is on common/lib...???

Thanks in advance for your help.
--
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

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


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



**  
Ce message électronique et tous les fichiers joints ainsi que  les
informations contenues dans ce message (ci après "le message"), sont
confidentiels et destinés exclusivement à l'usage de la  personne à laquelle
ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le
renvoyer à son émetteur et de le détruire. Toute diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que ce soit non
expressément autorisées de ce message, sont interdites.  

**  
This e-mail, any attachments and the information contained (herein " the
message") are confidential and intended solely for the use of the
addressee(s) if you have receive

Re: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread LAMY Olivier
Normally it's

InitialContext initContext=new InitialContext();
DataSource ds = (DataSource) envCtx.lookup("java:/comp/env/jdbc/art");

I have the same problem. I tried to move my ressources declaration from the
context to the .
And it doesn't work ???

- Original Message -
From: "Roberts, Eric" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 9:45 AM
Subject: RE: java.sql.SQLException: Cannot load JDBC driver class 'null'


Roberto,

How are you instantiating your datasource?

You need something like:

import javax.naming.Context;
import javax.naming.InitialContext;
.
.
.
   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");

Hope this helps.

-Original Message-
From: Roberto Bouza [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 04. Dezember 2002 23:05
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


 Hi.

 I think I have all the configuration fine, but for some reason when my
DBTest
try to get the connection from the DB I only get this:

 - ERRORS start 

java.sql.SQLException: Cannot load JDBC driver class 'null'
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:529)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.j
ava:312)
at poseidon.ext.DBTest.init(DBTest.java:27)

-- ERRORS end -

 What's done:

 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL
Driver),
commons-collections.jar, commons-pool.jar, commons-dbcp.jar
 2.) My server.xml:

--- SERVER XML starts 

   

  

  
  factory
  org.apache.commons.dbcp.BasicDataSourceFactory
  

  
  driverClassName
  org.postgresql.Driver
  

  
  url

jdbc:postgresql://efch-mia-sr-02.efcholdings.com:5432/efch-art
  

  
  username
  [username]
  

  
  password
  [password]
  

  
  maxActive
  20
  

  
  maxIdle
  10
  

  
  maxWait
  100
  

  

  --- SERVER.XML end --

 All that code inside a context tag.

  3.) My web.xml

 - STARTS ---
   
postgreSQL Art's Datasource
jdbc/art
javax.sql.DataSource
Container
  
   - END ---

5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk
1.4.1

Tomcat starts fine, all works fine but when my DBTest is triying to get
the
connection I get the error mentioned before. I really don't know why tomcat
is
not seeing the Driver if it is on common/lib...???

Thanks in advance for your help.
--
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

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


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



**  
Ce message électronique et tous les fichiers joints ainsi que  les
informations contenues dans ce message (ci après "le message"), sont
confidentiels et destinés exclusivement à l'usage de la  personne à laquelle
ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le
renvoyer à son émetteur et de le détruire. Toute diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que ce soit non
expressément autorisées de ce message, sont interdites.  

**  
This e-mail, any attachments and the information contained (herein " the
message") are confidential and intended solely for the use of the
addressee(s) if you have received this message in error please send it back
to the sender and delete it. Unauthorized publication, use, dissemination or
disclosure, either whole or partial, of this  message is strictly
prohibited.

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




RE: java.sql.SQLException: Cannot load JDBC driver class 'null'

2002-12-05 Thread Roberts, Eric
Roberto,

How are you instantiating your datasource?

You need something like:

import javax.naming.Context;
import javax.naming.InitialContext;
.
.
.
   ctx = new InitialContext();
   Context envCtx = (Context) ctx.lookup("java:/comp/env/");
   DataSource ds = (DataSource) envCtx.lookup("/jdbc/art");

Hope this helps.

-Original Message-
From: Roberto Bouza [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 04. Dezember 2002 23:05
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: java.sql.SQLException: Cannot load JDBC driver class 'null'


 Hi.

 I think I have all the configuration fine, but for some reason when my DBTest
try to get the connection from the DB I only get this:

 - ERRORS start 

java.sql.SQLException: Cannot load JDBC driver class 'null'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:529)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.j
ava:312)
at poseidon.ext.DBTest.init(DBTest.java:27)

-- ERRORS end -

 What's done:

 1.) In the $CATALINA_HOME/common/lib I have postgresql.jar (PostgreSQL Driver),
commons-collections.jar, commons-pool.jar, commons-dbcp.jar
 2.) My server.xml:

--- SERVER XML starts 



  
  
  
  factory
  org.apache.commons.dbcp.BasicDataSourceFactory
  

  
  driverClassName
  org.postgresql.Driver
  
  
  
  url
  jdbc:postgresql://efch-mia-sr-02.efcholdings.com:5432/efch-art
  

  
  username
  [username]
  
  
  
  password
  [password]
  

  
  maxActive
  20
  

  
  maxIdle
  10
  

  
  maxWait
  100
  

  

  --- SERVER.XML end --
 
 All that code inside a context tag.

  3.) My web.xml

 - STARTS ---
   
postgreSQL Art's Datasource
jdbc/art
javax.sql.DataSource
Container
  
   - END ---

5.) I'm using Tomcat 4.1.16 with Apache 2.0, Plus PostgreSQL 7.3 and jdk 1.4.1

Tomcat starts fine, all works fine but when my DBTest is triying to get the
connection I get the error mentioned before. I really don't know why tomcat is
not seeing the Driver if it is on common/lib...???

Thanks in advance for your help.
-- 
= Roberto Bouza Fraga   =
===
  Research & Development Engineer
   Ella Cisneros Fontanals Holdings
 Ph: (305)-860-0116 / Fax:(305)-860-9401
===
   e-Mail:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: