I’m going through this tutorial pretty much verbatim:
https://developers.google.com/google-apps/marketplace/tutorial_java
-
deploying to my app engine app id nimbits-domains. I set my consumer secret and api key in my web.xml. The downloadable sample compiles and deployes ok. When I add the app to my domain via the marketplace, and then launch the app I get an error in my app engine log:
Uncaught exception from servlet
javax.servlet.UnavailableException: com.google.inject.ProvisionException: Guice provision errors: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
I’m wondering if the sample code is out of date. Particularly this method in 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);
}
}
Does anyone know a working sample for using OpenID and Google Apps with Java and GAE?
Is this sample broken or is it me?
I went through the tutorial several times and it is out of date. I was able to get a test project working with SSO on App Marketplace by downloading eclipse, (i use intellij) installing the google tools, and using the UI provided to publish an app to the marketplace. Then at least I have something to work with.