The Tomcat web application only works after I explicitly run it on the / manager page

I have this web application deployed to tomcat. Although it does not start automatically after rebooting and loading all components. It only works when I go to the manager page and start it from there or restart the tomcat service.

I get a Startlistener error message and a Severe message:

The web application [web application] registered the JDBC driver [net.sourceforge.jtds.jdbc.Driver], but failed to unregister when the web application was stopped. To prevent a memory leak, the JDBC driver was forcibly unregistered.

Has anyone experienced the same type of problem? I have run out of debugging ideas.

+4
source share
1 answer

It seems to me that you have a JDBC driver that causes a memory leak so that Tomcat chooses this error. Tomcat 7 has a Memory Leak detection and prevention mechanism that alerts you if you have a driver that was registered at startup but was not canceled after completion. Two suggestions:

  • Register the driver incorrectly:

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

I personally would prefer a connection pool . Also see Apache Tomcat 7: Error listenerStart msg regarding your ListenerStart problem.

+4
source

Source: https://habr.com/ru/post/1480175/


All Articles