Web項目war包從tomcat/Jboss遷移到weblogic12.2遇到的問題
異常1:weblogic部署項目:Cannot set web app root system property when WAR file is not expanded
weblogic下面 war包的形式進行部署的話 報如下錯誤:
Cannot set web app root system property when WAR file is not expanded
解決辦法:
在web-inf 下面 加 weblogic.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app> <container-descriptor> <show-archived-real-path-enabled>true</show-archived-real-path-enabled> </container-descriptor> </weblogic-web-app> |
參考:https://blog.csdn.net/ye1992/article/details/48245623
異常2:The servlet default is referenced in servlet-mapping *.html but not defined in web.xml
異常描述:
<2020-6-16 下午10時01分26,916秒 CST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "app". weblogic.application.ModuleException: weblogic.management.DeploymentException: [HTTP:101170]The servlet default is referenced in servlet-mapping *.html but not defined in web.xml. at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) Truncated. see log file for complete stacktrace Caused By: weblogic.management.DeploymentException: [HTTP:101170]The servlet default is referenced in servlet-mapping *.html but not defined in web.xml. at weblogic.servlet.internal.WebAppServletContext.verifyServletMappings(WebAppServletContext.java:1585) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3194) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1864) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:919) at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360) Truncated. see log file for complete stacktrace |
原因:
<servlet-mapping>
<servlet-name>defalut</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
每個web容器都有一個默認servlet,在tomcat默認servlet的名字是:defalut。而在weblogic是:FileServlet。下面列出各容器的默認servlet的名字
Tomcat, Jetty, JBoss, and GlassFish 默認 Servlet的名字"default" WebLogic 默認 Servlet的名字 "FileServlet" ,WebSphere默認 Servlet的名字 "Simpledefault" 。
解決方法:
將上面的default改成FileServlet就可以了。
參考:https://blog.csdn.net/chenguibing123/article/details/38702893