Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-322

Allow JDO objectstore to run on the Google App Engine

    Details

      Description

      Following info provided by Maurizio Taverna...

      We have (with some provisos) successfully deployed a version of the quickstart_wicket_restful_jdo on GAE.
      Below the information collected :

      1. DataNucleusApplicationComponents.java
      61:persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(props);
      replaced with :
      61:persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory("transactions-optional");

      See official Google documentation :
      https://developers.google.com/appengine/docs/java/datastore/jdo/overview-dn2#Getting_a_PersistenceManager_Instance

      66:createSchema(props, classesToBePersisted);
      replace with :
      // 66:createSchema(props, classesToBePersisted);
      This feature is for RDBMS, it raise exception using DN Google implementation.

      2. PersistenceSession.java
      894:if (adapter.getVersion() == null)

      { 895: throw new ObjectPersistenceException("Object to be ... " + adapter); 896:}

      replaced with:
      894://if (adapter.getVersion() == null)

      { 895:// throw new ObjectPersistenceException("Object to be ... " + adapter); 896://}

      We could not understand why the version is null, during the fixture installation ( removeAllToDosForCurrentUser ).

      3. jdoconfig.xml
      The Google App Engine keep the Jdo configuration in /WEB-INF/classes/META-INF/jdoconfig.xml.
      We changed :

      <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="false"/>

      This is a workaround, more information available here:
      https://developers.google.com/appengine/docs/java/datastore/jdo/overview-dn2#Disabling_Transactions_and_Porting_Existing_JDO_Apps

      With the changes above, the quickstart_wicket_restful_jdo is possible install the fixtures and list the items,
      but there are still errors accessing to an item.
      At https://docs.google.com/file/d/0B-Ekm92XLvTAcGxHNTJyRDA3bkk/edit?usp=sharing please find the zip of the project, including the ant build script , a live version is available here: http://isis-gae.appspot.com/.
      In order to run the example you need to install the GAE SDK and point the appengine.sdk property
      to the GAE SDK installation path.
      In addition please check in

      {gae.sdk}lib/tools/orm contains the datanucleos 3.1.1 jars. If not remove all the jar files (in default installation I found datanucleus 1.5 jars) and replace with jars available in {gae.sdk}

      /lib/opt/user/datanucleus/v2.

      Stack trace obtained when trying to access object:

      Unexpected RuntimeException

      Last cause: null
      WicketMessage: Can't instantiate page using constructor 'public org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument 'objectOid=[TODO:L_1003], pageType=[ENTITY], pageTitle=[Write blog post]'. Might be it doesn't exist, may be it is not visible (public).

      Stacktrace

      Root cause:

      java.lang.NullPointerException
      at com.google.appengine.datanucleus.EntityUtils.idToInternalKey(EntityUtils.java:204)
      at com.google.appengine.datanucleus.DatastoreIdentityKeyTranslator.getKey(DatastoreIdentityKeyTranslator.java:32)
      at org.datanucleus.ObjectManagerImpl.newObjectId(ObjectManagerImpl.java:3439)
      at org.datanucleus.api.jdo.JDOPersistenceManager.newObjectIdInstance(JDOPersistenceManager.java:1618)
      at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1740)
      at org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore.loadPojo(DataNucleusObjectStore.java:380)
      at org.apache.isis.objectstore.jdo.datanucleus.persistence.adaptermanager.DataNucleusPojoRecreator.recreatePojo(DataNucleusPojoRecreator.java:38)
      at org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault.adapterFor(AdapterManagerDefault.java:300)
      at org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento$Type$2.recreateAdapter(ObjectAdapterMemento.java:104)
      at org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento$Type.getAdapter(ObjectAdapterMemento.java:170)
      at org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento.getObjectAdapter(ObjectAdapterMemento.java:288)
      at org.apache.isis.viewer.wicket.model.models.EntityModel.load(EntityModel.java:193)
      at org.apache.isis.viewer.wicket.model.models.EntityModel.load(EntityModel.java:202)
      at org.apache.isis.viewer.wicket.model.models.EntityModel.load(EntityModel.java:52)
      at org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:121)
      at org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract.appliesTo(EntityComponentFactoryAbstract.java:55)
      at org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract.appliesTo(ComponentFactoryAbstract.java:61)
      at org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.findComponentFactories(ComponentFactoryRegistryDefault.java:136)
      at org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.findComponentFactory(ComponentFactoryRegistryDefault.java:153)
      at org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.findComponentFactoryElseFailFast(ComponentFactoryRegistryDefault.java:159)
      at org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.createComponent(ComponentFactoryRegistryDefault.java:119)
      at org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.addOrReplaceComponent(ComponentFactoryRegistryDefault.java:105)
      at org.apache.isis.viewer.wicket.ui.pages.PageAbstract.addComponent(PageAbstract.java:201)
      at org.apache.isis.viewer.wicket.ui.pages.PageAbstract.addChildComponents(PageAbstract.java:196)
      at org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage.<init>(EntityPage.java:50)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:170)
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:98)
      at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
      at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
      at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
      at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
      at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:196)
      at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
      at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
      at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
      at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
      at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
      at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
      at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454)
      at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461)
      at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338)
      at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330)
      at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
      at java.lang.Thread.run(Thread.java:679)

      Complete stack:

      org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument 'objectOid=[TODO:L_1003], pageType=[ENTITY], pageTitle=[Write blog post]'. Might be it doesn't exist, may be it is not visible (public).
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193)
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:98)
      at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
      at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
      at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
      at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
      at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:196)
      at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)

      java.lang.reflect.InvocationTargetException
      at com.google.appengine.runtime.Request.process-d3177901ba10f473(Request.java)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:170)
      at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:98)
      at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
      at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
      at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
      at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
      at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:196)
      at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Dan Haywood
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: