Re: Same old story :( "Cannot load JDBC driver class 'null

Поиск
Список
Период
Сортировка
Искать

Re: Same old story :( "Cannot load JDBC driver class 'null

От:
Bhushan Bhangale <bbhangale@Lastminute.com>
Дата:
keep pg73jdbc3.jar in %CATALINA_HOME%/webapps/Timerecording/WEB-INF/lib

-----Original Message-----
From: Matthias Vach [mailto:matthias.vach@web.de]
Sent: 03 March 2004 15:27
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Same old story :( "Cannot load JDBC driver class 'null'"


Hi all, 
first of all, sorry for this long mail, but i´m working on this problem
since 4 days. And i really 
need help. 
I read a lot of websites about this problem but i still can't fix my problem
so i hope you could 
help me. 
 
Thank you very much. 
 
Every time i try to connect the postgresql-Database with my little JSP
(running in Tomcat) i got 
this Error: 
--> java.sql.SQLException: Cannot load JDBC driver class 'null' <-- 
 
my environment 
----------------------------------------------- 
PostgreDB and Tomcat are running on the same Server. 
- the DB is named "mze" 
- the user for this DB is named also "mze" 
- the user has no password for the DB so it's "" 
 
my Tomcat version 4.1.18 
my Tomcat is listening on Port 4444 
 
my Tomcat-Directory is: /opt/jakarta/tomcat 
the Environment varibabl is: CATALINA_HOME=/opt/jakarta/tomcat 
 
the Name of my Webapplication is: 
%CATALINA_HOME%/webapps/Timerecording 
 
my jsp is lying in: 
%CATALINA_HOME%/webapps/Timerecording/WEB-INF/jsp 
 
my javaclass is lying in: 
%CATALINA_HOME%/webapps/Timerecording/WEB-INF/src 
 
the JDBC-Driver "pg73jdbc3.jar is lying in: 
%CATALINA_HOME%/common/lib 
----------------------------------------------- 
 
 
web.xml of my webapp: 
 ----------------------------------------------- 
  
 
 
 
	.... 
	.... 
 
	 
		postgreSQL Connection 
		jdbc/mze 
		javax.sql.DataSource 
		Container 
	 
 
----------------------------------------------- 
 
 
javaclass of my webapp 
----------------------------------------------- 
public class Order { 
	String connectionState = "Not Connected"; 
 
	public void init() throws Exception { 
		DataSource ds=null; 
		Connection conn=null; 
 
		Context ctx = new InitialContext(); 
		ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mze"); 
 
		try{ 
			conn = ds.getConnection();
//<----------------EXCEPTION HERE 
		} 
		catch(Exception e){ throw new Exception("Boom - No
Connection -->"+e);	} 
 
		try { 
			if (conn != null) { 
				... 
				conn.close(); 
			} 
 
		} 
		catch (Exception e) {throw new Exception(" conn == null -->"
+ e);	} 
	} 
----------------------------------------------- 
 
 
server.xml of my tomcat 
(sorry i don´t know what is important to fix my problem.So it´s very long!
Sorry! 
 the most important is at the tail of this file): 
----------------------------------------------- 
 
 
 
 
 
 
	 
	 
		 
		 
			factory 
	
org.apache.catalina.users.MemoryUserDatabaseFactory 
		 
		 
			pathname 
			conf/tomcat-users.xml 
		 
		 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
	 
 
	 
	 
 
	 
		 
	
usernamesa 
	
password 
			
driverClassNameorg.hsql.jdbcDriver

urljdbc:HypersonicSQL:database mail.smtp.hostlocalhost factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:postgresql://127.0.0.1:5432/mze driverClassName org.postgresql.Driver username mze password mze maxActive 20 maxIdle 10 maxWait 3000 ----------------------------------------------- Thank you for all help Matthias _______________________________________________________________________ Ein Grund zum Feiern: Die PC Praxis ermittelt zwischen 10 grossen Mailprovidern WEB.DE FreeMail als Testsieger http://f.web.de/?mc=021190 ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
FAQ