我要通过这个教程几乎一字不差:应用程序引擎的Java的OpenID教程错误
https://developers.google.com/google-apps/marketplace/tutorial_java
部署到我的App Engine应用程序ID nimbits域。我在我的web.xml中设置了我的用户密钥和api密钥。可下载的示例编译和部署正常。当我通过市场上的应用程序添加到我的域名,然后启动该应用程序我在应用程序引擎的日志得到一个错误:
从servlet的 javax.servlet.UnavailableException未捕获的异常:com.google.inject.ProvisionException:吉斯规定错误:
1) Error injecting constructor, java.lang.NullPointerException at com.google.code.samples.apps.marketplace.openid.appengine.AppEngineTrustsRootProvider.<init>(AppEngineTrustsRootProvider.java:33) while locating com.google.code.samples.apps.marketplace.openid.appengine.AppEngineTrustsRootProvider while locating com.google.step2.xmlsimplesign.TrustRootsProvider for parameter 0 at com.google.step2.xmlsimplesign.CachedCertPathValidator.<init>(CachedCertPathValidator.java:61) while locating com.google.step2.xmlsimplesign.CachedCertPathValidator for parameter 0 at com.google.step2.xmlsimplesign.Verifier.<init>(Verifier.java:51) while locating com.google.step2.xmlsimplesign.Verifier for parameter 1 at com.google.step2.discovery.LegacyXrdsResolver.<init>(LegacyXrdsResolver.java:91) while locating com.google.step2.discovery.LegacyXrdsResolver while locating com.google.step2.discovery.XrdDiscoveryResolver for parameter 1 at com.google.step2.discovery.Discovery2.<init>(Discovery2.java:167) while locating com.google.step2.discovery.Discovery2 for parameter 1 at com.google.step2.ConsumerHelper.<init>(ConsumerHelper.java:60) while locating com.google.step2.ConsumerHelper
我想知道如果示例代码是过时的。特别是这种方法GuiceModule:
/**
* Overrides for running on GAE. Need to ue special HTTP fetchers & explicitly set the trust roots
* since the built-in java equivalents are not available when running in GAE's sandbox.
*/
public static class AppEngineModule extends AbstractModule {
@Override
protected void configure() {
bind(HttpFetcher.class)
.to(AppEngineHttpFetcher.class).in(Scopes.SINGLETON);
bind(TrustRootsProvider.class)
.to(AppEngineTrustsRootProvider.class).in(Scopes.SINGLETON);
bind(org.openid4java.util.HttpFetcher.class)
.to(Openid4javaFetcher.class)
.in(Scopes.SINGLETON);
}
}
有谁知道使用OpenID和谷歌Apps的Java和GAE工作示例? 这是打破样本或者是我吗?