我有一个带有Jhipster(5.5.0)和Spring的Java程序。当我使用./mvnw
运行网站时,它可以正常工作。在过去的几个月中,当我使用mvn install -Pprod -DskipTests=true
对其进行编译,然后使用java -jar mysite.jar
对其进行运行时,它运行良好。然而。 。 。今天java -jar mysite.jar
失败了,给出了以下错误。
这首先是在另一个人的计算机上报告的,因为他们在过去2天对JAR进行了罚款,然后今天失败了。因此,代码更改为0。然后,即使在重新编译后,我也在机器上尝试了它,并且也失败了。我对“ hazelcast”一无所知,所以我什至不使用它-Jhipster或Spring必须使用它。但是我不确定为什么这会随机失败。
2019-01-23 11:58:57.953 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 11:59:28.117 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 11:59:58.303 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:00:28.585 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:00:58.739 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:01:28.925 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:01:59.091 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:02:29.269 INFO 51656 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [10.3.2.121]:5701 [dev] [3.7.8] Trying to join to discovered node: [10.3.2.160]:5701
2019-01-23 12:02:59.358 ERROR 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Could not join cluster in 300000 ms. Shutting down now!
2019-01-23 12:02:59.369 INFO 51656 --- [ main] com.hazelcast.core.LifecycleService : [10.3.2.121]:5701 [dev] [3.7.8] [10.3.2.121]:5701 is SHUTTING_DOWN
2019-01-23 12:02:59.370 WARN 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Terminating forcefully...
2019-01-23 12:02:59.370 INFO 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Shutting down multicast service...
2019-01-23 12:02:59.372 INFO 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Shutting down connection manager...
2019-01-23 12:02:59.376 INFO 51656 --- [ main] com.hazelcast.nio.tcp.TcpIpConnection : [10.3.2.121]:5701 [dev] [3.7.8] Connection[id=1, /10.3.2.121:59390->/10.3.2.160:5701, endpoint=[10.3.2.160]:5701, alive=false, type=NONE] closed. Reason: TcpIpConnectionManager is stopping
2019-01-23 12:02:59.381 INFO 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Shutting down node engine...
2019-01-23 12:02:59.390 INFO 51656 --- [ main] com.hazelcast.instance.NodeExtension : [10.3.2.121]:5701 [dev] [3.7.8] Destroying node NodeExtension.
2019-01-23 12:02:59.391 INFO 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Hazelcast Shutdown is completed in 21 ms.
2019-01-23 12:02:59.391 INFO 51656 --- [ main] com.hazelcast.core.LifecycleService : [10.3.2.121]:5701 [dev] [3.7.8] [10.3.2.121]:5701 is SHUTDOWN
2019-01-23 12:02:59.443 WARN 51656 --- [ main] com.hazelcast.util.PhoneHome : [10.3.2.121]:5701 [dev] [3.7.8] Could not schedule phone home! Most probably Hazelcast is failed to start.
2019-01-23 12:02:59.444 INFO 51656 --- [ main] com.hazelcast.instance.Node : [10.3.2.121]:5701 [dev] [3.7.8] Node is already shutting down... Waiting for shutdown process to complete...
2019-01-23 12:02:59.448 WARN 51656 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webConfigurer' defined in URL [jar:file:/Users/mike.knoth/Desktop/automationstation.war!/WEB-INF/classes!/com/odp/config/WebConfigurer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/odp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
2019-01-23 12:02:59.449 INFO 51656 --- [ main] com.odp.config.CacheConfiguration : Closing Cache Manager
2019-01-23 12:02:59.493 ERROR 51656 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webConfigurer' defined in URL [jar:file:/Users/mike.knoth/Desktop/automationstation.war!/WEB-INF/classes!/com/odp/config/WebConfigurer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/odp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at com.odp.UiApp.main(UiApp.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webConfigurer' defined in URL [jar:file:/Users/mike.knoth/Desktop/automationstation.war!/WEB-INF/classes!/com/odp/config/WebConfigurer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/odp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:199)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
... 14 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webConfigurer' defined in URL [jar:file:/Users/mike.knoth/Desktop/automationstation.war!/WEB-INF/classes!/com/odp/config/WebConfigurer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/odp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:519)
at org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor.getCustomizers(EmbeddedServletContainerCustomizerBeanPostProcessor.java:82)
at org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor.postProcessBeforeInitialization(EmbeddedServletContainerCustomizerBeanPostProcessor.java:72)
at org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor.postProcessBeforeInitialization(EmbeddedServletContainerCustomizerBeanPostProcessor.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
... 22 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/odp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 38 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Node failed to start!
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 51 common frames omitted
Caused by: java.lang.IllegalStateException: Node failed to start!
at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:132)
at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:218)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:176)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:126)
at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)
at com.odp.config.CacheConfiguration.hazelcastInstance(CacheConfiguration.java:75)
at com.odp.config.CacheConfiguration$$EnhancerBySpringCGLIB$$1c92f609.CGLIB$hazelcastInstance$2(<generated>)
at com.odp.config.CacheConfiguration$$EnhancerBySpringCGLIB$$1c92f609$$FastClassBySpringCGLIB$$3f6079fd.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at com.odp.config.CacheConfiguration$$EnhancerBySpringCGLIB$$1c92f609.hazelcastInstance(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 52 common frames omitted