我们通过 SSL 使用cassandra-driver-core-2.1.9
从Wildfly 10本地连接到Cassandra 2.2.2(在Centos 7.1上,两个单独的服务器,防火墙关闭)。一切似乎都有效,但服务器不断生成以下警告(Wildfly服务器日志):
[Server:a] .[33m.[0m.[33m00:06:33,103 WARN [io.netty.channel.DefaultChannelPipeline] (cluster1-nio-worker-0) An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.timeout.IdleStateEvent.[0m
[Server:a] .[33m at io.netty.handler.timeout.IdleStateHandler$AllIdleTimeoutTask.run(IdleStateHandler.java:433).[0m
[Server:a] .[33m at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38).[0m
[Server:a] .[33m at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120).[0m
[Server:a] .[33m at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357).[0m
[Server:a] .[33m at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357).[0m
[Server:a] .[33m at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111).[0m
[Server:a] .[33m at java.lang.Thread.run(Thread.java:745).[0m
[Server:a] .[33m.[0m
[Server:a] .[33m.[0m.[33m00:06:33,435 WARN [io.netty.channel.DefaultChannelPipeline] (cluster1-nio-worker-1) An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.timeout.IdleStateEvent.[0m
[Server:a] .[33m at io.netty.handler.timeout.IdleStateHandler$AllIdleTimeoutTask.run(IdleStateHandler.java:433).[0m
[Server:a] .[33m at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38).[0m
[Server:a] .[33m at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120).[0m
[Server:a] .[33m at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357).[0m
[Server:a] .[33m at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357).[0m
[Server:a] .[33m at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111).[0m
[Server:a] .[33m at java.lang.Thread.run(Thread.java:745).[0m
[Server:a] .[33m.[0m
当我们在没有SSL的情况下完全相同时,没有警告。其他版本的cassandra驱动程序或netty不做任何更改。 CQLSH没有问题。如果我们从普通的Java SE应用程序中做到完全相同,也没有问题。 所以我认为它与Java bean生命周期有一些共同点,但是我找不到问题。
cassandra.yaml 中的相关设置:
server_encryption_options:
internode_encryption: all
keystore: /etc/pki/cassandra/keys/.keystore
keystore_password: password1
truststore: /etc/pki/cassandra/certs/.truststore
truststore_password: password1
# More advanced defaults below:
# protocol: TLS
# algorithm: SunX509
# store_type: JKS
# cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_12
require_client_auth: false
# enable or disable client/server encryption.
client_encryption_options:
enabled: true
keystore: /etc/pki/cassandra/keys/.keystore
keystore_password: password1
require_client_auth: false
# Set trustore and truststore_password if require_client_auth is true
truststore: /etc/pki/cassandra/certs/.truststore
truststore_password: password1
感谢您的帮助。
答案 0 :(得分:0)
我在一个项目上遇到了同样的问题,添加了io.netty:netty-all依赖解决了它,所以netty是根本原因。