2012-07-19 45 views
0

我要通过这个教程几乎一字不差:应用程序引擎的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工作示例? 这是打破样本或者是我吗?

回答

0

我通过教程几次去了,这是过时的。我可以通过下载日食,(我用的IntelliJ)安装谷歌工具,并使用提供给应用程序发布到市场上的UI获得的测试项目与SSO在App市场工作。那么至少我有一些工作。

0

helloworld-java例中的应用,市场,资源,项目应该是App Engine的兼容。如果它不适合你,那么很可能是样本已过时。

然而,我的理解是,使用OAuth 2(而不是OpenID的单点登录+自动白名单OAuth范围)是现在市场应用的可接受的方法。这在App Engine上得到了更好的支持(通过各种Google编写的客户端库)。

相关问题