简体   繁体   English

Java错误导致Openfire崩溃

[英]Openfire Crashing with Java Error

I am running a openfire based chat system in my server, but do get lot crashes related to the openfire java environment, i already increased the java VM memory to the 512MB but still it crashes when the server load exceeds, 我在服务器上运行的是基于Openfire的聊天系统,但确实发生了与Openfire Java环境相关的大量崩溃,我已经将Java VM内存增加到512MB,但是当服务器负载超过时,它仍然崩溃,

i dont have many users only 20,30 at one time with a very powerful 8 core cpu, with 32 GB memory 我没有很多用户一次只有20,30,而一个非常强大的8核cpu,32 GB内存

i am running openfire 3.71. 我正在运行openfire 3.71。 I have to restart the whole server, since restarting the openfire doenst fix the problem at all. 我必须重新启动整个服务器,因为重新启动openfire doenst根本解决了问题。

error i get in java is 我在java中得到的错误是

java.lang.ExceptionInInitializerError
    at org.jivesoftware.admin.LoginLimitManager.getInstance(LoginLimitManager.java:48)
    at org.jivesoftware.openfire.admin.login_jsp._jspService(login_jsp.java:143)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
    at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
    at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:74)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
    at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:50)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
    at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:78)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
    at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:164)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
    at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
    at org.eclipse.jetty.server.Server.handle(Server.java:334)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209)
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at org.jivesoftware.util.TaskEngine.scheduleAtFixedRate(TaskEngine.java:228)
    at org.jivesoftware.admin.LoginLimitManager.(LoginLimitManager.java:83)
    at org.jivesoftware.admin.LoginLimitManager.(LoginLimitManager.java:33)
    at org.jivesoftware.admin.LoginLimitManager$LoginLimitManagerContainer.(LoginLimitManager.java:39)
    ... 36 more 

This error does not seem to be directly related to memory shortage - usually memory errors in Java are OutOfMemoryError errors or refer to limited space for the permanent generation and such. 该错误似乎与内存不足没有直接关系-Java中的内存错误通常是OutOfMemoryError错误,或者是指永久生成之类的有限空间。

NullPointerException exceptions, on the other hand, are almost certainly programming errors in the executed code. 另一方面, NullPointerException异常几乎可以肯定是所执行代码中的编程错误。 Since in your case this seems to happen under load, I can take a few shots in the dark: 由于在您的情况下,这似乎是在负载下发生的,因此我可以在黑暗中拍摄一些照片:

  • There is some finite resource, such as a thread pool or an event queue, that is being exhausted and the code that uses it does not check for that condition. 有一些有限的资源(例如线程池或事件队列)正在耗尽,并且使用该资源的代码不会检查该条件。

  • There is a race condition, where some part of the code hits uninitialized structures that are normally being initialized by another thread under lighter load. 有一个竞争条件,其中部分代码命中未初始化的结构,这些结构通常是在轻负载下由另一个线程初始化的。

  • There is some time out that is being reached, returning null that is then not handled properly. 超时时间到了,返回null ,然后未正确处理。

Please note that the amount of memory available to the VM can affect the timing of various operations, due to the effect of the garbage collector running more or less frequently. 请注意,由于垃圾收集器或多或少频繁运行的影响,VM可用的内存量影响各种操作的时间。 You can use a profiler, such as VisualVM , to tell whether your application is starved for memory or not. 您可以使用分析器(例如VisualVM )来判断您的应用程序是否缺少内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM