我在群集中运行了2台运行Tomcat 7.0.54的服务器,有时在其中一台服务器上关闭或重新启动JVM时会看到这些上下文管理器警告:
2016-03-01 10:14:53,414 [Thread-8] INFO org.apache.coyote.ajp.AjpProtocol- Pausing ProtocolHandler ["ajp-bio-8106"]
2016-03-01 10:14:53,471 [Thread-8] INFO org.apache.coyote.http11.Http11Protocol- Pausing ProtocolHandler ["http-bio-8206"]
2016-03-01 10:14:53,521 [Thread-8] INFO org.apache.catalina.core.StandardService- Stopping service MyService
2016-03-01 10:14:53,678 [Catalina-startStop-2] INFO org.apache.catalina.ha.session.JvmRouteBinderValve- JvmRouteBinderValve stopped
2016-03-01 10:14:53,757 [localhost-startStop-2] INFO org.apache.catalina.ha.session.DeltaManager- Manager [] expiring sessions upon shutdown
2016-03-01 10:14:53,921 [Tribes-Task-Receiver-5] WARN org.apache.catalina.ha.session.ClusterSessionListener- Context manager doesn't exist:
2016-03-01 10:14:53,936 [Tribes-Task-Receiver-5] WARN org.apache.catalina.ha.session.ClusterSessionListener- Context manager doesn't exist:
2016-03-01 10:14:53,936 [Tribes-Task-Receiver-5] WARN org.apache.catalina.ha.session.ClusterSessionListener- Context manager doesn't exist:
2016-03-01 10:14:53,994 [Tribes-Task-Receiver-5] WARN org.apache.catalina.ha.session.ClusterSessionListener- Context manager doesn't exist:
2016-03-01 10:14:54,018 [Tribes-Task-Receiver-1] WARN org.apache.catalina.ha.session.ClusterSessionListener- Context manager doesn't exist:
...
这曾经发生在旧环境中,运行Tomcat 5.5。 WARN消息将继续,直到Tomcat java进程被终止。在我已经完成的研究中,所有示例都有一个上下文管理器名称"上下文管理器不存在:",但我没有。此外,我已经看到有人说要将日志记录级别更改为SEVERE以禁止这些消息。首先,如果java进程继续运行,除非我手动杀死它,禁止警告不会有任何帮助。其次,我想知道为什么我收到这些警告及其含义......我还没有找到答案。
CONF / context.xml中:
<Context path="" docBase="ROOT" debug="0" reloadable="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
CONF / server.xml中:
<?xml version='1.0' encoding='utf-8'?>
<Server port="8006" shutdown="SHUTDOWN">
<GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="MyService">
<Connector port="8106" maxThreads="300" acceptCount="200" keepAliveTimeout="5" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<Connector port="8206" enableLookups="false" redirectPort="8443" protocol="HTTP/1.1" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">
<Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="<ip address of server 1>"
port="4006"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
<Member className="org.apache.catalina.tribes.membership.StaticMember"
port="4006" securePort="-1"
host="<ip address of server 2>"
domain="tomcat-server-cluster"
uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}" />
</Interceptor>
<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;.*Monitor\.jsp;"/>
<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
<ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
</Host>
</Engine>
</Service>
</Server>