【问题标题】:Using Spring with WebSphere 8.5.5 and Apache Wink - web.xml error on server startup将 Spring 与 WebSphere 8.5.5 和 Apache Wink 一起使用 - 服务器启动时出现 web.xml 错误
【发布时间】:2015-07-07 18:23:54
【问题描述】:

我目前正在将使用 Wink 1.1.1 和 Spring 3.1.2 的 Java 应用程序从 WAS 7 迁移到 WAS 8.5.5。我正在尝试使用 WAS 8.5 中提供的本机 Wink 集成,而不是使用我们目前在 WAS 7 中使用的单独的 Wink jar。

我在服务器启动时遇到如下错误:

原因:java.io.FileNotFoundException:类路径资源 [META-INF/server/wink-core-context.xml] 无法打开,因为它 不存在于 org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)

现在,在我当前明确使用 Wink jar 的 WAS 7 世界中,我的 web.xml 中有此条目:

  <servlet>
    <servlet-name>Wink Servlet</servlet-name>
    <servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
  </servlet>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:META-INF/server/wink-core-context.xml
        /WEB-INF/spring/applicationContext-configuration.xml</param-value>
  </context-param>

效果很好。

我正在尝试使用它拥有的本机 Wink 集成来找出 WAS 8.5 的正确 web.xml 条目。这是我目前拥有的:

  <servlet>
    <servlet-name>IBM Rest Servlet</servlet-name>
    <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
  </servlet>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:META-INF/server/wink-core-context.xml
        /WEB-INF/spring/applicationContext-configuration.xml</param-value>
  </context-param>

但是,我收到了上述错误。我想知道 Wink 核心上下文文件是否只是位于 IBM 设置中的不同位置?此外,IBM 设置中的哪个 jar 实际包含 wink 实现?我也没有找到明确的答案。

感谢您的帮助!

【问题讨论】:

  • 看看这对你有没有帮助:stackoverflow.com/questions/30247567/…
  • 是的,我已经完成了该帖子答案中的所有内容。我的主要问题是与 Spring 集成时 web.xml 条目应该是什么样的?
  • 这篇文章讲的是 Spring 与 wink 的集成:ibm.com/developerworks/library/wa-apachewink2 你也可以尝试使用 RestServlet 而不是 IBMRestServlet。
  • 您是否在类路径中包含“wink-spring-support--incubating.jar”?如果不是,那么这可能就是问题所在。
  • 它的 Apace 眨眼罐。下载 1.1 版本。

标签: java spring web.xml websphere-8 apache-wink


【解决方案1】:

由于 WAS 8.5 Wink Distribution 未提供 wink-spring-support-1.1-incubating.jar,因此您需要将该 jar 显式包含在应用程序类路径中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-23
    • 2017-05-23
    • 1970-01-01
    • 1970-01-01
    • 2021-01-26
    • 1970-01-01
    相关资源
    最近更新 更多