weblogic启动之后经常自己挂掉的情况总结

因为天天都和weblogic打交道,碰到不少坑,今天突然觉得应该把遇到的坑总结一下,有备无患0.0

1.weblogic与jdk的问题(2018-04-26更新)

今天刚到公司现场人员就告诉我网站又挂了(他妈了个巴子的)....于是查看日志,发现网站挂掉之前打印如下日志:

<2018-4-26 上午08时43分54秒 CST> <Notice> <WebLogicServer> <BEA-000388> <JVM called the WebLogic Server shutdown hook. The server will force shutdown now.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <WebLogicServer> <BEA-000396> <Server shutdown has been requested by <WLS Kernel>.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SUSPENDING.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "DefaultSecure[1]", listening on 10.46.5.6:7002, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "DefaultSecure", listening on 127.0.0.1:7002, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "Default[1]", listening on 10.46.5.6:7001, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "DefaultSecure[2]", listening on fe80:0:0:0:eda:41ff:fe1d:46ed:7002, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "DefaultSecure[3]", listening on 0:0:0:0:0:0:0:1:7002, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "Default[3]", listening on 0:0:0:0:0:0:0:1:7001, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "Default", listening on 127.0.0.1:7001, was shut down.>
<2018-4-26 上午08时43分54秒 CST> <Notice> <Server> <BEA-002607> <Channel "Default[2]", listening on fe80:0:0:0:eda:41ff:fe1d:46ed:7001, was shut down.>
INFO [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] org.springframework.context.support.AbstractApplicationContext.doClose(862) | Closing WebApplicationContext for namespace 'springmvc-servlet': startup date [Wed Apr 25 11:56:20 CST 2018]; parent: Root WebApplicationContext
INFO [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] org.springframework.context.support.AbstractApplicationContext.doClose(862) | Closing Root WebApplicationContext: startup date [Wed Apr 25 11:55:58 CST 2018]; root of context hierarchy

重点看前几行就好了,到网上一查发现应该是weblogic本身的问题,引用某文章的话:“当你的weblogic使用sun jvm时出现shutdown现象,是系统的一个不必要的操作,导致要关闭这个进程“。

而我的weblogic刚好使用的是sun jvm。

确认你的weblogic使用的jdk是sun jdk还是JRockit jdk,然后需要在JAVA_OPTIONS加入以下参数

    A sun jdk-加: -Djava.awt.headless=true -Xrs( -Djava.awt.headless=true可以不用)

              B JRockit jdk-加: -Xnohup

        所以找到 setdomainenv.sh,在文件的最后找到 JAVA_OPTIONS="${JAVA_OPTIONS}"改成JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.awt.headless=true -Xrs"或JAVA_OPTIONS="${JAVA_OPTIONS} -Xnohup "即可。

  关于修改JAVA_OPTIONS其实在很多相启动时的配置文件都可以修改,以上是linux环境weblogic修改方案。

关于如何确认jdk是sun还是JRockit,只需要执行java -version命令查看,如果显示类似如下则是sun jdk:

 

posted @ 2018-04-26 09:58  昊Zz  阅读(8273)  评论(2编辑  收藏  举报