这是当我在 NetBeans 启动的 Tomcat servlet 容器实例中运行 Web 应用程序时出现的错误。为了解决这个问题,我什至更改了 netbeans.conf 中的堆大小,但它仍然显示相同的错误。我怎样才能避免这种情况发生?
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
java.lang.OutOfMemoryError: Java heap space
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
更改 netbeans.conf 中的堆大小只会更改 NetBeans 本身的堆,不会更改通过 NetBeans 运行的应用程序。
正确的方法是右键单击项目,选择“属性”,然后选择“运行”;在那里您可以适当地设置虚拟机选项(-Xmx256m
, 例如)。它应该看起来像这样:
(Thanks to VonC https://stackoverflow.com/users/6309/vonc for finding this picture.)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)