我正在尝试在 Websphere 9.0.7 上部署一个 spring-boot 2.04 应用程序。它在其嵌入式 tomcat 上构建和运行良好,但是当我尝试在 Websphere 上部署它时,出现以下错误
8/17/18 13:31:01:282 EDT] 00000083 classsource W ClassSourceAggregateImpl open Open failure
com.ibm.wsspi.anno.classsource.ClassSourceException: [ ClassSourceMappedJarImpl@374137949(WEB-INF/lib/thymeleaf-3.0.9.RELEASE.jar, /usr/WAS90/AppServer/profiles/Website/installedApps/Website_DmgrCell/Website-0_0_1-SNAPSHOT_war.ear/Website-0.0.1-SNAPSHOT.war/WEB-INF/lib/thymeleaf-3.0.9.RELEASE.jar) ] Failed to open [ /usr/WAS90/AppServer/profiles/Website/installedApps/Website_DmgrCell/Website-0_0_1-SNAPSHOT_war.ear/Website-0.0.1-SNAPSHOT.war/WEB-INF/lib/thymeleaf-3.0.9.RELEASE.jar ]
at com.ibm.ws.anno.classsource.impl.ClassSourceFactoryImpl.wrapIntoClassSourceException(ClassSourceFactoryImpl.java:89)
at com.ibm.ws.anno.classsource.impl.ClassSourceMappedJarImpl.open(ClassSourceMappedJarImpl.java:133)
at com.ibm.ws.anno.classsource.impl.ClassSourceAggregateImpl.open(ClassSourceAggregateImpl.java:216)
at com.ibm.wsspi.webcontainer.collaborator.WebAppClassStoreImpl.openClassSource(WebAppClassStoreImpl.java:517)
at com.ibm.wsspi.webcontainer.collaborator.WebAppCDIInjectionClassListCollaborator.scanModule(WebAppCDIInjectionClassListCollaborator.java:122)
at com.ibm.wsspi.webcontainer.collaborator.WebAppCDIInjectionClassListCollaborator.doGetClassStore(WebAppCDIInjectionClassListCollaborator.java:272)
at com.ibm.wsspi.webcontainer.collaborator.WebAppCDIInjectionClassListCollaborator.getInjectionClasses(WebAppCDIInjectionClassListCollaborator.java:758)
at com.ibm.ws.jsf.ext.JSFInjectionClassListCollaborator.getInjectionClasses(JSFInjectionClassListCollaborator.java:124)
at com.ibm.ws.cdi.classic.CDIArchiveImpl.getInjectionClassList(CDIArchiveImpl.java:213)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.initializeJEEComponentClasses(BeanDeploymentArchiveImpl.java:460)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:382)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:352)
at com.ibm.ws.cdi.impl.weld.WebSphereCDIDeploymentImpl.scan(WebSphereCDIDeploymentImpl.java:721)
at com.ibm.ws.cdi.impl.CDIContainerImpl.applicationStarting(CDIContainerImpl.java:120)
at com.ibm.ws.cdi.classic.CDIRuntimeImpl.applicationStarting(CDIRuntimeImpl.java:343)
at com.ibm.ws.cdi.classic.CDIRuntimeImpl.start(CDIRuntimeImpl.java:415)
at com.ibm.ws.cdi.classic.CDIRuntimeImpl.stateChanged(CDIRuntimeImpl.java:512)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$ComparableDeployedObjectListener.stateChanged(ApplicationMgrImpl.java:2652)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1178)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1499)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.setState(DeployedApplicationImpl.java:312)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1089)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:800)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1450)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2311)
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.access$500(CompositionUnitMgrImpl.java:127)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:654)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5556)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5682)
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:1340)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$ApplicationNotifier.classChanged(ApplicationMgrImpl.java:1987)
at com.ibm.ws.classloader.ClassLoaderManager.checkAndNotify(ClassLoaderManager.java:550)
at com.ibm.ws.classloader.ClassLoaderManager.access$000(ClassLoaderManager.java:82)
at com.ibm.ws.classloader.ClassLoaderManager$ReloadTimerTask.alarm(ClassLoaderManager.java:586)
at com.ibm.ejs.util.am._Alarm.runImpl(_Alarm.java:151)
at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:136)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)
Caused by: java.io.FileNotFoundException: /usr/WAS90/AppServer/profiles/Website/installedApps/Website_DmgrCell/Website-0_0_1-SNAPSHOT_war.ear/Website-0.0.1-SNAPSHOT.war/WEB-INF/lib/thymeleaf-3.0.9.RELEASE.jar (A file or directory in the path name does not exist.)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:235)
at java.util.zip.ZipFile.<init>(ZipFile.java:165)
at java.util.jar.JarFile.<init>(JarFile.java:179)
at java.util.jar.JarFile.<init>(JarFile.java:116)
at com.ibm.ws.anno.util.impl.UtilImpl_FileUtils$11.run(UtilImpl_FileUtils.java:176)
at com.ibm.ws.anno.util.impl.UtilImpl_FileUtils$11.run(UtilImpl_FileUtils.java:173)
at java.security.AccessController.doPrivileged(AccessController.java:650)
at com.ibm.ws.anno.util.impl.UtilImpl_FileUtils.createJarFile(UtilImpl_FileUtils.java:173)
at com.ibm.ws.anno.classsource.impl.ClassSourceMappedJarImpl.open(ClassSourceMappedJarImpl.java:130)
... 78 more
我不确定是否应该添加 servlet api 作为使用 websphere 的依赖项。这是我的pom。为什么它在 websphere 中失败了?
<?xml version="1.0" encoding="UTF-8"?>
//
<modelVersion>4.0.0</modelVersion>
<groupId>com.websitte</groupId>
<artifactId>Website</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Website</name>
<description>Website</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.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.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</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>