我卡在數據存儲上。帶數據存儲的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(); } }' –