所有 最近我将一个webapp从tomcat7迁移到了Weblogic12,jdk版本是1.6.0.30。在我完成部署项目之后,打开登录页面(/login.htm),即抛出这样的异常:
错误404 - 从RFC 2068超文本传输协议中找不到 - HTTP / 1.1: 10.4.5 404 Not Found服务器未找到与Request-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>
我可以为这个问题做些什么?这是一个活跃的拼图地方,任何回应都是适用的。感谢。
答案 0 :(得分:0)
问题已解决,它来源于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>
感谢。