FAMILY = Father And Mother I Love You

Tomcat标签

Spring 定时任务 No qualifying bean of type TaskScheduler available 及 Could not find default TaskScheduler bean异常处理

最近使用Spring + SpringMvc + Quartz的系统中,使用@annotation注解方式, 直接在类的方法上使用@Scheduled(cron=”0 /5 * * ?”)来实现定时任务,在使用debug日志级别时,启动提示 No qualifying bean of type TaskScheduler available 及 Could not find default TaskScheduler bean异常。可以通过配置日志级别进行解决。

搭建Tomcat集群&通过Redis缓存共享session的一种流行方案

我们使用单台Tomcat的时候不会有共享sesssion的疑虑,只要使用Tomcat的默认配置即可,session即可存储在Tomcat上。但是随着业务的扩大,增加Tomcat节点构成Tomcat集群大势所趋,分布式带来了增加更大规模并发请求的优势,但是也随之到来了一个问题,每个Tomcat只存储来访问自己的请求产生的session,如果Tomcat-A已经为客户端C创建了会话session,那么Tomcat-B并不知道客户端已与集群中的Tomcat-A产生了会话,在访问时就会为C再创建一份session,如果是基于session的验证会话权限的接口(如用户登录认证后才可访问的数据接口),将会导致在访问集群中不同节点的时候重复认证。session的不共享导致原来的会话管理机制在Tomcat集群中无法工作。
4139826312592ba7407981c_articlexjpg

A Step By Step Guide to Tomcat Performance Monitoring

Monitoring the metrics and runtime characteristics of an application server is essential to ensure the adequate functioning of the applications running on that server, as well as to prevent or resolve potential issues in a timely manner.


As far as Java applications go, one of the most commonly used servers is Apache Tomcat, which will be the focus of this article.

Tomcat performance monitoring can be done either by relying on JMX beans or by using a dedicated monitoring tool like MoSKito or JavaMelody.