在java Web应用程序中,有一个名为web.xml的文件,它有一个版本控制.
究竟是什么?它是干什么用的?
这是web.xml的SO wiki.但它并没有真正解释我.
它允许您在Web应用程序中定义,声明和配置基于Servlet API的实现,例如servlet,过滤器和侦听器.
有人可以用简单的例子来解释这个吗?
谢谢.
编辑:
示例web.xml版本控制:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
Run Code Online (Sandbox Code Playgroud) 我将它部署到Weblogic12C后访问示例springBoot应用程序时遇到问题.使用springBoot嵌入式Tomcat服务器可以正常工作.
重现步骤:按照以下步骤获取springBoot"入门"应用程序代码:https://spring.io/guides/gs/spring-boot/
此时,您可以通过运行gradle"bootRun"任务来验证一切正常,这些任务在嵌入式Tomcat服务器中启动应用程序.一旦tomcat启动,浏览到localhost:8080 /并看到你得到"来自Spring Boot的问候!"
java版"1.7.0_45"Java(TM)SE运行时环境(版本1.7.0_45-b18)Java HotSpot(TM)服务器VM(版本24.45-b08,混合模式)
此时,您将看到应用程序部署正常: - 再次单击"部署",看到您的"完整"springBoot应用程序已列出并且活动 - 单击"完成"并在此页面上注意:"上下文根:/完成".注意:WebLogic文档说,如果有在weblogic.xml中没有定义上下文根,那么它使用war文件名(减去的.war)
如果您尝试访问localhost:7001 /完成的springBoot应用程序,则会获得403!
Error 403--Forbidden
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request …Run Code Online (Sandbox Code Playgroud) 我已经使用 start.spring.io 创建了一个应用程序(spring boot 1.5.6)并尝试将其部署到 Weblogic 12.1.3.0.0。
管理控制台中的消息:
错误 无法访问选定的应用程序。
错误 java.io.IOException
错误 weblogic.utils.compiler.ToolFailureException
日志中的消息:
<23.08.2017 13:40:26 GMT+03:00> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
这些链接没有帮助:
https:
//docs.spring.io/spring-boot/docs/1.5.x/reference/html/howto-traditional-deployment.html 在 Weblogic 中部署 Spring Boot 应用程序
更新:
问题是依赖 JAX-RS。没有它应用程序部署成功。不确定如何使用此依赖项
更新 x2:
删除 Jax-rs,现在:
java.lang.NoSuchMethodError:org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(Ljava/util/List;)V
已解决