当我在本地tomcat服务器上运行Web应用程序时,一切都很好,但是当我通过tomcat docker容器运行它时,出现此错误:
org.apache.jasper.JasperException: /WEB-INF/views/index.jsp (line: [1], column: [1]) The absolute uri: [http://www.springframework.org/tags] cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:291)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:97)
我的dockerfile是:
FROM tomcat:8-jre8
ARG artifactId
ARG version
LABEL version=${version}
ENV CATALINA_HOME /usr/local/tomcat
ENV JPDA_ADDRESS 8000
COPY ./target/$artifactId-${version}.war $CATALINA_HOME/webapps/${artifactId}.war
#pass system properties
#memory params
RUN sed -i "s|\$JAVA_OPTS \$JSSE_OPTS|\$JAVA_OPTS \$JSSE_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -Xss2048k -XX:NewSize=256m -XX:MaxNewSize=256m|" $CATALINA_HOME/bin/catalina.sh
EXPOSE 8080 22 8000
CMD $CATALINA_HOME/bin/catalina.sh run
服务器成功启动并部署了war文件,并且可以访问我的所有API,但是当我要访问jsp页面时会发生此错误。本地和docker的tomcat版本相同。