【问题标题】:Error 404: No target servlet configured for uri错误 404:没有为 uri 配置目标 servlet
【发布时间】:2009-06-18 02:31:14
【问题描述】:

我刚刚完成了一个使用 Spring Framework 构建的新 Web 模块。到目前为止,我正在使用 Tomcat 测试本地机器上的所有页面。今天在我将应用程序移至 Websphere 之后, 我收到以下错误:

      Error 404: No target servlet configured for uri

我需要在 web.xml 或其他地方做些什么吗?我在我的 WAS 上部署了一个 EAR 文件,它有另一个 war 文件。

以下是我在控制台上看到的输出,如果有帮助的话。

The resource WEB-INF/ibm-web-bnd.xmi that is defined in URI WEB-INF/ibm-web-bnd.xmi for module analytics.war is not valid.  The resource has a cross reference org.eclipse.jst.j2ee.webapplication.internal.impl.WebAppImpl@4be44be4 (eProxyURI: WEB-INF/web.xml#WebApp_ID) that cannot be resolved.
[6/17/09 15:24:49:465 CDT] 00000011 ArchiveDeploy W   ADMA0091E: The resource WEB-INF/ibm-web-ext.xmi that is defined in URI WEB-INF/ibm-web-ext.xmi for module analytics.war is not valid.  The resource has a cross reference org.eclipse.jst.j2ee.webapplication.internal.impl.WebAppImpl@7b7a7b7a (eProxyURI: WEB-INF/web.xml#WebApp_ID) that cannot be resolved.

【问题讨论】:

    标签: websphere


    【解决方案1】:

    看起来您的 servlet 配置不正确。我会说您的 web.xml 有一个 servlet-name 条目,它与您的 WEB-INF 目录中的 -servlet.xml 文件不对应。

    【讨论】:

      【解决方案2】:

      我的 json 响应出现了同样的错误。这可以通过在操作中设置 contentLength 来解决。

      【讨论】:

        【解决方案3】:

        ibm-web-bnd.xmi 有一个属性:fileServingEnabled

        这控制Websphere 是否提供静态内容(index.html、图片等)。

        如果省略则默认为true,但您可以通过将其添加到标签WebAppExtension来确保它处于打开状态

        fileServingEnabled="true"
        

        【讨论】:

          猜你喜欢
          • 2015-10-21
          • 2020-09-29
          • 2012-05-15
          • 1970-01-01
          • 2012-10-07
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多