简体   繁体   中英

Newbie - Initializing Java classess

I am trying to implement an app based on and Android app which is working quite happily

it downloads a blob from the blob store

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. 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.

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

it is clear something to do with (PropertyPermission and the 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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