2017-02-16 67 views
0

我正在开发一个使用spring boot 1.4.x的web服务,并将它部署在支持java 6的Websphere 8.5中。但是当我部署我的战争时,错误。什么是Spring Boot 1.4.x所需的最低java版本

看起来像Spring引导中的JAR依赖(spring-ws-core-2.3.1.RELEASE.jar)有一些类是用java 7编译的。这导致了错误。

什么是使用Spring Boot 1.4.x所需的最低java版本? 在我的情况下,是否可以将上面的依赖关系单独覆盖到较低版本?

错误:

2/16/17 10:58:08:296 EST] 000000f2 CompositionUn E WSVR0194E: Composition unit WebSphere:cuname=testpp-1_0_0-SNAPSHOT_war in BLA WebSphere:blaname=testpp-1_0_0-SNAPSHOT_war failed to start. 
[2/16/17 10:58:08:299 EST] 000000f2 MBeanHelper E Could not invoke an operation on object: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=MyNode,version=8.5.5.2,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=MyCell,spec=1.0 because of an mbean exception: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: JVMCFRE003 bad major version&#59&#59; class=org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer, offset=6 
[2/16/17 10:58:08:299 EST] 000000f2 SystemErr  R com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: JVMCFRE003 bad major version&#59&#59; class=org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer, offset=6 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432) 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718) 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1177) 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370) 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) 
[2/16/17 10:58:08:300 EST] 000000f2 SystemErr  R  at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968) 

POM配置

testap 示范工程春季启动

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.4.4.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    <java.version>1.6</java.version> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web-services</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-tomcat</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
     </plugin> 
    </plugins> 
</build> 

回答

1

According to the reference documentation

By default, Spring Boot 1.4.4.RELEASE requires Java 7 and Spring Framework 4.3.6.RELEASE or above. You can use Spring Boot with Java 6 with some additional configuration. See Section 81.11, “How to use Java 6” for more details. Explicit build support is provided for Maven (3.2+) and Gradle (1.12 or 2.x). Support for Gradle 2.8 and earlier is deprecated. Gradle 3 is not supported.

您遇到的问题是不是春天启动的依赖,但单独Spring Web Services which is only compatible with Java 7

Spring Web Services requires a standard Java 7 Runtime Environment. Java 8 is also supported. Spring-WS is built on Spring Framework 4.0.9, but higher versions are supported.

你可以尝试降级或排除的依赖,但有你碰坏的高风险。

+0

感谢您的确认。因此,如果我们使用Spring Boot 1.4,那么总是建议使用java 7。 – springbootlearner

相关问题