CMDBuild Forum

Error after Update Shark 2.4

Hi everyone,

after updating cmdbuild to version 2.4, the main application works like a charm.

But after updating shark to 2.4. i get an error when i "advance" workflows.

Does anyone get similar errors or better knows a solution for fixing it?

Best regards,

Andy

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: org.cmdbuild.workflow.CMWorkflowException: org.enhydra.shark.api.internal.eventaudit.EventAuditException: Could not send Message.
	at org.cmdbuild.workflow.service.AbstractSharkService.startProcess(AbstractSharkService.java:260)
	at org.cmdbuild.workflow.service.TransactedSharkService.access$501(TransactedSharkService.java:16)
	at org.cmdbuild.workflow.service.TransactedSharkService$5.command(TransactedSharkService.java:141)
	at org.cmdbuild.workflow.service.TransactedSharkService$5.command(TransactedSharkService.java:138)
	at org.cmdbuild.workflow.service.TransactedSharkService$TransactedExecutor.execute(TransactedSharkService.java:24)
	at org.cmdbuild.workflow.service.TransactedSharkService.startProcess(TransactedSharkService.java:143)
	at org.cmdbuild.workflow.service.AbstractSharkService.startProcess(AbstractSharkService.java:243)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:211)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.enhydra.shark.api.internal.eventaudit.EventAuditException: Could not send Message.
	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at org.enhydra.shark.ejb.client.ws.WAPIEJBEndpointPortSoapBindingStub.startProcess(Unknown Source)
	at org.cmdbuild.workflow.service.AbstractSharkService.startProcess(AbstractSharkService.java:255)
	... 57 more

Some of the processes are working in 2.4. In Version 2.3 every of my processes is working fine.

Looks like there is an internal bug which causes an SQL Exception:

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
	at org.cmdbuild.services.event.ObservableDataView$ObservableNewCardDefinition.save(ObservableDataView.java:40)
	at org.cmdbuild.workflow.WorkflowUpdateHelper.save(WorkflowUpdateHelper.java:217)
	at org.cmdbuild.workflow.DataViewWorkflowPersistence.createProcessInstance(DataViewWorkflowPersistence.java:297)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:216)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.services.event.DefaultObserverCollector$1.invoke(DefaultObserverCollector.java:62)
	... 55 more
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ 

SELECT DISTINCT ON ("_PR_LeavingEmployee_Id")
“PR_LeavingEmployee#State”.“Description” AS “PR_LeavingEmployee#State#Description”, “PR_LeavingEmployee#Employee_Update”.“Description” AS “PR_LeavingEmployee#Employee_Update#Description”, “PR_LeavingEmployee#TicketWorkflow”.“Description” AS “PR_LeavingEmployee#TicketWorkflow#Description”, “PR_LeavingEmployee#ExistingTicket”.“Description” AS “PR_LeavingEmployee#ExistingTicket#Description”, “PR_LeavingEmployee#Employee”.“Description” AS “PR_LeavingEmployee#Employee#Description”, “PR_LeavingEmployee”.“Notes” AS “PR_LeavingEmployee#Notes”, “PR_LeavingEmployee”.“Code” AS “PR_LeavingEmployee#Code”, “PR_LeavingEmployee”.“FlowStatus” AS “PR_LeavingEmployee#FlowStatus”, “PR_LeavingEmployee”.“State” AS “PR_LeavingEmployee#State”, “PR_LeavingEmployee”.“Description” AS “PR_LeavingEmployee#Description”, “PR_LeavingEmployee”.“Error” AS “PR_LeavingEmployee#Error”, “PR_LeavingEmployee”.“RequestDate” AS “PR_LeavingEmployee#RequestDate”, “PR_LeavingEmployee”.“RequestNr” AS “PR_LeavingEmployee#RequestNr”, “PR_LeavingEmployee”.“LeavingDate” AS “PR_LeavingEmployee#LeavingDate”, “PR_LeavingEmployee”.“Prompt” AS “PR_LeavingEmployee#Prompt”, “PR_LeavingEmployee”.“ExistingTicket” AS “PR_LeavingEmployee#ExistingTicket”, “PR_LeavingEmployee”.“Employee” AS “PR_LeavingEmployee#Employee”, “PR_LeavingEmployee”.“CallId” AS “PR_LeavingEmployee#CallId”, “PR_LeavingEmployee”.“Link” AS “PR_LeavingEmployee#Link”, “PR_LeavingEmployee”.“Employee_Update” AS “PR_LeavingEmployee#Employee_Update”, “PR_LeavingEmployee”.“Meldung” AS “PR_LeavingEmployee#Meldung”, “PR_LeavingEmployee”.“PNR” AS “PR_LeavingEmployee#PNR”, “PR_LeavingEmployee”.“TicketWorkflow” AS “PR_LeavingEmployee#TicketWorkflow”, “PR_LeavingEmployee”.“CreationTime” AS “PR_LeavingEmployee#CreationTime”, “PR_LeavingEmployee”.“CloseTime” AS “PR_LeavingEmployee#CloseTime”, “PR_LeavingEmployee”.“ATZ” AS “PR_LeavingEmployee#ATZ”, “PR_LeavingEmployee”.“ActivityDefinitionId” AS “PR_LeavingEmployee#ActivityDefinitionId”, “PR_LeavingEmployee”.“ProcessCode” AS “PR_LeavingEmployee#ProcessCode”, “PR_LeavingEmployee”.“NextExecutor” AS “PR_LeavingEmployee#NextExecutor”, “PR_LeavingEmployee”.“ActivityInstanceId” AS “PR_LeavingEmployee#ActivityInstanceId”, “PR_LeavingEmployee”.“PrevExecutors” AS “PR_LeavingEmployee#PrevExecutors”, “PR_LeavingEmployee”.“UniqueProcessDefinition” AS “PR_LeavingEmployee#UniqueProcessDefinition”, “PR_LeavingEmployee”.“IdClass”::oid AS “_PR_LeavingEmployee_IdClass”, “PR_LeavingEmployee”.“Id” AS “_PR_LeavingEmployee_Id”, “PR_LeavingEmployee”.“User” AS “_PR_LeavingEmployee_User”, “PR_LeavingEmployee”.“BeginDate” AS "PR_LeavingEmployee_BeginDate"
FROM “PR_LeavingEmployee” AS “PR_LeavingEmployee”
LEFT JOIN “Employee” AS “PR_LeavingEmployee#Employee” ON “PR_LeavingEmployee#Employee”.“Id” = “PR_LeavingEmployee”.“Employee”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#Employee_Update” ON “PR_LeavingEmployee#Employee_Update”.“Id” = “PR_LeavingEmployee”.“Employee_Update”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#State” ON “PR_LeavingEmployee#State”.“Id” = “PR_LeavingEmployee”.“State”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#TicketWorkflow” ON “PR_LeavingEmployee#TicketWorkflow”.“Id” = “PR_LeavingEmployee”.“TicketWorkflow”
LEFT JOIN “Ticket” AS “PR_LeavingEmployee#ExistingTicket” ON “PR_LeavingEmployee#ExistingTicket”.“Id” = “PR_LeavingEmployee”.“ExistingTicket”
WHERE ( “PR_LeavingEmployee”.“State” = ? AND “PR_LeavingEmployee”.“Id” = ? ) AND “PR_LeavingEmployee”.“Status” = ?
ORDER BY “PR_LeavingEmployee#Description” ASC, "PR_LeavingEmployee_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:747)
at org.cmdbuild.dao.driver.postgres.EntryQueryCommand.run(EntryQueryCommand.java:72)
at org.cmdbuild.dao.driver.postgres.PostgresDriver.query(PostgresDriver.java:194)
at org.cmdbuild.dao.view.DBDataView.executeQuery(DBDataView.java:416)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.services.localization.LocalizedDataView.executeQuery(LocalizedDataView.java:208)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.dao.view.user.UserDataView.executeQuery(UserDataView.java:181)
at org.cmdbuild.dao.view.user.UserQuerySpecsBuilder.run(UserQuerySpecsBuilder.java:149)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesFilter(DefaultObserverFactory.java:174)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesCards(DefaultObserverFactory.java:159)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:138)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:81)
at org.cmdbuild.services.event.FilteredObserver$Builder$1.invoke(FilteredObserver.java:70)
at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
… 79 more


 

Dear Andreas,
 
would you be so kind to provide us the configuration of the Synchronous Event Task that executes the query that generates the error?
 
Best regards.
 
-- CMDBuild Team

Previously Andreas wrote:

Some of the processes are working in 2.4. In Version 2.3 every of my processes is working fine.

Looks like there is an internal bug which causes an SQL Exception:

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
	at org.cmdbuild.services.event.ObservableDataView$ObservableNewCardDefinition.save(ObservableDataView.java:40)
	at org.cmdbuild.workflow.WorkflowUpdateHelper.save(WorkflowUpdateHelper.java:217)
	at org.cmdbuild.workflow.DataViewWorkflowPersistence.createProcessInstance(DataViewWorkflowPersistence.java:297)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:216)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.services.event.DefaultObserverCollector$1.invoke(DefaultObserverCollector.java:62)
	... 55 more
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ 

SELECT DISTINCT ON ("_PR_LeavingEmployee_Id")
“PR_LeavingEmployee#State”.“Description” AS “PR_LeavingEmployee#State#Description”, “PR_LeavingEmployee#Employee_Update”.“Description” AS “PR_LeavingEmployee#Employee_Update#Description”, “PR_LeavingEmployee#TicketWorkflow”.“Description” AS “PR_LeavingEmployee#TicketWorkflow#Description”, “PR_LeavingEmployee#ExistingTicket”.“Description” AS “PR_LeavingEmployee#ExistingTicket#Description”, “PR_LeavingEmployee#Employee”.“Description” AS “PR_LeavingEmployee#Employee#Description”, “PR_LeavingEmployee”.“Notes” AS “PR_LeavingEmployee#Notes”, “PR_LeavingEmployee”.“Code” AS “PR_LeavingEmployee#Code”, “PR_LeavingEmployee”.“FlowStatus” AS “PR_LeavingEmployee#FlowStatus”, “PR_LeavingEmployee”.“State” AS “PR_LeavingEmployee#State”, “PR_LeavingEmployee”.“Description” AS “PR_LeavingEmployee#Description”, “PR_LeavingEmployee”.“Error” AS “PR_LeavingEmployee#Error”, “PR_LeavingEmployee”.“RequestDate” AS “PR_LeavingEmployee#RequestDate”, “PR_LeavingEmployee”.“RequestNr” AS “PR_LeavingEmployee#RequestNr”, “PR_LeavingEmployee”.“LeavingDate” AS “PR_LeavingEmployee#LeavingDate”, “PR_LeavingEmployee”.“Prompt” AS “PR_LeavingEmployee#Prompt”, “PR_LeavingEmployee”.“ExistingTicket” AS “PR_LeavingEmployee#ExistingTicket”, “PR_LeavingEmployee”.“Employee” AS “PR_LeavingEmployee#Employee”, “PR_LeavingEmployee”.“CallId” AS “PR_LeavingEmployee#CallId”, “PR_LeavingEmployee”.“Link” AS “PR_LeavingEmployee#Link”, “PR_LeavingEmployee”.“Employee_Update” AS “PR_LeavingEmployee#Employee_Update”, “PR_LeavingEmployee”.“Meldung” AS “PR_LeavingEmployee#Meldung”, “PR_LeavingEmployee”.“PNR” AS “PR_LeavingEmployee#PNR”, “PR_LeavingEmployee”.“TicketWorkflow” AS “PR_LeavingEmployee#TicketWorkflow”, “PR_LeavingEmployee”.“CreationTime” AS “PR_LeavingEmployee#CreationTime”, “PR_LeavingEmployee”.“CloseTime” AS “PR_LeavingEmployee#CloseTime”, “PR_LeavingEmployee”.“ATZ” AS “PR_LeavingEmployee#ATZ”, “PR_LeavingEmployee”.“ActivityDefinitionId” AS “PR_LeavingEmployee#ActivityDefinitionId”, “PR_LeavingEmployee”.“ProcessCode” AS “PR_LeavingEmployee#ProcessCode”, “PR_LeavingEmployee”.“NextExecutor” AS “PR_LeavingEmployee#NextExecutor”, “PR_LeavingEmployee”.“ActivityInstanceId” AS “PR_LeavingEmployee#ActivityInstanceId”, “PR_LeavingEmployee”.“PrevExecutors” AS “PR_LeavingEmployee#PrevExecutors”, “PR_LeavingEmployee”.“UniqueProcessDefinition” AS “PR_LeavingEmployee#UniqueProcessDefinition”, “PR_LeavingEmployee”.“IdClass”::oid AS “_PR_LeavingEmployee_IdClass”, “PR_LeavingEmployee”.“Id” AS “_PR_LeavingEmployee_Id”, “PR_LeavingEmployee”.“User” AS “_PR_LeavingEmployee_User”, “PR_LeavingEmployee”.“BeginDate” AS "PR_LeavingEmployee_BeginDate"
FROM “PR_LeavingEmployee” AS “PR_LeavingEmployee”
LEFT JOIN “Employee” AS “PR_LeavingEmployee#Employee” ON “PR_LeavingEmployee#Employee”.“Id” = “PR_LeavingEmployee”.“Employee”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#Employee_Update” ON “PR_LeavingEmployee#Employee_Update”.“Id” = “PR_LeavingEmployee”.“Employee_Update”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#State” ON “PR_LeavingEmployee#State”.“Id” = “PR_LeavingEmployee”.“State”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#TicketWorkflow” ON “PR_LeavingEmployee#TicketWorkflow”.“Id” = “PR_LeavingEmployee”.“TicketWorkflow”
LEFT JOIN “Ticket” AS “PR_LeavingEmployee#ExistingTicket” ON “PR_LeavingEmployee#ExistingTicket”.“Id” = “PR_LeavingEmployee”.“ExistingTicket”
WHERE ( “PR_LeavingEmployee”.“State” = ? AND “PR_LeavingEmployee”.“Id” = ? ) AND “PR_LeavingEmployee”.“Status” = ?
ORDER BY “PR_LeavingEmployee#Description” ASC, "PR_LeavingEmployee_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:747)
at org.cmdbuild.dao.driver.postgres.EntryQueryCommand.run(EntryQueryCommand.java:72)
at org.cmdbuild.dao.driver.postgres.PostgresDriver.query(PostgresDriver.java:194)
at org.cmdbuild.dao.view.DBDataView.executeQuery(DBDataView.java:416)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.services.localization.LocalizedDataView.executeQuery(LocalizedDataView.java:208)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.dao.view.user.UserDataView.executeQuery(UserDataView.java:181)
at org.cmdbuild.dao.view.user.UserQuerySpecsBuilder.run(UserQuerySpecsBuilder.java:149)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesFilter(DefaultObserverFactory.java:174)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesCards(DefaultObserverFactory.java:159)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:138)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:81)
at org.cmdbuild.services.event.FilteredObserver$Builder$1.invoke(FilteredObserver.java:70)
at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
… 79 more


 

 

Hi,

 

i have no Synchronous Event Tasks activated.

I get the error even i go to setup-->server management-->service synchronization

Previously Tecnoteca wrote:
Dear Andreas,
 
would you be so kind to provide us the configuration of the Synchronous Event Task that executes the query that generates the error?
 
Best regards.
 
-- CMDBuild Team

Previously Andreas wrote:

Some of the processes are working in 2.4. In Version 2.3 every of my processes is working fine.

Looks like there is an internal bug which causes an SQL Exception:

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
	at org.cmdbuild.services.event.ObservableDataView$ObservableNewCardDefinition.save(ObservableDataView.java:40)
	at org.cmdbuild.workflow.WorkflowUpdateHelper.save(WorkflowUpdateHelper.java:217)
	at org.cmdbuild.workflow.DataViewWorkflowPersistence.createProcessInstance(DataViewWorkflowPersistence.java:297)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:216)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.services.event.DefaultObserverCollector$1.invoke(DefaultObserverCollector.java:62)
	... 55 more
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ 

SELECT DISTINCT ON ("_PR_LeavingEmployee_Id")
“PR_LeavingEmployee#State”.“Description” AS “PR_LeavingEmployee#State#Description”, “PR_LeavingEmployee#Employee_Update”.“Description” AS “PR_LeavingEmployee#Employee_Update#Description”, “PR_LeavingEmployee#TicketWorkflow”.“Description” AS “PR_LeavingEmployee#TicketWorkflow#Description”, “PR_LeavingEmployee#ExistingTicket”.“Description” AS “PR_LeavingEmployee#ExistingTicket#Description”, “PR_LeavingEmployee#Employee”.“Description” AS “PR_LeavingEmployee#Employee#Description”, “PR_LeavingEmployee”.“Notes” AS “PR_LeavingEmployee#Notes”, “PR_LeavingEmployee”.“Code” AS “PR_LeavingEmployee#Code”, “PR_LeavingEmployee”.“FlowStatus” AS “PR_LeavingEmployee#FlowStatus”, “PR_LeavingEmployee”.“State” AS “PR_LeavingEmployee#State”, “PR_LeavingEmployee”.“Description” AS “PR_LeavingEmployee#Description”, “PR_LeavingEmployee”.“Error” AS “PR_LeavingEmployee#Error”, “PR_LeavingEmployee”.“RequestDate” AS “PR_LeavingEmployee#RequestDate”, “PR_LeavingEmployee”.“RequestNr” AS “PR_LeavingEmployee#RequestNr”, “PR_LeavingEmployee”.“LeavingDate” AS “PR_LeavingEmployee#LeavingDate”, “PR_LeavingEmployee”.“Prompt” AS “PR_LeavingEmployee#Prompt”, “PR_LeavingEmployee”.“ExistingTicket” AS “PR_LeavingEmployee#ExistingTicket”, “PR_LeavingEmployee”.“Employee” AS “PR_LeavingEmployee#Employee”, “PR_LeavingEmployee”.“CallId” AS “PR_LeavingEmployee#CallId”, “PR_LeavingEmployee”.“Link” AS “PR_LeavingEmployee#Link”, “PR_LeavingEmployee”.“Employee_Update” AS “PR_LeavingEmployee#Employee_Update”, “PR_LeavingEmployee”.“Meldung” AS “PR_LeavingEmployee#Meldung”, “PR_LeavingEmployee”.“PNR” AS “PR_LeavingEmployee#PNR”, “PR_LeavingEmployee”.“TicketWorkflow” AS “PR_LeavingEmployee#TicketWorkflow”, “PR_LeavingEmployee”.“CreationTime” AS “PR_LeavingEmployee#CreationTime”, “PR_LeavingEmployee”.“CloseTime” AS “PR_LeavingEmployee#CloseTime”, “PR_LeavingEmployee”.“ATZ” AS “PR_LeavingEmployee#ATZ”, “PR_LeavingEmployee”.“ActivityDefinitionId” AS “PR_LeavingEmployee#ActivityDefinitionId”, “PR_LeavingEmployee”.“ProcessCode” AS “PR_LeavingEmployee#ProcessCode”, “PR_LeavingEmployee”.“NextExecutor” AS “PR_LeavingEmployee#NextExecutor”, “PR_LeavingEmployee”.“ActivityInstanceId” AS “PR_LeavingEmployee#ActivityInstanceId”, “PR_LeavingEmployee”.“PrevExecutors” AS “PR_LeavingEmployee#PrevExecutors”, “PR_LeavingEmployee”.“UniqueProcessDefinition” AS “PR_LeavingEmployee#UniqueProcessDefinition”, “PR_LeavingEmployee”.“IdClass”::oid AS “_PR_LeavingEmployee_IdClass”, “PR_LeavingEmployee”.“Id” AS “_PR_LeavingEmployee_Id”, “PR_LeavingEmployee”.“User” AS “_PR_LeavingEmployee_User”, “PR_LeavingEmployee”.“BeginDate” AS "PR_LeavingEmployee_BeginDate"
FROM “PR_LeavingEmployee” AS “PR_LeavingEmployee”
LEFT JOIN “Employee” AS “PR_LeavingEmployee#Employee” ON “PR_LeavingEmployee#Employee”.“Id” = “PR_LeavingEmployee”.“Employee”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#Employee_Update” ON “PR_LeavingEmployee#Employee_Update”.“Id” = “PR_LeavingEmployee”.“Employee_Update”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#State” ON “PR_LeavingEmployee#State”.“Id” = “PR_LeavingEmployee”.“State”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#TicketWorkflow” ON “PR_LeavingEmployee#TicketWorkflow”.“Id” = “PR_LeavingEmployee”.“TicketWorkflow”
LEFT JOIN “Ticket” AS “PR_LeavingEmployee#ExistingTicket” ON “PR_LeavingEmployee#ExistingTicket”.“Id” = “PR_LeavingEmployee”.“ExistingTicket”
WHERE ( “PR_LeavingEmployee”.“State” = ? AND “PR_LeavingEmployee”.“Id” = ? ) AND “PR_LeavingEmployee”.“Status” = ?
ORDER BY “PR_LeavingEmployee#Description” ASC, "PR_LeavingEmployee_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:747)
at org.cmdbuild.dao.driver.postgres.EntryQueryCommand.run(EntryQueryCommand.java:72)
at org.cmdbuild.dao.driver.postgres.PostgresDriver.query(PostgresDriver.java:194)
at org.cmdbuild.dao.view.DBDataView.executeQuery(DBDataView.java:416)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.services.localization.LocalizedDataView.executeQuery(LocalizedDataView.java:208)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.dao.view.user.UserDataView.executeQuery(UserDataView.java:181)
at org.cmdbuild.dao.view.user.UserQuerySpecsBuilder.run(UserQuerySpecsBuilder.java:149)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesFilter(DefaultObserverFactory.java:174)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesCards(DefaultObserverFactory.java:159)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:138)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:81)
at org.cmdbuild.services.event.FilteredObserver$Builder$1.invoke(FilteredObserver.java:70)
at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
… 79 more


 

 

 

Dear Andreas,
 
we asked about Synchronous Events because the last stack trace seems referring to it:
 
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate
 
Are you able to provide us a copy of your database (of course without sensitive data)? Otherwise are you able to create a brand new process so that we can reproduce the issue locally?
 
Best regards.
 
-- CMDBuild Team
 
Previously Andreas wrote:

Hi,

 

i have no Synchronous Event Tasks activated.

I get the error even i go to setup-->server management-->service synchronization

Previously Tecnoteca wrote:
Dear Andreas,
 
would you be so kind to provide us the configuration of the Synchronous Event Task that executes the query that generates the error?
 
Best regards.
 
-- CMDBuild Team

Previously Andreas wrote:

Some of the processes are working in 2.4. In Version 2.3 every of my processes is working fine.

Looks like there is an internal bug which causes an SQL Exception:

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
	at org.cmdbuild.services.event.ObservableDataView$ObservableNewCardDefinition.save(ObservableDataView.java:40)
	at org.cmdbuild.workflow.WorkflowUpdateHelper.save(WorkflowUpdateHelper.java:217)
	at org.cmdbuild.workflow.DataViewWorkflowPersistence.createProcessInstance(DataViewWorkflowPersistence.java:297)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:216)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.services.event.DefaultObserverCollector$1.invoke(DefaultObserverCollector.java:62)
	... 55 more
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ 

SELECT DISTINCT ON ("_PR_LeavingEmployee_Id")
“PR_LeavingEmployee#State”.“Description” AS “PR_LeavingEmployee#State#Description”, “PR_LeavingEmployee#Employee_Update”.“Description” AS “PR_LeavingEmployee#Employee_Update#Description”, “PR_LeavingEmployee#TicketWorkflow”.“Description” AS “PR_LeavingEmployee#TicketWorkflow#Description”, “PR_LeavingEmployee#ExistingTicket”.“Description” AS “PR_LeavingEmployee#ExistingTicket#Description”, “PR_LeavingEmployee#Employee”.“Description” AS “PR_LeavingEmployee#Employee#Description”, “PR_LeavingEmployee”.“Notes” AS “PR_LeavingEmployee#Notes”, “PR_LeavingEmployee”.“Code” AS “PR_LeavingEmployee#Code”, “PR_LeavingEmployee”.“FlowStatus” AS “PR_LeavingEmployee#FlowStatus”, “PR_LeavingEmployee”.“State” AS “PR_LeavingEmployee#State”, “PR_LeavingEmployee”.“Description” AS “PR_LeavingEmployee#Description”, “PR_LeavingEmployee”.“Error” AS “PR_LeavingEmployee#Error”, “PR_LeavingEmployee”.“RequestDate” AS “PR_LeavingEmployee#RequestDate”, “PR_LeavingEmployee”.“RequestNr” AS “PR_LeavingEmployee#RequestNr”, “PR_LeavingEmployee”.“LeavingDate” AS “PR_LeavingEmployee#LeavingDate”, “PR_LeavingEmployee”.“Prompt” AS “PR_LeavingEmployee#Prompt”, “PR_LeavingEmployee”.“ExistingTicket” AS “PR_LeavingEmployee#ExistingTicket”, “PR_LeavingEmployee”.“Employee” AS “PR_LeavingEmployee#Employee”, “PR_LeavingEmployee”.“CallId” AS “PR_LeavingEmployee#CallId”, “PR_LeavingEmployee”.“Link” AS “PR_LeavingEmployee#Link”, “PR_LeavingEmployee”.“Employee_Update” AS “PR_LeavingEmployee#Employee_Update”, “PR_LeavingEmployee”.“Meldung” AS “PR_LeavingEmployee#Meldung”, “PR_LeavingEmployee”.“PNR” AS “PR_LeavingEmployee#PNR”, “PR_LeavingEmployee”.“TicketWorkflow” AS “PR_LeavingEmployee#TicketWorkflow”, “PR_LeavingEmployee”.“CreationTime” AS “PR_LeavingEmployee#CreationTime”, “PR_LeavingEmployee”.“CloseTime” AS “PR_LeavingEmployee#CloseTime”, “PR_LeavingEmployee”.“ATZ” AS “PR_LeavingEmployee#ATZ”, “PR_LeavingEmployee”.“ActivityDefinitionId” AS “PR_LeavingEmployee#ActivityDefinitionId”, “PR_LeavingEmployee”.“ProcessCode” AS “PR_LeavingEmployee#ProcessCode”, “PR_LeavingEmployee”.“NextExecutor” AS “PR_LeavingEmployee#NextExecutor”, “PR_LeavingEmployee”.“ActivityInstanceId” AS “PR_LeavingEmployee#ActivityInstanceId”, “PR_LeavingEmployee”.“PrevExecutors” AS “PR_LeavingEmployee#PrevExecutors”, “PR_LeavingEmployee”.“UniqueProcessDefinition” AS “PR_LeavingEmployee#UniqueProcessDefinition”, “PR_LeavingEmployee”.“IdClass”::oid AS “_PR_LeavingEmployee_IdClass”, “PR_LeavingEmployee”.“Id” AS “_PR_LeavingEmployee_Id”, “PR_LeavingEmployee”.“User” AS “_PR_LeavingEmployee_User”, “PR_LeavingEmployee”.“BeginDate” AS "PR_LeavingEmployee_BeginDate"
FROM “PR_LeavingEmployee” AS “PR_LeavingEmployee”
LEFT JOIN “Employee” AS “PR_LeavingEmployee#Employee” ON “PR_LeavingEmployee#Employee”.“Id” = “PR_LeavingEmployee”.“Employee”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#Employee_Update” ON “PR_LeavingEmployee#Employee_Update”.“Id” = “PR_LeavingEmployee”.“Employee_Update”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#State” ON “PR_LeavingEmployee#State”.“Id” = “PR_LeavingEmployee”.“State”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#TicketWorkflow” ON “PR_LeavingEmployee#TicketWorkflow”.“Id” = “PR_LeavingEmployee”.“TicketWorkflow”
LEFT JOIN “Ticket” AS “PR_LeavingEmployee#ExistingTicket” ON “PR_LeavingEmployee#ExistingTicket”.“Id” = “PR_LeavingEmployee”.“ExistingTicket”
WHERE ( “PR_LeavingEmployee”.“State” = ? AND “PR_LeavingEmployee”.“Id” = ? ) AND “PR_LeavingEmployee”.“Status” = ?
ORDER BY “PR_LeavingEmployee#Description” ASC, "PR_LeavingEmployee_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:747)
at org.cmdbuild.dao.driver.postgres.EntryQueryCommand.run(EntryQueryCommand.java:72)
at org.cmdbuild.dao.driver.postgres.PostgresDriver.query(PostgresDriver.java:194)
at org.cmdbuild.dao.view.DBDataView.executeQuery(DBDataView.java:416)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.services.localization.LocalizedDataView.executeQuery(LocalizedDataView.java:208)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.dao.view.user.UserDataView.executeQuery(UserDataView.java:181)
at org.cmdbuild.dao.view.user.UserQuerySpecsBuilder.run(UserQuerySpecsBuilder.java:149)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesFilter(DefaultObserverFactory.java:174)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesCards(DefaultObserverFactory.java:159)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:138)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:81)
at org.cmdbuild.services.event.FilteredObserver$Builder$1.invoke(FilteredObserver.java:70)
at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
… 79 more


 

 

 

Okay now i solved the problem.

I deleted my deactivated Task in CMDB 2.3.4 and updated again to 2.4.

No everything seems to work :)

The hint with the tasks seemed like to lead me in the right direction.

Thank you!

 

Previously Tecnoteca wrote:
Dear Andreas,
 
we asked about Synchronous Events because the last stack trace seems referring to it:
 
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate
 
Are you able to provide us a copy of your database (of course without sensitive data)? Otherwise are you able to create a brand new process so that we can reproduce the issue locally?
 
Best regards.
 
-- CMDBuild Team
 
Previously Andreas wrote:

Hi,

 

i have no Synchronous Event Tasks activated.

I get the error even i go to setup-->server management-->service synchronization

Previously Tecnoteca wrote:
Dear Andreas,
 
would you be so kind to provide us the configuration of the Synchronous Event Task that executes the query that generates the error?
 
Best regards.
 
-- CMDBuild Team

Previously Andreas wrote:

Some of the processes are working in 2.4. In Version 2.3 every of my processes is working fine.

Looks like there is an internal bug which causes an SQL Exception:

 

Call: services/json/workflow/saveactivity
------------------------------------------
Error: java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
	at org.cmdbuild.services.event.ObservableDataView$ObservableNewCardDefinition.save(ObservableDataView.java:40)
	at org.cmdbuild.workflow.WorkflowUpdateHelper.save(WorkflowUpdateHelper.java:217)
	at org.cmdbuild.workflow.DataViewWorkflowPersistence.createProcessInstance(DataViewWorkflowPersistence.java:297)
	at org.cmdbuild.workflow.DefaultWorkflowEngine.startProcess(DefaultWorkflowEngine.java:216)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:401)
	at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:396)
	at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:208)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:107)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:158)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:48)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:52)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.LocalizationFilter.doFilter(LocalizationFilter.java:127)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.cmdbuild.services.event.DefaultObserverCollector$1.invoke(DefaultObserverCollector.java:62)
	... 55 more
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [ 

SELECT DISTINCT ON ("_PR_LeavingEmployee_Id")
“PR_LeavingEmployee#State”.“Description” AS “PR_LeavingEmployee#State#Description”, “PR_LeavingEmployee#Employee_Update”.“Description” AS “PR_LeavingEmployee#Employee_Update#Description”, “PR_LeavingEmployee#TicketWorkflow”.“Description” AS “PR_LeavingEmployee#TicketWorkflow#Description”, “PR_LeavingEmployee#ExistingTicket”.“Description” AS “PR_LeavingEmployee#ExistingTicket#Description”, “PR_LeavingEmployee#Employee”.“Description” AS “PR_LeavingEmployee#Employee#Description”, “PR_LeavingEmployee”.“Notes” AS “PR_LeavingEmployee#Notes”, “PR_LeavingEmployee”.“Code” AS “PR_LeavingEmployee#Code”, “PR_LeavingEmployee”.“FlowStatus” AS “PR_LeavingEmployee#FlowStatus”, “PR_LeavingEmployee”.“State” AS “PR_LeavingEmployee#State”, “PR_LeavingEmployee”.“Description” AS “PR_LeavingEmployee#Description”, “PR_LeavingEmployee”.“Error” AS “PR_LeavingEmployee#Error”, “PR_LeavingEmployee”.“RequestDate” AS “PR_LeavingEmployee#RequestDate”, “PR_LeavingEmployee”.“RequestNr” AS “PR_LeavingEmployee#RequestNr”, “PR_LeavingEmployee”.“LeavingDate” AS “PR_LeavingEmployee#LeavingDate”, “PR_LeavingEmployee”.“Prompt” AS “PR_LeavingEmployee#Prompt”, “PR_LeavingEmployee”.“ExistingTicket” AS “PR_LeavingEmployee#ExistingTicket”, “PR_LeavingEmployee”.“Employee” AS “PR_LeavingEmployee#Employee”, “PR_LeavingEmployee”.“CallId” AS “PR_LeavingEmployee#CallId”, “PR_LeavingEmployee”.“Link” AS “PR_LeavingEmployee#Link”, “PR_LeavingEmployee”.“Employee_Update” AS “PR_LeavingEmployee#Employee_Update”, “PR_LeavingEmployee”.“Meldung” AS “PR_LeavingEmployee#Meldung”, “PR_LeavingEmployee”.“PNR” AS “PR_LeavingEmployee#PNR”, “PR_LeavingEmployee”.“TicketWorkflow” AS “PR_LeavingEmployee#TicketWorkflow”, “PR_LeavingEmployee”.“CreationTime” AS “PR_LeavingEmployee#CreationTime”, “PR_LeavingEmployee”.“CloseTime” AS “PR_LeavingEmployee#CloseTime”, “PR_LeavingEmployee”.“ATZ” AS “PR_LeavingEmployee#ATZ”, “PR_LeavingEmployee”.“ActivityDefinitionId” AS “PR_LeavingEmployee#ActivityDefinitionId”, “PR_LeavingEmployee”.“ProcessCode” AS “PR_LeavingEmployee#ProcessCode”, “PR_LeavingEmployee”.“NextExecutor” AS “PR_LeavingEmployee#NextExecutor”, “PR_LeavingEmployee”.“ActivityInstanceId” AS “PR_LeavingEmployee#ActivityInstanceId”, “PR_LeavingEmployee”.“PrevExecutors” AS “PR_LeavingEmployee#PrevExecutors”, “PR_LeavingEmployee”.“UniqueProcessDefinition” AS “PR_LeavingEmployee#UniqueProcessDefinition”, “PR_LeavingEmployee”.“IdClass”::oid AS “_PR_LeavingEmployee_IdClass”, “PR_LeavingEmployee”.“Id” AS “_PR_LeavingEmployee_Id”, “PR_LeavingEmployee”.“User” AS “_PR_LeavingEmployee_User”, “PR_LeavingEmployee”.“BeginDate” AS "PR_LeavingEmployee_BeginDate"
FROM “PR_LeavingEmployee” AS “PR_LeavingEmployee”
LEFT JOIN “Employee” AS “PR_LeavingEmployee#Employee” ON “PR_LeavingEmployee#Employee”.“Id” = “PR_LeavingEmployee”.“Employee”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#Employee_Update” ON “PR_LeavingEmployee#Employee_Update”.“Id” = “PR_LeavingEmployee”.“Employee_Update”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#State” ON “PR_LeavingEmployee#State”.“Id” = “PR_LeavingEmployee”.“State”
LEFT JOIN “LookUp” AS “PR_LeavingEmployee#TicketWorkflow” ON “PR_LeavingEmployee#TicketWorkflow”.“Id” = “PR_LeavingEmployee”.“TicketWorkflow”
LEFT JOIN “Ticket” AS “PR_LeavingEmployee#ExistingTicket” ON “PR_LeavingEmployee#ExistingTicket”.“Id” = “PR_LeavingEmployee”.“ExistingTicket”
WHERE ( “PR_LeavingEmployee”.“State” = ? AND “PR_LeavingEmployee”.“Id” = ? ) AND “PR_LeavingEmployee”.“Status” = ?
ORDER BY “PR_LeavingEmployee#Description” ASC, "PR_LeavingEmployee_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:645)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:747)
at org.cmdbuild.dao.driver.postgres.EntryQueryCommand.run(EntryQueryCommand.java:72)
at org.cmdbuild.dao.driver.postgres.PostgresDriver.query(PostgresDriver.java:194)
at org.cmdbuild.dao.view.DBDataView.executeQuery(DBDataView.java:416)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.services.localization.LocalizedDataView.executeQuery(LocalizedDataView.java:208)
at org.cmdbuild.dao.view.ForwardingDataView.executeQuery(ForwardingDataView.java:160)
at org.cmdbuild.dao.view.user.UserDataView.executeQuery(UserDataView.java:181)
at org.cmdbuild.dao.view.user.UserQuerySpecsBuilder.run(UserQuerySpecsBuilder.java:149)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesFilter(DefaultObserverFactory.java:174)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.matchesCards(DefaultObserverFactory.java:159)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:138)
at org.cmdbuild.logic.taskmanager.event.DefaultObserverFactory$SynchronousEventTaskPredicate.apply(DefaultObserverFactory.java:81)
at org.cmdbuild.services.event.FilteredObserver$Builder$1.invoke(FilteredObserver.java:70)
at com.sun.proxy.$Proxy160.afterCreate(Unknown Source)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
at org.cmdbuild.services.event.ForwardingObserver.afterCreate(ForwardingObserver.java:20)
… 59 more
Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Position: 27
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
… 79 more