Web项目war包从tomcat/Jboss迁移到weblogic12.2遇到的问题

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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宁宁可可

您的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值