端点方法中的堆栈溢出错误

时间:2016-06-30 12:32:14

标签: android stack-overflow google-cloud-endpoints

我正在使用端点开发一个谷歌应用引擎驱动的Android应用程序,在我正在编写的api中,我不断出现堆栈溢出错误。

到目前为止,我的端点api类中有两种方法:

@ApiMethod(name = "saveProfile")
public Profile saveProfile(@Named("userId") String userId,
                               @Named("firstName") String firstName,
                               @Named("lastName") String lastName,
                               @Named("birthday") String birthday) {

        Profile profile = ofy().load().key(Key.create(Profile.class, userId)).now();
        if (profile == null) {
            profile = new Profile(userId, firstName, lastName, birthday);
        } else {
            profile.updateProfile(firstName, lastName, birthday);
        }
        ofy().save().entity(profile).now();
        return profile;
    }

@ApiMethod(name = "getSuggestedFriends")
public List<Profile> getSuggestedFriends(@Named("userId") String userId) {

    Profile profile = ofy().load().key(Key.create(Profile.class, userId)).now();
    if (profile != null) {
        /**
         * Queries for users with same last name as you (presumably family).
         */
        Query<Profile> sameLastName = ofy().load().type(Profile.class).order("birthday");
        sameLastName = sameLastName.filter("lastName =", profile.getLastName());

        /**
         * Gets the friends of your friends.
         */
        List<Profile> suggestedFriends = new ArrayList<>(0);
        for (Profile friend : profile.getFriends()) {
            for (Profile friendOfFriend : friend.getFriends()) {
                if (!profile.getFriends().contains(friendOfFriend))
                    suggestedFriends.add(friendOfFriend);
            }
        }

        /**
         * Merge the 2 lists into 1 list of suggested friends.
         */
        for (Profile suggestedFriend : sameLastName) {
            if (!profile.getFriends().contains(suggestedFriend))
                suggestedFriends.add(suggestedFriend);
        }
        return suggestedFriends;
    } else
        return null;
}

有人可以提供一些见解和解决方案,说明为什么会这样吗?

修改

大部分的堆栈跟踪(它很长):

java.lang.StackOverflowError
    at java.util.AbstractCollection.toArray(AbstractCollection.java:176)
    at sun.reflect.annotation.AnnotationParser.toArray(AnnotationParser.java:865)
    at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:1139)
    at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:207)
    at com.googlecode.objectify.impl.FieldProperty.<init>(FieldProperty.java:36)
    at com.googlecode.objectify.impl.KeyMetadata.findKeyFields(KeyMetadata.java:77)
    at com.googlecode.objectify.impl.KeyMetadata.<init>(KeyMetadata.java:50)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:64)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.ClassPopulator.<init>(ClassPopulator.java:88)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.createEntityClassTranslator(ClassTranslatorFactory.java:66)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:48)
    at com.googlecode.objectify.impl.translate.ClassTranslatorFactory.create(ClassTranslatorFactory.java:36)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)
    at com.googlecode.objectify.impl.translate.Translators.get(Translators.java:117)
    at com.googlecode.objectify.impl.translate.CreateContext.getTranslator(CreateContext.java:27)
    at com.googlecode.objectify.impl.translate.CollectionTranslatorFactory.create(CollectionTranslatorFactory.java:38)
    at com.googlecode.objectify.impl.translate.Translators.create(Translators.java:138)

干杯。

1 个答案:

答案 0 :(得分:0)

在这种情况下会发生这种情况:

/home/clay/PycharmProjects/ganymede/venv/bin/python /home/clay/PycharmProjects/ganymede/main.py
2020-04-01 22:07:09.176637: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2020-04-01 22:07:09.176781: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-04-01 22:07:09.176798: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
  File "/home/clay/PycharmProjects/ganymede/main.py", line 6, in <module>
    import tflearn
  File "/home/clay/PycharmProjects/ganymede/venv/lib/python3.6/site-packages/tflearn/__init__.py", line 4, in <module>
    from . import config
  File "/home/clay/PycharmProjects/ganymede/venv/lib/python3.6/site-packages/tflearn/config.py", line 5, in <module>
    from .variables import variable
  File "/home/clay/PycharmProjects/ganymede/venv/lib/python3.6/site-packages/tflearn/variables.py", line 7, in <module>
    from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib'

根据您的情况,您可以尝试@ Serialize'ing children。