【问题标题】:Tomcat migration to WebLogic12Tomcat 迁移到 WebLogic12
【发布时间】:2012-01-06 09:12:45
【问题描述】:

全部 最近把一个webapp从tomcat7迁移到Weblogic12,jdk版本是1.6.0.30。我部署项目war完成后,打开登录页面(/login.htm),即抛出这样的异常:

错误 404--未从 RFC 2068 超文本传输​​协议中找到-- HTTP/1.1: 10.4.5 404 Not Found 服务器没有找到任何匹配请求 URI 的东西。没有说明条件是否是 临时或永久。

如果服务器不希望将这些信息提供给 客户端,可以使用状态码 403(禁止)代替。 410 (Gone) 状态码应该在服务器知道时使用,通过一些 内部可配置机制,旧资源是永久的 不可用且没有转发地址

.

这是我的 Web.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
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_2_5.xsd">
<display-name>sys</display-name>
<description>JSP application</description>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
  classpath:spring/framework-data.xml,
  classpath:spring/framework-common.xml,
  classpath:spring/framework-query.xml
</param-value>
</context-param>
<!--encoding-->
<filter>
<filter-name>sessionFilter</filter-name>
<filter-class>com.wri.hy.framework.application.framework.security.controller.SessionFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>isCheck</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>sessionFilter</filter-name>
<url-pattern>*.htm</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.wri.hy.framework.application.framework.security.controller.SessionListener</listener-class>
</listener>

<!--spring-->
<servlet>
<servlet-name>framework</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/framework-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!--surpport WebApplicationContextUtils-->
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!--Watcher-->
  <servlet>
<servlet-name>watcher</servlet-name>
<servlet-class>com.wri.hy.framework.application.framework.util.Watcher</servlet-class>
<load-on-startup>2</load-on-startup>
  </servlet>
<servlet>
<servlet-name>DisplayChart</servlet-name>
<servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DisplayChart</servlet-name>
<url-pattern>/servlet/displayChart</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>framework</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>

<session-config>
  <session-timeout>240</session-timeout>
  </session-config>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!--error-page>
<error-code>404</error-code>
<location>/fileNotFound.html</location>
</error-page-->
</web-app>

我可以为这个问题做些什么?这里是拼图的活跃场所,任何反应都可以得到满足。谢谢。

【问题讨论】:

  • 您的问题的标题表明迁移到“Websphere12”,但我认为这应该是“WebLogic 12”?同样,您可能也需要相应地更新您的标签。

标签: spring tomcat migration weblogic


【解决方案1】:

问题已解决,它源自加载时启动标记值,定义为 web.xml。在 weblogic 上必须不同。

<servlet>
        <servlet-name>framework</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/framework-servlet.xml</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <!--surpport WebApplicationContextUtils-->
    <servlet>
        <servlet-name>context</servlet-name>
        <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

谢谢。

【讨论】:

    猜你喜欢
    • 2019-04-29
    • 1970-01-01
    • 2010-12-29
    • 1970-01-01
    • 1970-01-01
    • 2013-06-05
    • 2021-09-13
    • 2020-04-17
    • 1970-01-01
    相关资源
    最近更新 更多