我卡在数据存储上。带数据存储的Google端点:java.lang.ExceptionInInitializerError
我想用数据存储运行Google终点。
mvn appengine:update
命令后,我可以看到我的方法在资源管理器,但它没有得到执行,因为它有错误。
这里是错误:
java.lang.ExceptionInInitializerError
这里是我的功能,我试图执行:
@ApiMethod(name = "saveProfile", path = "profile", httpMethod = HttpMethod.POST) public Profile saveProfile(final User user, ProfileForm profileForm) throws UnauthorizedException { TeeShirtSize teeShirtSize = TeeShirtSize.NOT_SPECIFIED; if (user == null) { throw new UnauthorizedException("Authorization required"); } String userId = user.getUserId(); String mainEmail = user.getEmail(); String displayName = profileForm.getDisplayName(); if (profileForm.getTeeShirtSize() != null) { teeShirtSize = profileForm.getTeeShirtSize(); } if (displayName == null) { displayName = extractDefaultDisplayNameFromEmail(user.getEmail()); } Profile profile = new Profile(userId, displayName, mainEmail, teeShirtSize);ofy().save().entity(profile).now(); return profile; }
我已经创建了一个名为“OfyService.java”的文件..它是该文件的代码: –
在这个,我已经包括以下东西:package com.google.devrel.training.conference.service; import com.google.devrel.training.conference.domain.Profile; import com.googlecode.objectify.Objectify; import com.googlecode.objectify.ObjectifyFactory; import com.googlecode.objectify.ObjectifyService; –
'public class OfyService {0} {static} {objctifyService.register(Profile.class); } public static Objectify ofy(){ return ObjectifyService.ofy(); (){ } public static ObjectifyFactory factory(){ return ObjectifyService.factory(); } }' –