oracle – 将Struts2应用程序部署到Weblogic 12c
我有一个使用Struts2,Spring和JPA的Web应用程序.在应用程序中,我们正在使用注释.当我们在eclipse中部署应用程序时,如果我们将其部署为虚拟应用程序(右键单击服务器,选择属性,选择WebLogic,选择发布模式),应用程序运行正常.此选项生成_auto_generated_ear文件并运行应用程序.当我将其部署为展开的归档文件或通过管理控制台手动将应用程序部署为.war文件时,我收到以下错误消息:
任何WebLogic专家都能指出我正确的方向吗?在WebLogic中运行的Struts2的Convention-plugin是否存在问题?任何帮助将不胜感激.提前致谢. 更新: web.xml中 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>eServices</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Needed to manage the Java based @Configuration classes for Spring --> <context-param> <param-name>contextClass</param-name> <param-value> org.springframework.web.context.support.AnnotationConfigWebApplicationContext </param-value> </context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value>com.ceiwc.es.config</param-value> </context-param> <!-- Handles Strut2 URL requests --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <session-config> <session-timeout>20</session-timeout> </session-config> </web-app> 在struts.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <!-- Struts Constants that override the struts.properties file --> <constant name="struts.devMode" value="false" /> <constant name="struts.custom.i18n.resources" value="global" /> <constant name="struts.ui.theme" value="simple" /> </struts>这是最终有效的解决方案!我添加了以下Struts2属性: <constant name="struts.convention.action.includeJars" value=".*?.jar(!/|/)?" /> <constant name="struts.convention.action.fileProtocols" value="jar,zip" /> 这是基于我在post中找到的内容. 此外,将此属性添加到weblogic.xml也可能有所帮助: <wls:container-descriptor> <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> </wls:container-descriptor> 我没有必要对我的项目这样做. 我希望这有助于将来的某个人! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |