← Back to team overview

dhis2-devs team mailing list archive

Re: Creating options and optionsets via api

 

Hi Morten,

We are facing the same error when loading /api/metaData.json when there are
program stages in DHIS. We were able to resolve this by adding the
foreign-key attribute for the programStages list in Program.hbm.xml

<list name="programStages">
      <key column="programid" *foreign-key="fk_programstage_program"* />
      <list-index column="sort_order" base="1" />
      <one-to-many class="org.hisp.dhis.program.ProgramStage" />
</list>

Do let us know if you are ok with this fix.

Work on our next release for MSF is using DHIS trunk. It would be great if
you could let us know when you have committed this change to DHIS trunk

Regards,
Simanta


On Thu, Sep 25, 2014 at 2:04 PM, Mahendra Kariya <
mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:

> Thanks Morten. Its working in rev 16809.  :)
>
> But we are facing another issue. The program stage screen is not coming up
> on DHIS. The program type is "Single Event Without Registration".
>
> We are posting the following payload to create the program stage. (We are
> posting sortOrder along with the program stage.)
>
> {
>   "programStages": [
>     {
> *      "sortOrder": 1,*
>       "id": "ab17f8e7729",
>       "name": "Some Program Stage",
>       "description": "Some Program Stage",
>       "programStageDataElements": [
>         {
>           "displayInReports": true,
>           "dataElement": {
>             "id": "a4e69b09a1a",
>             "name": "Date"
>           },
>           "allowProvidedElsewhere": false,
>           "compulsory": false,
>           "allowDateInFuture": false
>         }
>       ],
>       "program": {
>         "id": "a625b2495e7",
>         "name": "Some Program"
>       }
>     }
>   ]
> }
>
>
>
> Here  are the DHIS logs when we try to open program stage screen.
>
> * ERROR 2014-09-25 14:01:34,269 Exception rendering
> #parse(/dhis-web-maintenance-program/programStage.vm) at /main.vm[line 152,
> column 9] (Log4JLogChute.java [qtp166867992-134])
> * ERROR 2014-09-25 14:01:34,269 Unable to render Velocity Template,
> '/main.vm' (CommonsLogger.java [qtp166867992-134])
> org.hibernate.HibernateException: null index column for collection:
> org.hisp.dhis.program.Program.programStages
> at
> org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:818)
> at
> org.hibernate.collection.internal.PersistentList.readFrom(PersistentList.java:402)
> at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1312)
> at org.hibernate.loader.Loader.readCollectionElements(Loader.java:872)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:723)
> at org.hibernate.loader.Loader.processResultSet(Loader.java:940)
> at org.hibernate.loader.Loader.doQuery(Loader.java:910)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311)
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2228)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
> at
> org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
> at
> org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:80)
> at
> org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1848)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124)
> at
> org.hibernate.collection.internal.PersistentList.iterator(PersistentList.java:138)
> at
> org.apache.velocity.util.introspection.UberspectImpl.getIterator(UberspectImpl.java:116)
> at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:327)
> at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
> at
> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at
> org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at org.apache.velocity.Template.merge(Template.java:356)
> at org.apache.velocity.Template.merge(Template.java:260)
> at
> org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:156)
> at
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalUserInterceptor.intercept(XWorkPortalUserInterceptor.java:88)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalModuleInterceptor.intercept(XWorkPortalModuleInterceptor.java:89)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalMenuInterceptor.intercept(XWorkPortalMenuInterceptor.java:97)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalParamsInterceptor.intercept(XWorkPortalParamsInterceptor.java:147)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.ContextInterceptor.intercept(ContextInterceptor.java:83)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.UserSettingInterceptor.intercept(UserSettingInterceptor.java:81)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.security.intercept.LoginInterceptor.intercept(LoginInterceptor.java:85)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.security.intercept.XWorkSecurityInterceptor.intercept(XWorkSecurityInterceptor.java:113)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.SystemSettingInterceptor.intercept(SystemSettingInterceptor.java:127)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:136)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:110)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
> at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
> at
> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
> at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
> at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> at org.eclipse.jetty.server.Server.handle(Server.java:485)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:290)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
> at
> org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:606)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:535)
> at java.lang.Thread.run(Thread.java:724)
> * ERROR 2014-09-25 14:01:34,272 Error while executing action
> (ExceptionInterceptor.java [qtp166867992-134])
> org.hibernate.HibernateException: null index column for collection:
> org.hisp.dhis.program.Program.programStages
> at
> org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:818)
> at
> org.hibernate.collection.internal.PersistentList.readFrom(PersistentList.java:402)
> at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1312)
> at org.hibernate.loader.Loader.readCollectionElements(Loader.java:872)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:723)
> at org.hibernate.loader.Loader.processResultSet(Loader.java:940)
> at org.hibernate.loader.Loader.doQuery(Loader.java:910)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311)
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2228)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
> at
> org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
> at
> org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:80)
> at
> org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1848)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
> at
> org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124)
> at
> org.hibernate.collection.internal.PersistentList.iterator(PersistentList.java:138)
> at
> org.apache.velocity.util.introspection.UberspectImpl.getIterator(UberspectImpl.java:116)
> at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:327)
> at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
> at
> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at
> org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
> at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
> at org.apache.velocity.Template.merge(Template.java:356)
> at org.apache.velocity.Template.merge(Template.java:260)
> at
> org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:156)
> at
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalUserInterceptor.intercept(XWorkPortalUserInterceptor.java:88)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalModuleInterceptor.intercept(XWorkPortalModuleInterceptor.java:89)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalMenuInterceptor.intercept(XWorkPortalMenuInterceptor.java:97)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalParamsInterceptor.intercept(XWorkPortalParamsInterceptor.java:147)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.ContextInterceptor.intercept(ContextInterceptor.java:83)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.UserSettingInterceptor.intercept(UserSettingInterceptor.java:81)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.security.intercept.LoginInterceptor.intercept(LoginInterceptor.java:85)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.security.intercept.XWorkSecurityInterceptor.intercept(XWorkSecurityInterceptor.java:113)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.SystemSettingInterceptor.intercept(SystemSettingInterceptor.java:127)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:136)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.hisp.dhis.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:110)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
> at
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
> at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
> at
> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
> at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
> at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> at org.eclipse.jetty.server.Server.handle(Server.java:485)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:290)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
> at
> org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:606)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:535)
> at java.lang.Thread.run(Thread.java:724)
> * WARN  2014-09-25 14:01:34,275 HHH000100: Fail-safe cleanup (collections)
> : org.hibernate.engine.loading.internal.CollectionLoadContext@4edd79d4
> <rs=com.mchange.v2.c3p0.impl.NewProxyResultSet@303dc1f4>
> (LoadContexts.java [qtp166867992-134])
> * WARN  2014-09-25 14:01:34,275 HHH000160: On
> CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1]
> entries (CollectionLoadContext.java [qtp166867992-134])
>
>
>
>
>
> On Thu, Sep 25, 2014 at 12:59 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
> wrote:
>
>> It should be there in rev 16809. Not really sure why it went away, but
>> should be back now.
>>
>> --
>> Morten
>>
>> On Thu, Sep 25, 2014 at 12:26 PM, Mahendra Kariya <
>> mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:
>>
>>> Thanks Jason. We will also refer to the dev guide.
>>>
>>> Hi Morten,
>>>
>>> We tried to create options using the api but were not able to. (We are
>>> on r 16808 of trunk).
>>> We posted the following payload to /api/metadata
>>>
>>> {
>>>   "options": [
>>>     {
>>>       "code": "ab2d9bcef33",
>>>       "id": "ab2d9bcef33",
>>>       "name": "Dressings"
>>>     }
>>>   ]
>>> }
>>>
>>>
>>> The response from DHIS is as follows.
>>> {
>>>     "importCount": {
>>>         "imported": 0,
>>>         "updated": 0,
>>>         "ignored": 0,
>>>         "deleted": 0
>>>     }
>>> }
>>>
>>>
>>> DHIS logs are as below.
>>>
>>> * INFO  2014-09-25 10:50:07,220 User 'admin' started import at Thu Sep
>>> 25 10:50:07 IST 2014 (DefaultImportService.java [qtp461220547-20])
>>> * INFO  2014-09-25 10:50:07,220 Building object-bridge maps
>>> (preheatCache: true). (DefaultObjectBridge.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,223 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,223 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,223 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,224 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,468 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,468 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,469 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,469 No IdentifiableObjectStore found for
>>> class: class org.hisp.dhis.user.UserCredentials
>>> (DefaultIdentifiableObjectManager.java [qtp461220547-20])
>>> * INFO  2014-09-25 10:50:07,469 Building object-bridge maps took 0.25
>>> seconds. (DefaultObjectBridge.java [qtp461220547-20])
>>> * INFO  2014-09-25 10:50:07,470 Importing 1 Options
>>> (DefaultImportService.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,470 Importer for object of type Option not
>>> found. (DefaultImportService.java [qtp461220547-20])
>>> * WARN  2014-09-25 10:50:07,471 Can not find getter for
>>> 'userCredentials'. (DefaultImportService.java [qtp461220547-20])
>>> * INFO  2014-09-25 10:50:07,472 Import done. Completed in 0.25 seconds.
>>> (DefaultImportService.java [qtp461220547-20])
>>>
>>>
>>>
>>>
>>> On Thu, Sep 25, 2014 at 10:31 AM, Jason Pickering <
>>> jason.p.pickering@xxxxxxxxx> wrote:
>>>
>>>> Also please note, we are moving all of the "dev" stuff to a new
>>>> Developer Guide (
>>>> https://www.dhis2.org/doc/snapshot/en/developer/html/dhis2_developer_manual.html)
>>>> where we hope to be able to offer more up to date and more technical
>>>> information in the near future.
>>>>
>>>> Regards,
>>>> Jason
>>>>
>>>>
>>>> On Thu, Sep 25, 2014 at 6:05 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx
>>>> > wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> As with most of our current metadata, this process is not documented.
>>>>> It does however follow the normal flow of all our metadata, which means
>>>>> that objects that are based on UID most be referenced, instead of directly
>>>>> contained.
>>>>>
>>>>> A sample payload would be something like this:
>>>>>
>>>>> {
>>>>>   "options": [
>>>>>     { "name": "Option 1", "code": "option_1" },
>>>>>     { "name": "Option 2", "code": "option_2" },
>>>>>     { "name": "Option 3", "code": "option_3" }
>>>>>   ],
>>>>>   "optionSets": [
>>>>>     { "name": "Options", "options": [ { ... here you must match either
>>>>> on id or code ... }]
>>>>>   ]
>>>>> }
>>>>>
>>>>> Remember that if you want to create it all in one go, and don't have
>>>>> the ID, you can set matching strategy to code.
>>>>>
>>>>> If you want to get a larger sample, you can have a look at the output
>>>>> from this (admin / district):
>>>>>
>>>>> https://apps.dhis2.org/dev/api/metadata.json?assumeTrue=false&options=true&optionSets=true
>>>>>
>>>>> The way options/optionSets have changed in 2.17 to allow for them to
>>>>> be translated as our other metadata.
>>>>>
>>>>> --
>>>>> Morten
>>>>>
>>>>> On Thu, Sep 25, 2014 at 12:15 AM, Mahendra Kariya <
>>>>> mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Could you please point us to the documentation for the API to create
>>>>>> options and option sets?
>>>>>> We tried searching the user manual
>>>>>> <https://www.dhis2.org/doc/snapshot/en/user/html/ch31.html>, but
>>>>>> couldn't find anything.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Mahendra
>>>>>> *Thought*Works
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jason P. Pickering
>>>> email: jason.p.pickering@xxxxxxxxx
>>>> tel:+46764147049
>>>>
>>>
>>>
>>
>

References