我正在使用websphere- have (https://hub.docker.com/_/websphere-liberty/)映像来部署我的应用程序,但是我在共享库方面有问题。我需要将jar从util项目转换为自由服务器上的共享库。我被这个错误困住了:
SchedulerApplication-加载ok -来自Scheduler应用程序,但它正在从util项目扩展类
[ERROR ] SRVE0276E: Error while initializing Servlet [Scheduler]:
javax.servlet.UnavailableException: SRVE0203E: Servlet [Scheduler]: com.scheduler.SchedulerApplication was found, but is missing another required class.
SRVE0206E: This error typically implies that the servlet was originally compiled with classes which cannot be located by the server.
SRVE0187E: Check your class path to ensure that all classes required by the servlet are present.SRVE0210I: This problem can be debugged by recompiling the servlet using only the classes in the application's runtime class path
SRVE0234I: Application class path=[com.ibm.ws.classloading.internal.ThreadContextClassLoader@3c27eabb]
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1575)
at [internal classes]Basic project structure
app - Scheduler/...
/pom.xml
- myapp2/...
/pom.xml
- util/...
/pom.xml
- pom.xml
Dockerfile
server.xmlDockerfile
FROM maven:3.8.4-ibmjava-8 as maven_build
COPY --chown=1001:0 app./app
WORKDIR app
RUN mvn clean install
FROM websphere-liberty:21.0.0.12-full-java8-ibmjava
COPY --chown=1001:0 server.xml /config/
COPY --chown=1001:0 --from=maven_build /app/Scheduler/target/Scheduler.ear /config/dropins/
COPY --chown=1001:0 --from=maven_build /app/myapp2/target/myapp2.ear /config/dropins/
#util -> libraries used in both Scheduler & myapp2
COPY --chown=1001:0 --from=maven_build /app/util/target/util.jar /opt/ibm/wlp/usr/servers/defaultServer/lib/
RUN configure.shserver.xml
.....
<library id="SharedLibraries" apiTypeVisibility="spec, ibm-api, stable, third-party">
<fileset dir="/opt/ibm/wlp/usr/servers/defaultServer/lib/" includes="*.jar" scanInterval="5s" />
</library>
<application id="Scheduler" name="Scheduler" type="ear" location="Scheduler.ear">
<classloader apiTypeVisibility="spec, ibm-api, stable, third-party" commonLibraryRef="SharedLibraries" />
</application>
.....发布于 2022-03-11 15:40:31
修正了在将ear文件移出配置/下拉列表后,=>停止了自动部署
看起来app是从配置/下拉列表中安装的2x -auto部署&从server.xml部署
COPY --chown=1001:0 --from=maven_build /app/Scheduler/target/Scheduler.ear /opt/ibm/wlp/usr/servers/defaultServer/appshttps://stackoverflow.com/questions/71439117
复制相似问题