本文介绍了URLFetchServiceFactory.getURLFetchService()中的StackOverflowError。fetch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用GAE的API:

  URLFetchServiceFactory.getURLFetchService()。fetch 

$ b

哪些工作在 devserver 上运行,但在30到60分钟之后(时间变化)开始抛出 StackOverflowError



调用 fetch 到标准的网址可能会导致 URLFetchServiceFactory.getURLFetchService()。fetch 抛出SO错误。



以下是完整的日志:(long)

解决方案

完整日志中的堆栈深度具有非常可疑的值1025 = 1024 + 1

仔细观察,发现你有这个重复的递归调用序列:

  [INFO] at java.io.File.isDirectory(File.java:844)
[INFO] at sun.net.www.ParseUtil.fileToEncodedURL(ParseUtil.java:269)
[INFO] at sun.security.provider.PolicyFile.canonicalizeCodebase(PolicyFile.java:1735)
[INFO] at sun.security.provider.PolicyFile.access $ 700(PolicyFile.java:258)
[ INFO] at sun.security.provider.PolicyFile $ 5.run(PolicyFile.java:1188)
[INFO] at sun.security.provider.PolicyFile $ 5.run(PolicyFile.java:1186)
[信息]在java.security.AccessController.doPrivileged(本地方法)
[信息]在sun.security.provider.PolicyFile.getPermissions (PolicyFile.java:1185)
[信息]在sun.security.provider.PolicyFile.getPermissions(PolicyFile.java:1132)
[信息]在sun.security.provider.PolicyFile.implies(PolicyFile .java:1086)
[com.google.appengine.tools.development.IsolatedAppClassLoader上的INFO] $ ProxyPolicy $ 2.run(IsolatedAppClassLoader.java:418)
[com.google.appengine]上的[INFO]。 tools.development.IsolatedAppClassLoader $ ProxyPolicy $ 2.run(IsolatedAppClassLoader.java:415)
java.security.AccessController.doPrivileged(Native Method)的[INFO]
[com.google.appengine]上的[INFO]。 tools.development.IsolatedAppClassLoader $ ProxyPolicy._implies(IsolatedAppClassLoader.java:415)
[INFO] at com.google.appengine.tools.development.IsolatedAppClassLoader $ ProxyPolicy.implies(IsolatedAppClassLoader.java:42005)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:450)
[INFO]在java.security.ProtectionDomain.implies(ProtectionDomain.java:285)上的[INFO]
[INFO] security.Acce ssController.checkPermission(AccessController.java:884)
[INFO]位于java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
[INFO]位于com.google.appengine.tools.development。 DevAppServerFactory $ CustomSecurityManager.checkPermission(DevAppServerFactory.java:429)
java.lang.SecurityManager.checkRead(SecurityManager.java:888)的[INFO]
java.io.File.isDirectory的[INFO] File.java:844)
...重复49次左右

我是不是Java用户,但如果我正确解释它,看起来你可能正在处理一个太深的目录结构。

如果是这样,重新安排目录结构或修改您的代码可以限制它一次性投入的深度。


My application uses this API from GAE:

URLFetchServiceFactory.getURLFetchService().fetch

Which works running on devserver but after 30 to 60 minutes (time varies) it starts throwing StackOverflowError.

In what way that a call to fetch to a standard web URL could actually cause URLFetchServiceFactory.getURLFetchService().fetch to throw SO error.

Here's the complete log: https://pastebin.com/WCcmXCH3 (long)

解决方案

The stack depth in the complete log has a very suspicious value of 1025 = 1024 +1.

A closer look reveals that you have this repeating recursive call sequence:

[INFO]  at java.io.File.isDirectory(File.java:844)
[INFO]  at sun.net.www.ParseUtil.fileToEncodedURL(ParseUtil.java:269)
[INFO]  at sun.security.provider.PolicyFile.canonicalizeCodebase(PolicyFile.java:1735)
[INFO]  at sun.security.provider.PolicyFile.access$700(PolicyFile.java:258)
[INFO]  at sun.security.provider.PolicyFile$5.run(PolicyFile.java:1188)
[INFO]  at sun.security.provider.PolicyFile$5.run(PolicyFile.java:1186)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at sun.security.provider.PolicyFile.getPermissions(PolicyFile.java:1185)
[INFO]  at sun.security.provider.PolicyFile.getPermissions(PolicyFile.java:1132)
[INFO]  at sun.security.provider.PolicyFile.implies(PolicyFile.java:1086)
[INFO]  at com.google.appengine.tools.development.IsolatedAppClassLoader$ProxyPolicy$2.run(IsolatedAppClassLoader.java:418)
[INFO]  at com.google.appengine.tools.development.IsolatedAppClassLoader$ProxyPolicy$2.run(IsolatedAppClassLoader.java:415)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at com.google.appengine.tools.development.IsolatedAppClassLoader$ProxyPolicy._implies(IsolatedAppClassLoader.java:415)
[INFO]  at com.google.appengine.tools.development.IsolatedAppClassLoader$ProxyPolicy.implies(IsolatedAppClassLoader.java:42005)
[INFO]  at java.security.ProtectionDomain.implies(ProtectionDomain.java:285)
[INFO]  at java.security.AccessControlContext.checkPermission(AccessControlContext.java:450)
[INFO]  at java.security.AccessController.checkPermission(AccessController.java:884)
[INFO]  at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
[INFO]  at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:429)
[INFO]  at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
[INFO]  at java.io.File.isDirectory(File.java:844)
... repeating 49 times or so

I'm not a Java user, but if I interpret it correctly it appears you may be processing a directory structure too deep.

If so, either re-arrange the directory structure or modify your code to limit how deep it goes into it in one-shot.

这篇关于URLFetchServiceFactory.getURLFetchService()中的StackOverflowError。fetch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 15:15