SpringBootServlerInitializer 是在 websphere 上部署时出现异常的根本原因吗?
SpringBootServlerInitializer is root caues of exception while deploy on websphere?
我尝试在 spring-boot 上部署我的应用程序到 webspere 服务器。
尝试使用此启动进行部署时状态正常 class
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.WebApplicationInitializer;
@EnableAutoConfiguration
@SpringBootApplication
public class Application{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
但是,如果我尝试添加 SprigBootServlerInitializer,会出现错误消息
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.WebApplicationInitializer;
@EnableAutoConfiguration
@SpringBootApplication
public class Application extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TEST</groupId>
<artifactId>TEST</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<spring.boot.version>2.0.4.RELEASE</spring.boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<!--Spring-boot dependencies-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>
<finalName>TEST</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
</project>
如何避免错误部署到websphere?
*尝试覆盖配置方法,但结果相同。
错误日志:
[9/21/18 13:44:22:158 MSK] 000000b7 AppBinaryProc I ADMA7021I:
Distribution of application TEST_war completed successfully. [9/21/18
13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/MANIFEST.MF.
[9/21/18 13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/ibm-web-bnd.xml.
[9/21/18 13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/TEST_war.ear. [9/21/18
13:44:22:169 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deltas/TEST_war/delta-1537526656520.
[9/21/18 13:44:22:169 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.module.
[9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.webmodule.
[9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/cus/TEST_war/cver/BASE/cu.xml. [9/21/18
13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/cus/TEST_war/cver/BASE/controlOpDefs.xml. [9/21/18
13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/ibm-application-bnd.xml.
[9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/application.xml.
[9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/ibm-web-ext.xml.
[9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/blas/TEST_war/bver/BASE/bla.xml. [9/21/18
13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/lib/spring-web-5.0.8.RELEASE.jar/META-INF/web-fragment.xml.
[9/21/18 13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/ibm-application-runtime.props.
[9/21/18 13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/deployment.xml.
[9/21/18 13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/web.xml.
[9/21/18 13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/cus/TEST_war/cver/BASE/cu-ref.xml. [9/21/18
13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.policy.
[9/21/18 13:44:22:174 MSK] 000000b7 FileRepositor A ADMR0015I: User
defaultWIMFileBasedRealm/wasadmin created document
cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/META-INF/MANIFEST.MF.
[9/21/18 13:44:22:174 MSK] 000000b7 FileRepositor A ADMR0016I: User
defaultWIMFileBasedRealm/wasadmin modified document
cells/wasNode01Cell/nodes/wasNode01/serverindex.xml. [9/21/18
13:45:19:582 MSK] 000000b5 AdminHelper A ADMN1008I: An attempt is
made to start the TEST_war application. (User ID =
defaultWIMFileBasedRealm/wasadmin) [9/21/18 13:45:19:590 MSK] 000000b5
CompositionUn A WSVR0190I: Starting composition unit
WebSphere:cuname=TEST_war in BLA WebSphere:blaname=TEST_war. [9/21/18
13:45:19:630 MSK] 000000b5 ApplicationMg A WSVR0200I: Starting
application: TEST_war [9/21/18 13:45:19:630 MSK] 000000b5
ApplicationMg A WSVR0203I: Application: TEST_war Application build
level: 1.0-SNAPSHOT [9/21/18 13:45:20:343 MSK] 000000b5 wtp
W
org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector
locateAnnotations Failed to create class reader for [
META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class
] in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ] [9/21/18
13:45:20:345 MSK] 000000b5 wtp W
org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector
locateAnnotations Failed to create class reader for [
META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class ]
in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ] [9/21/18
13:45:20:346 MSK] 000000b5 wtp W
org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector
locateAnnotations Failed to create class reader for [
module-info.class ] in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ]
[9/21/18 13:45:20:939 MSK] 000000b5 webapp I
com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I:
Loading Web Module: Tomcat Host Manager springboot.Application.
[9/21/18 13:45:20:947 MSK] 000000b5 WASSessionCor I
SessionContextRegistry getSessionContext SESN0176I: Will create a new
session context for application key default_host/test [9/21/18
13:45:22:282 MSK] 000000b5 ecs W
com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR
unable to open input stream for resource
META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class
in archive WEB-INF/lib/log4j-api-2.10.0.jar
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:120)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJAR(ScannerContextImpl.java:275)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJARs(ScannerContextImpl.java:315)
at com.ibm.ws.ecs.internal.scan.context.impl.WARScannerContext.scanInternal(WARScannerContext.java:76)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scan(ScannerContextImpl.java:87)
...
at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
[9/21/18 13:45:22:286 MSK] 000000b5 ecs W
com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR
unable to open input stream for resource
META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class
in archive WEB-INF/lib/log4j-api-2.10.0.jar
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:120)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJAR(ScannerContextImpl.java:275)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJARs(ScannerContextImpl.java:315)
at com.ibm.ws.ecs.internal.scan.context.impl.WARScannerContext.scanInternal(WARScannerContext.java:76)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scan(ScannerContextImpl.java:87)
at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.getScannedClasses(ScannerContextImpl.java:70)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.scanForHandlesTypesClasses(WebAppImpl.java:765)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:606)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:901)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:795)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1413)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2273)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access0(CompositionUnitMgrImpl.java:127)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.run(CompositionUnitMgrImpl.java:654)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5554)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5680)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:668)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:612)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1303)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1187)
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:768)
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyHandshakeCompletedCallback.complete(SSLConnectionLink.java:464)
at com.ibm.ws.ssl.channel.impl.SSLUtils.handleHandshake(SSLUtils.java:1137)
at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
[9/21/18 13:45:22:288 MSK] 000000b5 ecs W
com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR
unable to open input stream for resource module-info.class in archive
WEB-INF/lib/log4j-api-2.10.0.jar
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124)
...
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
[9/21/18 13:45:32:898 MSK] 000000b5 webapp I
com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -
[TEST_war#TEST.war]:.2 Spring WebApplicationInitializers detected on
classpath [9/21/18 13:45:33:481 MSK] 000000b5 SpringApplica E
org.springframework.boot.SpringApplication reportFailure Application
run failed
java.lang.BootstrapMethodError: java.lang.LinkageError: loading constraint violation when overriding
method
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;"
during creation of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420":
loader "java/lang/InternalAnonymousClassLoader@d1c57825" of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420"
and loader "com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1" of
class
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory"
have different types for the method signature
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:336)
at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:215)
at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:198)
...
at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892) Caused by: java.lang.LinkageError: loading constraint violation when
overriding method
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;"
during creation of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420":
loader "java/lang/InternalAnonymousClassLoader@d1c57825" of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420"
and loader "com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1" of
class
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory"
have different types for the method signature
at sun.misc.Unsafe.defineAnonymousClass(Native Method)
at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:339)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:206)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:315)
at java.lang.invoke.DirectHandle.invokeExact_thunkArchetype_L(DirectHandle.java:302)
at java.lang.invoke.AsTypeHandle.invokeExact_thunkArchetype_X(AsTypeHandle.java:49)
at java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:841)
... 124 more
[9/21/18 13:45:33:487 MSK] 000000b5 webapp E
com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0015E:
Failure to initialize Web application Tomcat Host Manager
springboot.Application [9/21/18 13:45:33:490 MSK] 000000b5
DeployedAppli W WSVR0206E: Module, TEST.war, of application,
TEST_war.ear/deployments/TEST_war, failed to start [9/21/18
13:45:33:492 MSK] 000000b5 ApplicationMg W WSVR0101W: An error
occurred starting, TEST_war [9/21/18 13:45:33:492 MSK] 000000b5
ApplicationMg A WSVR0217I: Stopping application: TEST_war [9/21/18
13:45:33:499 MSK] 000000b5 ApplicationMg A WSVR0220I: Application
stopped: TEST_war [9/21/18 13:45:33:501 MSK] 000000b5 CompositionUn E
WSVR0194E: Composition unit WebSphere:cuname=TEST_war in BLA
WebSphere:blaname=TEST_war failed to start. [9/21/18 13:45:33:501 MSK]
000000b5 MBeanHelper E Could not invoke an operation on object:
WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=wasNode01,version=8.5.5.13,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=wasNode01Cell,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: java.lang.LinkageError: loading
constraint violation when overriding method
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;"
during creation of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420":
loader
"java/lang/InternalAnonymousClassLoader@d1c57825"
of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420"
and loader
"com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1"
of class
"org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory"
have different types for the method signature
您需要将以下方法重写为 运行 作为 Web 应用程序
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
对我来说,IBM WAS ND 8.5.0 的工作解决方案是直接实现接口 WebApplicationInitializer:
要将 Spring 启动应用程序部署到 Weblogic,您必须确保您的 servlet 初始化器直接实现 WebApplicationInitializer(即使您从已经实现它的基础 class 扩展)。
Cannot deploy Spring App to Websphere
我尝试在 spring-boot 上部署我的应用程序到 webspere 服务器。 尝试使用此启动进行部署时状态正常 class
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.WebApplicationInitializer;
@EnableAutoConfiguration
@SpringBootApplication
public class Application{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
但是,如果我尝试添加 SprigBootServlerInitializer,会出现错误消息
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.WebApplicationInitializer;
@EnableAutoConfiguration
@SpringBootApplication
public class Application extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TEST</groupId>
<artifactId>TEST</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<spring.boot.version>2.0.4.RELEASE</spring.boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<!--Spring-boot dependencies-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>
<finalName>TEST</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
</project>
如何避免错误部署到websphere?
*尝试覆盖配置方法,但结果相同。
错误日志:
[9/21/18 13:44:22:158 MSK] 000000b7 AppBinaryProc I ADMA7021I: Distribution of application TEST_war completed successfully. [9/21/18 13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/MANIFEST.MF. [9/21/18 13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/ibm-web-bnd.xml. [9/21/18 13:44:22:168 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/TEST_war.ear. [9/21/18 13:44:22:169 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deltas/TEST_war/delta-1537526656520. [9/21/18 13:44:22:169 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.module. [9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.webmodule. [9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/cus/TEST_war/cver/BASE/cu.xml. [9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/cus/TEST_war/cver/BASE/controlOpDefs.xml. [9/21/18 13:44:22:170 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/ibm-application-bnd.xml. [9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/application.xml. [9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/ibm-web-ext.xml. [9/21/18 13:44:22:171 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/blas/TEST_war/bver/BASE/bla.xml. [9/21/18 13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/lib/spring-web-5.0.8.RELEASE.jar/META-INF/web-fragment.xml. [9/21/18 13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/ibm-application-runtime.props. [9/21/18 13:44:22:172 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/deployment.xml. [9/21/18 13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/WEB-INF/web.xml. [9/21/18 13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/cus/TEST_war/cver/BASE/cu-ref.xml. [9/21/18 13:44:22:173 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/META-INF/was.policy. [9/21/18 13:44:22:174 MSK] 000000b7 FileRepositor A ADMR0015I: User defaultWIMFileBasedRealm/wasadmin created document cells/wasNode01Cell/applications/TEST_war.ear/deployments/TEST_war/TEST.war/META-INF/MANIFEST.MF. [9/21/18 13:44:22:174 MSK] 000000b7 FileRepositor A ADMR0016I: User defaultWIMFileBasedRealm/wasadmin modified document cells/wasNode01Cell/nodes/wasNode01/serverindex.xml. [9/21/18 13:45:19:582 MSK] 000000b5 AdminHelper A ADMN1008I: An attempt is made to start the TEST_war application. (User ID = defaultWIMFileBasedRealm/wasadmin) [9/21/18 13:45:19:590 MSK] 000000b5 CompositionUn A WSVR0190I: Starting composition unit WebSphere:cuname=TEST_war in BLA WebSphere:blaname=TEST_war. [9/21/18 13:45:19:630 MSK] 000000b5 ApplicationMg A WSVR0200I: Starting application: TEST_war [9/21/18 13:45:19:630 MSK] 000000b5 ApplicationMg A WSVR0203I: Application: TEST_war Application build level: 1.0-SNAPSHOT [9/21/18 13:45:20:343 MSK] 000000b5 wtp
W org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector locateAnnotations Failed to create class reader for [ META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class ] in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ] [9/21/18 13:45:20:345 MSK] 000000b5 wtp W org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector locateAnnotations Failed to create class reader for [ META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class ] in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ] [9/21/18 13:45:20:346 MSK] 000000b5 wtp W org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.WARFileAnnotationsDetector locateAnnotations Failed to create class reader for [ module-info.class ] in [ WEB-INF/lib/log4j-api-2.10.0.jar ]: [ null ] [9/21/18 13:45:20:939 MSK] 000000b5 webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: Tomcat Host Manager springboot.Application. [9/21/18 13:45:20:947 MSK] 000000b5 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/test [9/21/18 13:45:22:282 MSK] 000000b5 ecs W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class in archive WEB-INF/lib/log4j-api-2.10.0.jar java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:120) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJAR(ScannerContextImpl.java:275) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJARs(ScannerContextImpl.java:315) at com.ibm.ws.ecs.internal.scan.context.impl.WARScannerContext.scanInternal(WARScannerContext.java:76) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scan(ScannerContextImpl.java:87) ... at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)[9/21/18 13:45:22:286 MSK] 000000b5 ecs W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class in archive WEB-INF/lib/log4j-api-2.10.0.jar java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:120) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJAR(ScannerContextImpl.java:275) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scanJARs(ScannerContextImpl.java:315) at com.ibm.ws.ecs.internal.scan.context.impl.WARScannerContext.scanInternal(WARScannerContext.java:76) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.scan(ScannerContextImpl.java:87) at com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl.getScannedClasses(ScannerContextImpl.java:70) at com.ibm.ws.webcontainer.webapp.WebAppImpl.scanForHandlesTypesClasses(WebAppImpl.java:765) at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:606) at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410) at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88) at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171) at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:901) at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:795) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1413) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2273) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436) at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access0(CompositionUnitMgrImpl.java:127) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.run(CompositionUnitMgrImpl.java:654) at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5554) at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5680) at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:668) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:612) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1303) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1187) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:768) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyHandshakeCompletedCallback.complete(SSLConnectionLink.java:464) at com.ibm.ws.ssl.channel.impl.SSLUtils.handleHandshake(SSLUtils.java:1137) at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
[9/21/18 13:45:22:288 MSK] 000000b5 ecs W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource module-info.class in archive WEB-INF/lib/log4j-api-2.10.0.jar java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:147) at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:124) ... at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
[9/21/18 13:45:32:898 MSK] 000000b5 webapp I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message - [TEST_war#TEST.war]:.2 Spring WebApplicationInitializers detected on classpath [9/21/18 13:45:33:481 MSK] 000000b5 SpringApplica E org.springframework.boot.SpringApplication reportFailure Application run failed java.lang.BootstrapMethodError: java.lang.LinkageError: loading constraint violation when overriding method "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;" during creation of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420": loader "java/lang/InternalAnonymousClassLoader@d1c57825" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420" and loader "com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory" have different types for the method signature at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:336) at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:215) at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:198) ... at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892) Caused by: java.lang.LinkageError: loading constraint violation when overriding method "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;" during creation of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420": loader "java/lang/InternalAnonymousClassLoader@d1c57825" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420" and loader "com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory" have different types for the method signature at sun.misc.Unsafe.defineAnonymousClass(Native Method) at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:339) at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:206) at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:315) at java.lang.invoke.DirectHandle.invokeExact_thunkArchetype_L(DirectHandle.java:302) at java.lang.invoke.AsTypeHandle.invokeExact_thunkArchetype_X(AsTypeHandle.java:49) at java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:841) ... 124 more
[9/21/18 13:45:33:487 MSK] 000000b5 webapp E com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0015E: Failure to initialize Web application Tomcat Host Manager springboot.Application [9/21/18 13:45:33:490 MSK] 000000b5 DeployedAppli W WSVR0206E: Module, TEST.war, of application, TEST_war.ear/deployments/TEST_war, failed to start [9/21/18 13:45:33:492 MSK] 000000b5 ApplicationMg W WSVR0101W: An error occurred starting, TEST_war [9/21/18 13:45:33:492 MSK] 000000b5 ApplicationMg A WSVR0217I: Stopping application: TEST_war [9/21/18 13:45:33:499 MSK] 000000b5 ApplicationMg A WSVR0220I: Application stopped: TEST_war [9/21/18 13:45:33:501 MSK] 000000b5 CompositionUn E WSVR0194E: Composition unit WebSphere:cuname=TEST_war in BLA WebSphere:blaname=TEST_war failed to start. [9/21/18 13:45:33:501 MSK] 000000b5 MBeanHelper E Could not invoke an operation on object: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=wasNode01,version=8.5.5.13,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=wasNode01Cell,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: java.lang.LinkageError: loading constraint violation when overriding method "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory.getDocumentFilter(Lorg/springframework/boot/context/config/ConfigFileApplicationListener$Profile;)Lorg/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilter;" during creation of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420": loader "java/lang/InternalAnonymousClassLoader@d1c57825" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$Loader$$Lambda9/000000002447A420" and loader "com/ibm/ws/classloader/CompoundClassLoader@dd9c34e1" of class "org/springframework/boot/context/config/ConfigFileApplicationListener$DocumentFilterFactory" have different types for the method signature
您需要将以下方法重写为 运行 作为 Web 应用程序
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
对我来说,IBM WAS ND 8.5.0 的工作解决方案是直接实现接口 WebApplicationInitializer:
要将 Spring 启动应用程序部署到 Weblogic,您必须确保您的 servlet 初始化器直接实现 WebApplicationInitializer(即使您从已经实现它的基础 class 扩展)。
Cannot deploy Spring App to Websphere