cassandra-写入错误如何解决?

qni6mghb  于 2021-06-10  发布在  Cassandra
关注(0)|答案(1)|浏览(403)

在我们公司,我们做一个项目,使用apache,cassandra。直到最近,我们还用了一个老司机。昨天,我们尝试用最新的4.3.0替换它。我们连接到数据库,一切正常。问题是当我尝试替换ear文件或添加另一个使用相同代码的子项目时。
在这一点上,我得到了这个错误。

13:23:21,142 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 97) MSC000001: Failed to start service jboss.deployment.subunit."test-ear.ear"."test-ejb.jar".component.TestBean.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test-ear.ear"."test-ejb.jar".component.TestBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:127)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
... 8 more
Caused by: javax.ejb.EJBException: com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1, use getErrors() for more: Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=3bad1448): com.datastax.oss.driver.api.core.connection.ConnectionInitException: [s0|control|connecting...] init query OPTIONS: error writing )
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.tx.BMTInterceptor.handleException(BMTInterceptor.java:83)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.tx.EjbBMTInterceptor.checkStatelessDone(EjbBMTInterceptor.java:91)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:106)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:57)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.weld@18.0.1.Final//org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.as.ejb3@18.0.1.Final//org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at org.jboss.invocation@1.5.2.Final//org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
at org.jboss.as.ee@18.0.1.Final//org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
... 13 more

我试着在网上寻找这个问题,研究他们的文档。我没有找到解决办法。
我连接到数据库的基本代码。

@PostConstruct
public void start() {
    log.info("start");
    CqlSessionBuilder builder = CqlSession.builder();
    builder.addContactEndPoint(new DefaultEndPoint(new InetSocketAddress("127.0.0.1", 9042)));
    builder.withLocalDatacenter("datacenter1");
    session = builder.build();
}

@PreDestroy
public void stop() {
    log.log(Level.INFO, "stop");
    session.close();
}

我使用wildfly作为服务器。当我替换ear文件或添加另一个具有相同代码的文件时,会出现错误。
有什么办法解决吗?

uoifb46i

uoifb46i1#

我有个解决办法。经过两天的搜索和测试,我发现了一个错误。虫子在wildfly18,io.netty。一旦我将io.netty-all打包到项目中,并移除wildfly提供的所有功能,一切都正常。
可能wildfly18提供了一些错误的版本。

相关问题