3

app1.war と app2.war を同じ tomcat jvm にデプロイしました。どちらのアプリにも独自のコンテキスト xml (app1.xml と app2.xml) があります。どちらのアプリケーションにも、Cassandra に接続するための datastax ドライバーの依存関係が含まれています。個別にデプロイすると、うまく動作します。しかし、両方が同じ jvm にデプロイされている場合、ログに以下の JMX 例外が表示されます。

[DEBUG] [TokenId=] [2015-07-29 20:54:35.177] [DefaultListableBeanFactory] - [Eagerly caching bean 'cluster' to allow for resolving potential circular references]
[DEBUG] [TokenId=] [2015-07-29 20:54:35.191] [DefaultListableBeanFactory] - [Invoking afterPropertiesSet() on bean with name 'cluster']
[DEBUG] [TokenId=] [2015-07-29 20:54:35.199] [SystemProperties] - [com.datastax.driver.NEW_NODE_DELAY_SECONDS is undefined, using default value 1]
[DEBUG] [TokenId=] [2015-07-29 20:54:35.199] [SystemProperties] - [com.datastax.driver.NON_BLOCKING_EXECUTOR_SIZE is undefined, using default value 16]
[DEBUG] [TokenId=] [2015-07-29 20:54:35.205] [SystemProperties] - [com.datastax.driver.NOTIF_LOCK_TIMEOUT_SECONDS is undefined, using default value 60]
[WARN ] [TokenId=] [2015-07-29 20:54:35.217] [FrameCompressor] - [Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression
will not be available for the protocol.]
[WARN ] [TokenId=] [2015-07-29 20:54:35.219] [FrameCompressor] - [Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not
be available for the protocol.]
[DEBUG] [TokenId=] [2015-07-29 20:54:35.356] [Cluster] - [Starting new cluster with contact points [xxxxx1.com/10.63.162.182:9042, xxxx2.com/10.63.162.177:9042, xxxx3.com/10.63.162.183:9042]]
[DEBUG] [TokenId=] [2015-07-29 20:54:35.556] [JmxReporter] - [Unable to register gauge]
javax.management.InstanceAlreadyExistsException: cluster1-metrics:name=open-connections
        at com.sun.jmx.mbeanserver.Repository.addMBean(Unknown Source) ~[?:1.7.0_45]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(Unknown Source) ~[?:1.7.0_45]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(Unknown Source) ~[?:1.7.0_45]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Unknown Source) ~[?:1.7.0_45]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Unknown Source) ~[?:1.7.0_45]
        at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(Unknown Source) ~[?:1.7.0_45]
        at com.codahale.metrics.JmxReporter$JmxListener.onGaugeAdded(JmxReporter.java:494) [metrics-core-3.0.2.jar:3.0.2]
        at com.codahale.metrics.MetricRegistry.notifyListenerOfAddedMetric(MetricRegistry.java:344) [metrics-core-3.0.2.jar:3.0.2]
        at com.codahale.metrics.MetricRegistry.addListener(MetricRegistry.java:187) [metrics-core-3.0.2.jar:3.0.2]
        at com.codahale.metrics.JmxReporter.start(JmxReporter.java:697) [metrics-core-3.0.2.jar:3.0.2]
        at com.datastax.driver.core.Metrics.<init>(Metrics.java:77) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:1204) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster$Manager.<init>(Cluster.java:1144) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster.<init>(Cluster.java:121) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster.<init>(Cluster.java:108) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:177) [cassandra-driver-core-2.1.4.jar:?]
        at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1109) [cassandra-driver-core-2.1.4.jar:?]

アプリケーションは機能的に動作します。このエラーが表示される理由と、これを回避する方法が気になります。

4

1 に答える 1