Not able to view Process Instance after upgrading to 6.9.2 from 6.7.13

Getting following exception while trying to load Process Instance Edit view from admin user:

com.haulmont.cuba.core.global.DevelopmentException: 'class' attribute is not set for the datasource
	at com.haulmont.cuba.gui.xml.data.DsContextLoader.loadCollectionDatasource(DsContextLoader.java:373)
	at com.haulmont.cuba.gui.xml.data.DsContextLoader.loadDatasources(DsContextLoader.java:102)
	at com.haulmont.cuba.gui.xml.layout.loaders.FrameLoader.loadComponent(FrameLoader.java:155)
	at com.haulmont.cuba.gui.xml.layout.loaders.FrameComponentLoader.loadComponent(FrameComponentLoader.java:122)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:89)
	at com.haulmont.cuba.gui.xml.layout.loaders.GroupBoxLayoutLoader.loadComponent(GroupBoxLayoutLoader.java:62)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:89)
	at com.haulmont.cuba.gui.xml.layout.loaders.AbstractBoxLoader.loadComponent(AbstractBoxLoader.java:46)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
	at com.haulmont.cuba.gui.xml.layout.loaders.ScrollBoxLayoutLoader.loadComponent(ScrollBoxLayoutLoader.java:93)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
	at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:89)
	at com.haulmont.cuba.gui.xml.layout.loaders.WindowLoader.loadComponent(WindowLoader.java:80)
	at com.haulmont.cuba.gui.WindowManager.createWindow(WindowManager.java:575)
	at com.haulmont.cuba.gui.WindowManager.openEditor(WindowManager.java:874)
	at com.haulmont.cuba.web.WebWindowManager.openEditor(WebWindowManager.java:178)
	at com.haulmont.cuba.gui.components.WindowDelegate.openEditor(WindowDelegate.java:258)
	at com.haulmont.cuba.web.gui.WebWindow.openEditor(WebWindow.java:487)
	at com.haulmont.cuba.gui.components.actions.EditAction.internalOpenEditor(EditAction.java:274)
	at com.haulmont.cuba.gui.components.actions.EditAction.actionPerform(EditAction.java:223)
	at com.haulmont.cuba.web.gui.components.WebButton.performAction(WebButton.java:45)
	at com.haulmont.cuba.web.gui.components.WebButton.lambda$new$61446b05$1(WebButton.java:37)
	at sun.reflect.GeneratedMethodAccessor473.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:200)
	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:163)
	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1037)
	at com.vaadin.ui.Button.fireClick(Button.java:377)
	at com.haulmont.cuba.web.toolkit.ui.CubaButton.fireClick(CubaButton.java:54)
	at com.vaadin.ui.Button$1.click(Button.java:54)
	at sun.reflect.GeneratedMethodAccessor472.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:119)
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:444)
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:409)
	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361)
	at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:312)
	at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:203)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
	at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)

Thanks,
Shashank

I couldn’t reproduce the problem. Can you please provide a sequence of steps to reproduce it?

Thanks for the support.

I cant tell exact reproducible steps for sure. We already have an up and running cuba setup on version 6.7.13 with all premium addons enabled.

On my development machine, I just changed version from 6.7.13 to 6.9.2, did gradle assemble, gradle updateDb, gradle restart and I faced this.

Let me try and reproduce this on a sample project which I can share.

Shashank

Even I am not able to reproduce it on fresh or upgraded project for sample. Not sure whats special in my production project.

I am however able to debug cuba and bpm sources on my local. After debugging, I could find that it is failing while trying to find metaClass for ‘procAttachmentsDs’ which is defined in ‘proc-instance-edit.xml’. But I can’t tell how behaviour differs for different projects.

Let me know if you want me to debug some particular section or anything that might help you.

Thanks for support

Check that there are no different versions of cuba related jar files in your tomcat (e.g. bpm-global-6.9.2.jar and bpm-global-6.7.13.jar, etc.). Or even better try to drop the tomcat and then execute the “clean setupTomcat assemble deploy start” tasks again

Thanks for the suggestions, but I already tried this.

Even deleted my source code folder, cloned fresh and then assembled, deployed, started but to no help.

Did you extend any of the platform screens?

Thanks for pointing me in right direction. Indeed I checked code and found following frame extended which caused the issue.

Our project was extending com/haulmont/bpm/gui/procattachment/proc-attachments-frame.xml (to show task name for which attachment was uploaded) in the Process Instance Edit screen which had following datasource defined:

<collectionDatasource id="procAttachmentsDs"
                          view="procAttachment-browse">
        <query>
            <![CDATA[select e from bpm$ProcAttachment e                
        ]]>
            <filter>
                <and>
                    <c>e.procInstance.id = :custom$procInstance</c>
                    <c>e.procTask.id = :custom$procTask</c>
                    <c>e.procInstance.id = :custom$procInstance</c>
                    <c>e.procTask.id = :custom$procTask</c>
                </and>
            </filter>
        </query>
    </collectionDatasource>

Once I added entity type to above from Studio issue got resolved. Still wondering how it was working before.

Thanks again for the superb help and sorry for our ignorance. This can be marked as resolved now.

Shashank