为了账号安全,请及时绑定邮箱和手机立即绑定

无法使用在 WebSphere 上运行的 SpringBoot 应用程序找到 webjars

无法使用在 WebSphere 上运行的 SpringBoot 应用程序找到 webjars

HUX布斯 2023-05-17 16:19:56
我一直在尝试在 WebSphere 服务器上托管 Spring Boot 应用程序。版本:SpringBoot 2.1.6.发布带有 JavaEE 8 的 WebSphere Liberty 19.0.0.6webjars-定位器 0.36该应用程序已成功部署在独立的 Tomcat 9.0.22 上,并且可以在那里解析 webjars。但是,对于 WebSphere,我在尝试从页面访问 webjars 时收到错误消息html:2019-08-05 10:43:11.839 DEBUG 1 --- [ecutor-thread-6] o.s.web.servlet.DispatcherServlet        : GET "/appcontext/webjars/jquery/jquery.min.js", parameters={}2019-08-05 10:43:11.845 DEBUG 1 --- [ecutor-thread-6] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]2019-08-05 10:43:11.849 DEBUG 1 --- [ecutor-thread-6] o.s.w.s.r.ResourceHttpRequestHandler     : Resource not found2019-08-05 10:43:11.849 DEBUG 1 --- [ecutor-thread-6] o.s.web.servlet.DispatcherServlet        : Completed 404 NOT_FOUND该webjars模式已由 Spring 成功映射:2019-08-05 10:43:09.039 DEBUG 1 --- [ecutor-thread-6] o.s.w.s.handler.SimpleUrlHandlerMapping  : Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
查看完整描述

1 回答

?
回首忆惘然

TA贡献1847条经验 获得超11个赞

解决方案是将属性设置为 的classloading条目添加到 WebSphere文件:useJarUrlstrueserver.xml


<server description="myServer">

    <featureManager>

        <feature>servlet-3.0</feature>

    </featureManager>

    <classloading useJarUrls="true"/> <!-- this line was added -->

    <httpEndpoint httpPort="9080" httpsPort="9443" host="*" id="defaultHttpEndpoint"/>

</server>

IBM support issue对解决这个问题特别有帮助。

查看完整回答
反对 回复 2023-05-17
  • 1 回答
  • 0 关注
  • 106 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信