是 InitSqlSessionListener implements ServletContextListener
类里面的方法执行之后出现警告
public void contextDestroyed(ServletContextEvent sce) {
System.out.println("容器销毁中.....");
// 关闭SqlSessionFactoty对象 并将threadlocal释放
SqlSessionFactoryUtils.close();
}
这个是SqlSessionFactoryUtils的close方法
public static void close() {
SqlSession session = threadLocal.get();
if (session != null) {
session.close();
threadLocal.set(null);
}
}
容器销毁中.....
23-Oct-2019 17:26:39.676 WARNING [RMI TCP Connection(17)-127.0.0.1] org.apache.catalina.util.LifecycleMBeanBase.unregister Failed to unregister MBean with name [Catalina:type=NamingResources,host=localhost,context=/] during component destruction
javax.management.InstanceNotFoundException: Catalina:type=NamingResources,host=localhost,context=/