Glassfish 4服务器意外停止 [英] Glassfish 4 server stops unexpectedly

查看:437
本文介绍了Glassfish 4服务器意外停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GlassFish的新手,一般来说是应用程序服务器。我有一个运行Ubuntu的Amazon EC2实例,并安装了GlassFish 4.它启动时没有问题,但一段时间后GlassFish服务器自行关闭。我已经查看了server.log,但一切看起来很正常,并且没有描述任何故障或关闭的条目。任何关于可能是什么原因的输入,或者我应该寻找什么线索? 我正面对完全相同的情况。我怀疑是因为JVM耗尽内存,因为免费的EC2实例有一个600 MB( cat / proc / meminfo 来验证)。为了寻找线索,我为Glassfish域打开了JVM日志记录,为此,我在< domain> /config/domain.xml 中为JVM参数添加了以下行: :

 < jvm-options> -XX:LogFile = $ {com.sun.aas.instanceRoot} / logs / jvm的.log< / JVM-选项> 
< jvm-options> -XX:+ LogVMOutput< / jvm-options>

后来当Glassfish关闭时, jvm.log 包含大量消息,如下所示:

 < dependency_failed type ='unique_concrete_method'ctxk ='java / util / ArrayList 'x ='java / util / ArrayList iterator()Ljava / util / Iterator;'witness ='javax / faces / component / UIComponentBase $ ChildrenList'stamp ='13211.267'/> 
< dependency_failed type ='unique_concrete_method'ctxk ='java / util / ArrayList'x ='java / util / ArrayList iterator()Ljava / util / Iterator;'witness ='javax / faces / component / UIComponentBase $ ChildrenList'stamp ='13211.267'/>
< dependency_failed type ='unique_concrete_method'ctxk ='java / util / ArrayList'x ='java / util / ArrayList iterator()Ljava / util / Iterator;'witness ='javax / faces / component / UIComponentBase $ ChildrenList'stamp ='13211.267'/>

我从来没有发现他们真正的意思,但是我在这里张贴他们以防别人拿着

然后,最后我查看了 / var / log / syslog (the the same road as me and googles for them。)一个我发现实际上是命名为 syslog.1 ),瞧!我得到了确认JVM进程耗尽内存并被杀害:

  Dec 20 07:44:44 ip-172- 31-33-222内核:[1518108.211801]内存不足:杀死进程22248(java)得分743或牺牲子
Dec 20 07:44:44 ip-172-31-33-222 kernel:[1518108.211833]杀死进程22248(java)total-vm:1622220kB,anon-rss:447752kB,file-rss:0kB

在我看来,增加交换空间应该可以解决问题。事实证明,在EC2交换空间默认为0,所以我分配了1 GB,请参阅如何将交换添加到EC2实例?



该服务器每天都会崩溃,但交换时却没有几周后就会崩溃。

I'm new to GlassFish, and to application servers in general. I have an Amazon EC2 instance running Ubuntu and have installed GlassFish 4. It starts up without problems, but after a while the GlassFish server just shuts down all by itself. I have looked through server.log, but everything seems normal, and there are no entries describing any failures or shut down. Any input on what can be the cause, or where I should look to find any clues?

解决方案

I am facing the exact same situation. I suspected the reason was that JVM ran out of RAM, as the free EC2 instance has a niggard 600 MB (cat /proc/meminfo to verify). To look for clues I turned on JVM logging for Glassfish domain, in order to do so I added the following lines to JVM parameters in <domain>/config/domain.xml:

<jvm-options>-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log</jvm-options>
<jvm-options>-XX:+LogVMOutput</jvm-options>

Later when Glassfish shut down, the jvm.log contained lots of messages like the following:

<dependency_failed type='unique_concrete_method' ctxk='java/util/ArrayList' x='java/util/ArrayList iterator ()Ljava/util/Iterator;' witness='javax/faces/component/UIComponentBase$ChildrenList' stamp='13211.267'/>
<dependency_failed type='unique_concrete_method' ctxk='java/util/ArrayList' x='java/util/ArrayList iterator ()Ljava/util/Iterator;' witness='javax/faces/component/UIComponentBase$ChildrenList' stamp='13211.267'/>
<dependency_failed type='unique_concrete_method' ctxk='java/util/ArrayList' x='java/util/ArrayList iterator ()Ljava/util/Iterator;' witness='javax/faces/component/UIComponentBase$ChildrenList' stamp='13211.267'/>

I never found out what they really meant, but I'm posting them here in case someone takes the same road as me and googles for them.

Then finally I looked in /var/log/syslog (the one I found was actually named syslog.1), and voila! I got the confirmation that JVM process ran out of memory and was killed:

Dec 20 07:44:44 ip-172-31-33-222 kernel: [1518108.211801] Out of memory: Kill process 22248 (java) score 743 or sacrifice child
Dec 20 07:44:44 ip-172-31-33-222 kernel: [1518108.211833] Killed process 22248 (java) total-vm:1622220kB, anon-rss:447752kB, file-rss:0kB

It seems to me that increasing swap space should fix the problem. It turns out on EC2 swap space is 0 by default, so I allocated 1 GB, see How do you add swap to an EC2 instance?

The server used to crash on a daily basis, but with swap on it hasn't crashed in weeks.

这篇关于Glassfish 4服务器意外停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆