aspose file tools*
The moose likes Tomcat and the fly likes DBC Driver error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "DBC Driver error" Watch "DBC Driver error" New topic
Author

DBC Driver error

Daniel Sagayaraj
Ranch Hand

Joined: Mar 15, 2010
Posts: 32

Dear Friends,
When i start my tomcat server i get this error.What is it.

SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15657
    
  15

Yamuna Daniel wrote:
Dear Friends,
When i start my tomcat server i get this error.What is it.

SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.


I suspect that the webapp isn't properly releasing all of its database connections when it's done using them.


Customer surveys are for companies who didn't pay proper attention to begin with.
Donald Winston
Greenhorn

Joined: Jul 16, 2010
Posts: 16
I have this problem too;

SEVERE: A web application registered the JBDC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

I'm using the connection pooling facility that comes with tomcat. It does not make sense for the programmer to have to explicitly unregister the driver.
Tomcat should do this. There's no method in the DataSource class to unregister a driver.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

No, you don't have to unregister the driver. But perhaps the system can't do it because there are connections that have not been properly returned to the pool?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Donald Winston
Greenhorn

Joined: Jul 16, 2010
Posts: 16
I haven't attempted to access the database yet in my code. I was just looking at the log to see if my web.xml and context.xml file information caused any problems. All I have done so far is do a lookup on the named data sources.
Donald Winston
Greenhorn

Joined: Jul 16, 2010
Posts: 16
This the only thing I've done so far:
public static void setDataSource(String name) throws NamingException {
Context context = new InitialContext();
context = (Context)context.lookup("java:/env/com/env");
dataSource = (DataSource)context.lookup(name);
}

I keep the datasource around in a singleton class and fetch a connection when necessary in various places in my webapp. I have yet to do this so there are no connections requested by me. But since there's a pool of connections created by tomcat's DBCP tomcat should take care of releasing them when it shuts down.
Donald Winston
Greenhorn

Joined: Jul 16, 2010
Posts: 16
I use the shutdown.sh script to stop tomcat. It should stop my webapp for me and close all the pooled connections my app has created.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DBC Driver error
 
Similar Threads
memory leak error down our site
java.sql.SQLException: No suitable driver
JDBC Driver in Tomcat 4.0
Tomcat4 cann't find MySQL driver
SCHWERWIEGEND: A web application appears to have started a thread named [DefaultQuartzScheduler_Work