spring - Tomcat 迁移到 WebLogic12

标签 spring tomcat migration weblogic

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

Error 404--Not Found From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.4.5 404 Not Found The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address

.

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

我能为这个问题做些什么?这里是拼图活跃的地方,任何回应都是合适的。谢谢。

最佳答案

问题已解决,它来源于 load-on-startup 标签值,定义了 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/

相关文章:

java - 无法找到 Spring NamespaceHandler for XML schema 命名空间问题

java - 错误: HTTP status 404:The requested resource is not available?

java - 我可以使用 servlet 在 Web 容器中进行这种复杂的 url 映射吗?

html - 如何使用 token 控制对 Tomcat 5.5 中 HTML 页面的访问

java - 为每个 webapp 设置 Tomcat 7 工作目录?

node.js - MongoDB 查询返回 null,即使它在从 mlab 迁移到 mongoDB atlas 后在集合中可用

sql-server - SQL Server 字符串或二进制数据将被截断

ruby-on-rails - 通过迁移或psql设置默认hstore列键值对

java - 如何在服务器启动期间启动特定的 spring bean

java - Hibernate Criteria 过滤器实体,其中 ManyToMany 关系包含多个对象