首页 \ 问答 \ PermGen space - maven m2e tomcat7(PermGen space - maven m2e tomcat7)

PermGen space - maven m2e tomcat7(PermGen space - maven m2e tomcat7)

我尝试用maven在tomcat上部署一场战争。 当我用maven目标tomcat7: run 。 Tomcat似乎启动maven连接到数据库,然后我有权发生错误:

java.lang.OutOfMemoryError: PermGen space

我使用m2e,eclipse和tomcat。 我试着在POM.xml中添加:

<configuration>
  <systemProperties>
    <JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
  </systemProperties>
</configuration>  

在maven的JRE参数中:

-Xms256m -Xmx512m

但没有任何反应..

你有什么主意吗? 另一种解决这个错误的方法?


I try to deploy a war on tomcat with maven. When I run with maven goal tomcat7: run. Tomcat seems to launch maven connects to the database, then I have the right to error:

java.lang.OutOfMemoryError: PermGen space

I use m2e, eclipse and tomcat. I tried to add in POM.xml :

<configuration>
  <systemProperties>
    <JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
  </systemProperties>
</configuration>  

And in the JRE parameter of maven :

-Xms256m -Xmx512m

But nothing happens ..

Do you have any idea? Another way to solve that error ?


原文:https://stackoverflow.com/questions/24179569
更新时间:2022-09-09 13:09

最满意答案

我想我已经找到了问题(跳到简短答案的粗体文字)。

我在我的机器上尝试了一个示例,方法是在我的桌面上创建一个.html文件,然后将PHP代码段上传到局域网上的开发服务器。 这给了我与你完全相同的结果,也使用了Firefox(v3.5.7)。

我不是一个PHP人(更多的Python / Django),但我知道一些基本的PHP,你的代码看起来很好。 我通过大量的Google / JSON / Ajax示例搜索确认了这一点。 我尝试了在建议论坛中给出的每个选项,包括PHP中的各种缓存头选项和不同的JQuery方法,包括更改一些缓存选项以及尝试各种不同的选项。 没有不同。

我完全简化了PHP,只是返回一个单项JSON数组,没有任何其他条件或控制结构 - 没有乐趣。

最终我得到了绝望,并在IE 8中尝试了相同的文件。它工作了! 在Safari中尝试过它 - 它有效!

然后我变得偏执,并认为Firefox中可能存在一些棘手的会话问题或其他一些奇怪的问题所以我完全清除了我的Firefox历史并重新启动了浏览器。 没有不同。

这至少给了我一个不同的角度,我可以谷歌看看其他人是否有同样的问题。 确实他们有。

事实证明, 如果您在本地计算机上运行包含Ajax的HTML文件,即带有“file://”前缀,Firefox由于某种原因将无法正确进行Ajax调用。 我将文件复制到我的开发服务器,与PHP文件位于同一位置(但仍然使用完整的地址作为Ajax URL),确定它有效!

我并不完全理解Firefox与真正的本地文件和Ajax有什么不同,但它在外面变得轻松,我现在无法调查。 我确实查看了有关安全性的设置,但没有任何明显的跳出来。 我很想知道这是如何适应您的开发环境的设置方式的。 如果我有机会,我会进一步调查,并会更新这个答案。

如果“about:config”中有一些或其他选项可能包含答案,我不会感到惊讶。


I think I've found the problem (skip to the bold text for the short answer).

I tried the example on my machine by creating an .html file on my desktop and uploading the PHP snippet to my dev server on the LAN. This gave me the exact same results as you, also with Firefox (v3.5.7).

I'm not a PHP guy (more Python / Django) but I do know some basic PHP and your code looked fine to me. I confirmed this with much Googling of PHP / JSON / Ajax example-seeking. I tried every option given in advice forums, including various caching header options in the PHP and different JQuery methods, including changing some of its cache options and also trying various different options. No difference.

I completely simplified the PHP to literally just return a single-item JSON array, without any other conditionals or control structures - no joy.

Eventually I got desperate and tried the same file in IE 8. It worked! Tried it in Safari - it worked!

I then got paranoid and thought there might be some sticky session issues in Firefox or some other oddity so I completely cleared my Firefox history and restarted the browser. No difference.

This at least gave me a different angle on what I could Google for to see if others had the same problem. Indeed they had.

It turns out that if you are running the HTML file containing the Ajax on your local machine, i.e. with a "file://" prefix, Firefox for some reason will not make the Ajax calls correctly. I copied the file up to my dev server, in the same location as the PHP file (but still using the full address as the Ajax URL) and sure enough it worked!

I don't fully understand what Firefox does differently with truly local files and Ajax, but it's getting light outside and I can't investigate right now. I did look through the settings regarding security but nothing obvious jumped out at me. I'd be very interested to know how this fits into how your dev environment is set up. I will investigate further later if I get a chance and will update this answer.

I wouldn't be surprised if there is some or other option in "about:config" that may contain the answer.

相关问答

更多
  • 这可能是您的服务器上的一个设置。 通常有一个最大的响应大小。 你有没有看过Firebug,看看反应是否真的到达浏览器? This is probably a setting on your server. There is typically a maximum response size. Have you looked in Firebug to see if the response is actually getting to the browser?
  • 您希望它返回哪里? 被调用的函数是匿名的 ...... 您需要了解$.getJSON 异步发生,因此正常的自上而下流程不适用,您需要做任何您需要触发回调内部 data任何操作... $.getJSON('/index.php?r=site/AJAXsaveCallerReference', function(data) { functionThatDoesWhatYouWant(data); }); Where do you expect it to be returned to? the fun ...
  • 尝试这个 $.getJSON(url,function(result){ if ( result.length == 0 ) { console.log("NO DATA!") } }); Try this $.getJSON(url,function(result){ if ( result.length == 0 ) { console.log("NO DATA!") } });
  • 您必须从localStorage重新解析对象,然后按下: var json = localStorage.getItem('agenda'), myObj = JSON.parse(json); data.push(myObj); You have to re-parse the object from localStorage then push: var json = localStorage.getItem('agenda'), myObj = JSON.parse(json); ...
  • 不支持与localhost的连接。 http://code.google.com/p/android/issues/detail?id=133 127.0.0.1是模拟系统自己的环回接口,而不是主机开发机器上运行的接口。 在Android系统中,应该使用10.0.2.2 ,这是专门设置的别名来联系您的主机127.0.0.1 Connection to localhost is not supported. http://code.google.com/p/android/issues/detail?id=1 ...
  • 确保你有callback=? 在您要访问的URL的查询字符串中...因为它是一个远程域,您需要在这里使用JSONP (哪个callback=?触发器)。 喜欢这个: $.getJSON( 'http://api.meetup.com/events.json?group_urlname=Closing-the-NOLA-Gap&key=ourkey&callback=?', function(data) { console.log(data); } ); 来自$.getJSON()文档: 如果URL包 ...
  • 我想我已经找到了问题(跳到简短答案的粗体文字)。 我在我的机器上尝试了一个示例,方法是在我的桌面上创建一个.html文件,然后将PHP代码段上传到局域网上的开发服务器。 这给了我与你完全相同的结果,也使用了Firefox(v3.5.7)。 我不是一个PHP人(更多的Python / Django),但我知道一些基本的PHP,你的代码看起来很好。 我通过大量的Google / JSON / Ajax示例搜索确认了这一点。 我尝试了在建议论坛中给出的每个选项,包括PHP中的各种缓存头选项和不同的JQuery方法 ...
  • 您需要将page.onCallback与window.callPhantom结合使用,因为您在phantomjs上下文中发出HTTP请求,并且只有在请求完成后才需要返回结果。 我没有测试过这个代码,但它应该是这样的: var jqueryUrl = "https://code.jquery.com/jquery-latest.min.js"; page.open("http://www.example.com/", function(status) { if (status === "succes ...
  • jQuery的$.getJSON 不会发出POST请求。 它只能做GET 。 为了使它完全一样,你需要传递数据作为params ... $http.get(FOO_URL, { params: { email: email, password: password } }) 请参阅https://docs.angularjs.org/api/ng/service/$http#usage 要发送POST请求,格式为application/x-www-form-u ...
  • 由于数组为空,因此甚至不会调用传递给$.each的回调(每个项目调用一次)。 你必须从这个回调中进行测试: if (data.items.length === 0) { $('.list').html('the ' + address + ' list is empty'); } else { $.each( data.items, function( key, value ) { // continue to display the returned records ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)