Java 为什么在打开部署在weblogic上的应用程序时出现错误404?
我有一个web应用程序,在weblogic 12.c中运行spring+hibernate+struts2 因此,当我在本地weblogic上运行它时,它运行得非常好,但是当我将它部署到同样具有weblogic 12.c的qa服务器时,即使应用程序状态显示它处于活动状态,我也会收到错误404。 从weblogic中,我打开应用程序选项,然后是测试选项,最后是它根据weblogic拥有的url,但我仍然得到错误404。 我试着检查我的数据库连接和上下文,但没有成功 以下是我的weblogic.xml:Java 为什么在打开部署在weblogic上的应用程序时出现错误404?,java,struts2,weblogic,weblogic12c,Java,Struts2,Weblogic,Weblogic12c,我有一个web应用程序,在weblogic 12.c中运行spring+hibernate+struts2 因此,当我在本地weblogic上运行它时,它运行得非常好,但是当我将它部署到同样具有weblogic 12.c的qa服务器时,即使应用程序状态显示它处于活动状态,我也会收到错误404。 从weblogic中,我打开应用程序选项,然后是测试选项,最后是它根据weblogic拥有的url,但我仍然得到错误404。 我试着检查我的数据库连接和上下文,但没有成功 以下是我的weblogic.xm
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 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 http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<!-- Usar las librerias del repositorio y no las del weblogic -->
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<!-- Configuracion del directorio virtual -->
<virtual-directory-mapping>
<local-path>C:\Oracle\Middleware\user_projects\domains\WeegoWeb</local-path>
<url-pattern>formatos/*</url-pattern>
<url-pattern>maletas/*</url-pattern>
<url-pattern>modems/*</url-pattern>
<url-pattern>sims/*</url-pattern>
<url-pattern>contratos/*</url-pattern>
<url-pattern>qr/*</url-pattern>
<url-pattern>*.png</url-pattern>
<url-pattern>*.zip</url-pattern>
<url-pattern>*.pdf</url-pattern>
</virtual-directory-mapping>
<jsp-descriptor>
<keepgenerated>true</keepgenerated>
<debug>true</debug>
</jsp-descriptor>
<!-- Configuracion del contexto -->
<context-root>WeegoWeb</context-root>
<fast-swap>
<enabled>false</enabled>
</fast-swap>
</weblogic-web-app>
真的
C:\Oracle\Middleware\user\u projects\domains\WeegoWeb
formatos/*
马莱塔斯/*
调制解调器/*
模拟人生/*
反托斯/*
qr/*
*.png
*zip先生
*.pdf
真的
真的
网络
假的
和my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd"
version="3.0">
<display-name>WeegoWeb</display-name>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
<filter>
<filter-name>sanitizarFilter</filter-name>
<filter-class>com.proximate.generales.interceptors.SanitizarFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sanitizarFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/spring/context.xml</param-value>
</context-param>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<listener>
<listener-class>com.proximate.generales.interceptors.LoginInterceptor</listener-class>
</listener>
<welcome-file-list>
<welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/jsp/404.jsp</location>
</error-page>
<!-- <error-page>
Missing login
<error-code>401</error-code>
<location>/jsp/error/error2.jsp</location>
</error-page>
<error-page>
Forbidden directory listing
<error-code>403</error-code>
<location>/jsp/error/error2.jsp</location>
</error-page>
<error-page>
Uncaught exception
<error-code>500</error-code>
<location>/jsp/error/error2.jsp</location>
</error-page>
<error-page>
Unsupported servlet method
<error-code>503</error-code>
<location>/jsp/error/error2.jsp</location>
</error-page> -->
</web-app>
网络
*.jsp
UTF-8
消毒过滤器
com.proximate.generales.interceptors.SanitizarFilter
消毒过滤器
/*
编码滤波器
org.springframework.web.filter.CharacterEncodingFilter
编码
UTF-8
强制编码
真的
编码滤波器
/*
支柱
org.apache.struts2.dispatcher.FilterDispatcher
支柱
/*
字符编码滤波器
/*
上下文配置位置
/WEB-INF/conf/spring/context.xml
瓷砖定义
/WEB-INF/tiles.xml
org.springframework.web.context.ContextLoaderListener
org.apache.struts2.tiles.StrutsTilesListener
com.proximate.generales.interceptors.LoginInterceptor
jsp/index.jsp
30
404
/jsp/404.jsp
只有在我的本地环境工作并且在我的qa服务器上显示错误404时,才会发生什么?
提前感谢在欢迎文件列表中,您使用了错误的文件名
jsp/index.jsp
。您应该在欢迎文件
标记中写入文件名
<welcome-file>index.jsp</welcome-file>
查看如何编写web应用程序描述符。检查日志后,我发现无法访问hibernate-configuration-3.0.dtd,因为服务器中的端口80被阻塞,所以现在我下载了hibernate-configuration-3.0.dtd并将其作为本地资源放置,以便我的hibernate映射文件可以在本地使用它们。我想我将从XMLHibernate迁移到注释以避免更多问题。在Intellij-weblogic项目中遇到了这个错误 “错误404--找不到 来自RFC 2068超文本传输协议--未找到HTTP/1.1:10.4.5 404“
不知何故,项目工件没有正确安装到本地.m2存储库中。通过运行mvn clean、package/install命令确保其安装正确。QA服务器上是否存在上面weblogic.xml中定义的本地路径?是的。事实上,直到昨天它还可以正常工作,然后weblogic在内存部门达到了极限,所以他们重新启动weblogic,这就是问题开始的时候。我曾多次尝试使用不同的上下文重新安装应用程序,但都没有成功。如果他们重新启动了服务器,那么您可能需要确保所有必需的服务都已备份并运行,web服务器、数据库等。我检查了,并且除我之外安装的所有应用程序都运行良好。我使用的是maven,当你说清洁构建时,你的意思是:mvn清洁安装编译包??
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>