我正在逐字阅读本教程:
https://developers.google.com/google-apps/marketplace/tutorial_java
部署到我的应用引擎应用 id nimbits-domains。我在 web.xml 中设置了我的消费者密码和 api 密钥。可下载的示例编译和部署正常。当我通过市场将应用程序添加到我的域,然后启动应用程序时,我的应用程序引擎日志中出现错误:
来自 servlet javax.servlet.UnavailableException 的未捕获异常:com.google.inject.ProvisionException:Guice 配置错误:
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 和 Google Apps 与 Java 和 GAE 一起使用的工作示例?这个样品是坏的还是我的?