它可以在idea上运行,但是当我生成一个可运行的jar文件并在windows窗口上运行它时,它失败了:
INFO [vert.x-worker-thread-0] CONTAINER - ISPN000128: Infinispan version: Infinispan 'Taedonggang' 12.1.7.Final
INFO [vert.x-worker-thread-0] CONTAINER - ISPN000556: Starting user marshaller 'org.infinispan.commons.marshall.ImmutableProtoStreamMarshaller'
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000078: Starting JGroups channel ISPN with stack jgroups
WARN [vert.x-worker-thread-0] Configurator - JGRP000014: STABLE.stability_delay has been deprecated: always 0
INFO [vert.x-worker-thread-0] GMS - PC-JiangZhiBing-64711: no members discovered after 2005 ms: creating cluster as coordinator
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000094: Received new cluster view for channel ISPN: [PC-JiangZhiBing-64711|0] (1) [PC-JiangZhiBing-64711]
INFO [vert.x-worker-thread-0] CLUSTER - ISPN000079: Channel ISPN local address is PC-JiangZhiBing-64711, physical addresses are [192.168.75.1:7800]
ERROR [vert.x-eventloop-thread-0] VertxImpl - Failed to initialize clustered Vert.x
java.lang.NullPointerException: Cannot invoke "org.infinispan.factories.impl.ComponentRef.running()" because the return value of "org.infinispan.factories.impl.BasicComponentRegistry.getComponent(java.lang.Class)" is null
at org.infinispan.counter.EmbeddedCounterManagerFactory.asCounterManager(EmbeddedCounterManagerFactory.java:35)
at io.vertx.ext.cluster.infinispan.InfinispanClusterManager.lambda$join$6(InfinispanClusterManager.java:275)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)
at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:831)
INFO [vert.x-worker-thread-1] DefaultCacheManager - Stopping cache manager null on PC-JiangZhiBing-64711
INFO [vert.x-worker-thread-1] CLUSTER - ISPN000080: Disconnecting JGroups channel ISPN <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>版本为4.2.5
非常感谢。
发布于 2022-03-19 11:27:41
哦,当我从:https://vertx.io/docs/vertx-infinispan/java/上读到Vertx时
问题已经解决了,在maven插件中添加了一些行之后:
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>https://stackoverflow.com/questions/71536766
复制相似问题