Spring-Hibernate application: Illegal access: this web application instance has been stopped already

大城市里の小女人 提交于 2019-12-05 02:18:33

First, you probably want to use Spring's transaction manager and Hibernate's OpenSessionInViewFilter to manage Session's and transaction management. With those two you don't have to worry about managing connections and can grab a Session with itsSessionFactory.getCurrentSession().

Next, you should probably add p:testConnectionOnCheckout="true" to your dataSource bean.

What's happening with your application is that once a connection is dead it stays dead. This will allow a dead connection to be restarted.

The problem you are facing is not related to database connections.

I guess you don't face this issue when you restart tomcat and don't redeploy the app, right?

The cause of it is redeploying the application in tomcat. Each time you redeploy the application new instance of a web application is created and the old one is stopped. There is probably an old class loaded by previous application somewhere or the application is not undeployed correctly.

Do you have some jar in tomcat/lib? Could you show the JobQuoteFormController and JobServiceImpl classes?

SwinBlackSea

1.service tomcat stop

2.ps -ef|grep java look the process of java and kill all of them

3.servce tomcat start and then it work

ps:you can look log in tomcat/logs/catilina.out and localhost-2018....log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!