简体   繁体   English

Tomcat Web应用程序仅在我在/ manager页面中显式启动后才能运行

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

I have this web application deployed in tomcat. 我在tomcat中部署了这个Web应用程序。 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. 它只适用于我进入管理器页面并从那里启动它或重新启动tomcat服务。

I get the Error Startlistener and the Severe message: 我得到Error Startlistener和Severe消息:

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. Web应用程序[Web应用程序]注册了JDBC驱动程序[net.sourceforge.jtds.jdbc.Driver],但在Web应用程序停止时无法注销它。 To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 为防止内存泄漏,JDBC驱动程序已被强制取消注册。

Has anyone experienced this same type of issue? 有没有人遇到过这种类型的问题? I've ran out of debugging ideas. 我已经没有调试想法了。

It seems to me that you have a JDBC driver which causes memory leak an make the Tomcat throw that error. 在我看来,你有一个导致内存泄漏的JDBC驱动程序使得Tomcat抛出该错误。 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. Tomcat 7具有Memory Leak检测和预防机制,如果您的驱动程序已在启动时注册但未在终止后取消注册,则会向您发出警告。 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 在Tomcat上使用JDBC连接池

I would personally prefer the connection pool . 我个人更喜欢connection pool Also take a look at Apache Tomcat 7: Error listenerStart msg regarding your listenerStart problem. 另请参阅关于listenerStart问题的Apache Tomcat 7:Error listenerStart msg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM