Alkey29
Alkey29

Reputation: 199

Tomcat web application only works after I explicitly start it in the /manager page

I have this web application deployed in tomcat. Although it doesn't automatically start after the machine restarts and everything loads up. It only works when I go to the manager page and start it from there or restart the tomcat service.

I get the Error Startlistener and the Severe message:

The web application [web application] registered the JDBC driver [net.sourceforge.jtds.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.

Has anyone experienced this same type of issue? I've ran out of debugging ideas.

Upvotes: 4

Views: 2062

Answers (1)

Sam R.
Sam R.

Reputation: 16450

It seems to me that you have a JDBC driver which causes memory leak an make the Tomcat throw that error. Tomcat 7 has Memory Leak detection and prevention mechanism which warn you if you have driver that has been registered on start-up but did not un-register after termination. Two suggestions:

  1. Un-register the driver explicitly:

    // Example: DriverManager.getDriver("jdbc:mysql://localhost:3306");
    java.sql.Driver mySqlDriver = DriverManager.getDriver("YOUR DRIVER");
    DriverManager.deregisterDriver(mySqlDriver);
    
  2. Use JDBC connection pool on Tomcat

I would personally prefer the connection pool. Also take a look at Apache Tomcat 7: Error listenerStart msg regarding your listenerStart problem.

Upvotes: 4

Related Questions