所有
  最近,我将Web应用程序从tomcat7迁移到了Weblogic12,jdk版本是1.6.0.30。在完成项目战争之后,打开登录页面(/login.htm),即抛出这样的异常:


  错误404-从RFC 2068超文本传输​​协议中找不到-
  HTTP / 1.1:
  10.4.5找不到404服务器未找到与Request-URI匹配的任何内容。没有迹象表明该条件是否为
  暂时或永久的。
  
  如果服务器不希望将此信息提供给
  客户端,则可以使用状态代码403(禁止)。 410
  如果服务器通过某种方式知道了(已用)状态代码,则应使用
  内部可配置的机制,即旧资源是永久性的
  不可用,没有转发地址




这是我的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>



我该怎么办?这是一个活跃的难题之地,任何回应都值得赞赏。谢谢。

最佳答案

已解决问题,它来自启动时加载的标记值(定义为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>


谢谢。

关于spring - Tomcat迁移到WebLogic12,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8755591/

10-09 22:09