简体   繁体   English

新手-初始化Java类

[英]Newbie - Initializing Java classess

I am trying to implement an app based on and Android app which is working quite happily 我正在尝试实现一个基于应用程序和Android应用程序,该应用程序运行得很愉快

it downloads a blob from the blob store 它从Blob存储区下载一个Blob

The application has about 20 non persistent classes which appear in the .src (uncompiled .java files) folder together with the servlet .java code The 20 classes are used to construct a data class which is populated from the downloaded blob. 该应用程序具有约20个非持久类,它们与servlet .java代码一起出现在.src(未编译的.java文件)文件夹中。这20个类用于构造从下载的blob中填充的数据类。 I want all uses to be able access this data (at least in the first instance) 我希望所有用户都可以访问此数据(至少在第一个实例中)

However when debugging the blob is downloaded OK but I get the following stack trace during class initialization. 但是,在调试Blob时,可以下载OK,但是在类初始化期间会得到以下堆栈跟踪。

I have been searching for the answer for several weeks and would appreciate some help. 我一直在寻找答案几周了,希望能有所帮助。

I am sure it is something simple I am missing. 我敢肯定,这很简单,我很想念。

I am using eclipse, App Engine SDK 1.7.7 and JDK1,7.0_17 我正在使用Eclipse,App Engine SDK 1.7.7和JDK1,7.0_17

it is clear something to do with (PropertyPermission and the SecurityManager.checkPropertyAccess 显然与(PropertyPermission和SecurityManager.checkPropertyAccess

As with most things if you ask a difficult question - you won't necessarily understand the answer - so please keep it simple!! 与大多数情况一样,如果您提出一个困难的问题-您不一定会理解答案-因此请保持简单!

The stack trace :- 堆栈跟踪:-

INFO: Local Datastore initialized: 
    Type: High Replication
    Storage: C:\Users\Steve\workspace2\Blobstoredemo\war\WEB-INF\appengine-generated\local_db.bin
Jun 09, 2013 2:58:53 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: Time to load datastore: 522 ms
Jun 09, 2013 2:59:23 PM com.google.appengine.api.datastore.dev.LocalDatastoreService$PersistDatastore persist
INFO: Time to persist datastore: 190 ms
Jun 09, 2013 3:00:07 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Error for /view
java.lang.StackOverflowError
    at java.util.PropertyPermission.<init>(PropertyPermission.java:167)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
    at java.lang.System.getProperty(System.java:706)
    at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:63)
    at blobstoredemo.Weekfile.<init>(Weekfile.java:13)
    at blobstoredemo.t_round.<init>(t_round.java:26)
    at blobstoredemo.Weekfile.<init>(Weekfile.java:9)
    at blobstoredemo.t_round.<init>(t_round.java:26)
    at blobstoredemo.Weekfile.<init>(Weekfile.java:9)
    at blobstoredemo.t_round.<init>(t_round.java:26)
    at blobstoredemo.Weekfile.<init>(Weekfile.java:9)
    at blobstoredemo.t_round.<init>(t_round.java:26)

a lot more of the same.... 更多相同的...

The stack trace is pretty clear. 堆栈跟踪非常清晰。 You call class Weeekfile from class t_round at line 26. The class Weekfile calls t_round back at its line 9. This means that you implemented infinite recursion: there is not exit condition or it does not work. 你叫类Weeekfile从类t_round的线26类Weekfile电话t_round回到了线9.这意味着你实现无限递归:没有退出条件,或不工作。

Check your code again at mentioned lines. 在上述行再次检查您的代码。 I am sure you will find the problem quickly. 我相信您会很快发现问题。 If not, come here again but please send your code. 如果没有,请再次来到这里,但请发送您的代码。 It is hard to find bug in your code without seeing it. 很难看到代码中的错误。 :) Good luck. :) 祝好运。

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

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