我使用的是Spring Boot 1.3.3和Hazelcast 我的构建看起来像:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<executable>true</executable>
<layout>ZIP</layout>
<embeddedLaunchScriptProperties>
<mode>service</mode>
<useStartStopDaemon>false</useStartStopDaemon>
</embeddedLaunchScriptProperties>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-all</artifactId>
<version>${hazelcast.version}</version>
</dependency>
在Linux中执行服务时,我在日志中看到:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/hazelcast/cluster/impl/operations/WanReplicationOperation
at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1302) ~[spring-webmvc-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977) ~[spring-webmvc-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
但我在胖罐子里看到了hazelcast-all.jar 任何线索?
答案 0 :(得分:0)
问题是由spring-boot脚本引起的。 由于服务停止没有杀死进程并且它仍处于活动状态,因此无法执行并在日志中抛出此类异常。 我仍然不明白为什么它找不到特定的淡褐色类,其余的都没问题