CMDBuild Forum

Openmaint 2.4.3 - Workorder generator ERROR

Hello, I am getting error when I run the workorder generator proccess. It stays loading and never finish. 

 In the browser console I see 

  " Uncaugth type error: Cannot read property "Id" of null    .... /javascripts/cmdbui../Activity.js:574 "

 

I tried with few programmed activities and it seems to work well, can it be a problem of time out when it generates many activities?

The error also seems to be in the SYS02 activity - Meter-based Wos

 

Any help is appreciated.

Best Regards.

 

**CMDBUILD.LOG**

  INFO  2018-06-11 08:54:43 [workflow] pushing event 'WorkflowEvent[type=UPDATE,processDefinitionId=Process_wogen,processInstanceId=425_Package_wogen_Process_wogen]' for session '359'

ERROR 2018-06-11 08:54:43 [jsonrpc ] A org.cmdbuild.workflow.CMWorkflowException occurred calling method class org.cmdbuild.servlets.json.Workflow.saveActivity: javax.transaction.RollbackException

org.cmdbuild.workflow.CMWorkflowException: javax.transaction.RollbackException

at org.cmdbuild.workflow.service.AbstractSharkService.advanceActivityInstance(AbstractSharkService.java:435)

at org.cmdbuild.workflow.service.TransactedSharkService.access$1301(TransactedSharkService.java:16)

at org.cmdbuild.workflow.service.TransactedSharkService$13.command(TransactedSharkService.java:225)

at org.cmdbuild.workflow.service.TransactedSharkService$13.command(TransactedSharkService.java:222)

at org.cmdbuild.workflow.service.TransactedSharkService$TransactedExecutor.execute(TransactedSharkService.java:24)

at org.cmdbuild.workflow.service.TransactedSharkService.advanceActivityInstance(TransactedSharkService.java:228)

at org.cmdbuild.workflow.DefaultWorkflowEngine.advanceActivity(DefaultWorkflowEngine.java:504)

at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:388)

at org.cmdbuild.logic.workflow.DefaultWorkflowLogic.startProcess(DefaultWorkflowLogic.java:369)

at org.cmdbuild.servlets.json.Workflow.saveActivity(Workflow.java:368)

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:498)

at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:104)

at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:64)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)

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.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:183)

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:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

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:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

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:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

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: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:504)

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:790)

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)

Caused by: javax.transaction.RollbackException

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.changeActivityInstanceState(Unknown Source)

at org.cmdbuild.workflow.service.AbstractSharkService.advanceActivityInstance(AbstractSharkService.java:431)

... 62 more

 
**SHARK.LOG**

2018-06-11 08:54:40,669: activity 'SYS02-MeterBasedWOs' started
2018-06-11 08:54:40,670: Activity[Process Id=425_Package_wogen_Process_wogen, Id=773_425_Package_wogen_Process_wogen_SYS02-MeterBasedWOs, ba=null, ActDefId=SYS02-MeterBasedWOs] - Executing script [type=text/java,value=eval(functionLibrary);
 
activeStatus = cmdb.selectLookupByCode("MaintenanceActivity - Status", "A");
 
activities = cmdb.queryClass("MaintenanceActivity")
.with("ActivityStatus", activeStatus)
.fetch();
 
logger.debug("checking meter-based schedulings");
 
for(activity : activities){
 
schedulings = cmdb.queryClass("PMScheduling")
.with("Activity", activity.getId())
.fetch();
 
for(scheduling : schedulings){
 
logger.debug("checking activity '{}' scheduling '{}'", activity.getId(), scheduling.getId());
 
spResult = cmdb.callFunction("wf_wogen_checkmeter") //
.with("activity", activity.getId()) //
.with("scheduling", scheduling.getId()) //
.execute();
 
itemsId = spResult.get("startwofor");
 
if(StringUtils.isBlank(itemsId)){
logger.debug("no items satisfy condition");
continue;
}
 
logger.debug("it's time to start the wo");
 
workorder = cmdb.newProcessInstance("Workorder")
.with("Team", activity.get("Team"))
.with("ShortDescr", activity.get("Description"))
.with("ScheduledStart", Calendar.getInstance().getTime())
.with("Priority", activity.get("Priority"))
.with("SimplifiedWO", activity.get("SimplifiedWO"))
.with("OpeningNotes", activity.get("Instructions"))
.with("Details", activity.get("Details"))
.with("ServiceCategory", activity.get("ServiceCategory"))
.with("Service", activity.get("Service"))
.with("SendToTeam", true)
.start();
 
for(itemId : itemsId.split(";")){
cmdb.newRelation("WorkorderItem")
.withCard1("Workorder", workorder.getId())
.withCard2("InventoryItem", Integer.valueOf(itemId))
.create();
}
cmdb.existingProcessInstance("Workorder", workorder.getId())
.advance();
 
}
}]
2018-06-11 08:54:40,670: loading workflow api 'org.cmdbuild.workflow.api.SoapSharkWorkflowApiFactory'
2018-06-11 08:54:40,670: loading class 'org.cmdbuild.workflow.api.SoapSharkWorkflowApiFactory' that should be a 'org.cmdbuild.workflow.api.SharkWorkflowApiFactory'
2018-06-11 08:54:40,727: loading mail api 'org.cmdbuild.common.api.mail.javax.mail.JavaxMailBasedMailApiFactory'
2018-06-11 08:54:40,727: loading class 'org.cmdbuild.common.api.mail.javax.mail.JavaxMailBasedMailApiFactory' that should be a 'org.cmdbuild.common.api.mail.MailApiFactory'
2018-06-11 08:54:42,876: error converting to ws type, continuing anyway passing stringified value: java.lang.Integer cannot be cast to org.cmdbuild.workflow.type.ReferenceType
2018-06-11 08:54:43,349: error converting to ws type, continuing anyway passing stringified value: java.lang.Integer cannot be cast to org.cmdbuild.workflow.type.ReferenceType
2018-06-11 08:54:43,460: activity 'SYS02-MeterBasedWOs' closed
2018-06-11 08:54:43,461: Process[key=425_Package_wogen_Process_wogen,mgrname=Package_wogen#1#Process_wogen] - Activity[Process Id=425_Package_wogen_Process_wogen, Id=773_425_Package_wogen_Process_wogen_SYS02-MeterBasedWOs, ba=null, ActDefId=SYS02-MeterBasedWOs] is completed.
2018-06-11 08:54:43,461: Process[key=425_Package_wogen_Process_wogen,mgrname=Package_wogen#1#Process_wogen] - Activity[Process Id=425_Package_wogen_Process_wogen, Id=774_425_Package_wogen_Process_wogen_Process_wogen_act4, ba=null, ActDefId=Process_wogen_act4] is created
2018-06-11 08:54:43,461: activity 'Process_wogen_act4' started
2018-06-11 08:54:43,461: activity 'Process_wogen_act4' closed
2018-06-11 08:54:43,461: Process[key=425_Package_wogen_Process_wogen,mgrname=Package_wogen#1#Process_wogen] - Activity[Process Id=425_Package_wogen_Process_wogen, Id=774_425_Package_wogen_Process_wogen_Process_wogen_act4, ba=null, ActDefId=Process_wogen_act4] is completed.
2018-06-11 08:54:43,461: Process[key=425_Package_wogen_Process_wogen,mgrname=Package_wogen#1#Process_wogen] - No transitions left to follow
2018-06-11 08:54:43,462: process 'Process_wogen' closed
2018-06-11 08:54:43,462: sending notification for update of process 'Process_wogen'
 

Hi. Did you figure out how to solve this issue. I have the same error, tried many things but nothing seems to work so far.

This is a time out problem due to the number of workorders to be generated.
To solve it, follow the steps below.
CMDBuild Team.
 
-------

 

Shutdown Tomcat.

In the Shark webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          replace the Shark library WEB-INF/lib/shark-ejb-4.4-1.jar.jar with sharkejb.ja (it is better to rename the jar changing the extension, e.g. shark-ejb-4.4-1.jar.old)

-          insert the following line in the Shark.conf file in the "conf" folder of the Shark webapp
        UserTransaction.Timeout=7200

In the CMDBuild or openMAINT webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          edit the javascripts/cmdbuild/core/configurations/Timeout file replacing the "base: 90" line in "base: 9000"

Restart Tomcat.
Hello, 
 
 axis.jar is the same thar axis-1.4.jar? or it is a new version? where can I download it?
 
Best regards.
 
 
Previously Tecnoteca wrote:
This is a time out problem due to the number of workorders to be generated.
To solve it, follow the steps below.
CMDBuild Team.
 
-------

 

Shutdown Tomcat.

In the Shark webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          replace the Shark library WEB-INF/lib/shark-ejb-4.4-1.jar.jar with sharkejb.ja (it is better to rename the jar changing the extension, e.g. shark-ejb-4.4-1.jar.old)

-          insert the following line in the Shark.conf file in the "conf" folder of the Shark webapp
        UserTransaction.Timeout=7200

In the CMDBuild or openMAINT webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          edit the javascripts/cmdbuild/core/configurations/Timeout file replacing the "base: 90" line in "base: 9000"

Restart Tomcat.

 

In the shark log I see  many lines like the following:
 
* error converting to ws type, continuing anyway passing stringified value: java.lang.Integer cannot be cast to org.cmdbuild.workflow.type.ReferenceType
 
Maybe, it has something to do with the error.
 
Best regards.
 
Previously Tecnoteca wrote:
This is a time out problem due to the number of workorders to be generated.
To solve it, follow the steps below.
CMDBuild Team.
 
-------

 

Shutdown Tomcat.

In the Shark webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          replace the Shark library WEB-INF/lib/shark-ejb-4.4-1.jar.jar with sharkejb.ja (it is better to rename the jar changing the extension, e.g. shark-ejb-4.4-1.jar.old)

-          insert the following line in the Shark.conf file in the "conf" folder of the Shark webapp
        UserTransaction.Timeout=7200

In the CMDBuild or openMAINT webapp:

-          replace the Shark library WEB-INF/lib/axis-1.4.jar with axis.jar (it is better to rename the axis-1.4.jar changing the extension, e.g. axis-1.4.jar.old)

-          edit the javascripts/cmdbuild/core/configurations/Timeout file replacing the "base: 90" line in "base: 9000"

Restart Tomcat.