Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-13826

Activiti engine throwing NPE when changing a long String (>4000 characters) to a normal String (<4000 characters))

    Details

    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.5
    • Fix Version/s: 5.0.2
    • Component/s: Workflow
    • Labels:
      None
    • Environment:
      Alfresco One 5.0.0.5

      Description

      [Summary]
      There are circumstances in the activiti engine, where conversion of long Stringvariables (<4000 characters) to normal string in a task transition is failing with a Nullpointer Exception. After that error, the "My tasks" dashlet is loading endlessly and not showing any tasks.

      [Steps to reproduce]
      How to reproduce the problem:
      1. Use Alfresco One 5.0.0.5
      2. Copy the attached files
      a) longStringProblemDemo-model.xml,
      b) longStringProblemDemo-context.xml and
      c) longStringProblemDemo.bpmn20.xml
      to tomcat\shared\classes\alfresco\extension
      3. Copy the attached files
      a) longStringProblemDemo-share-context.xml and
      b) longStringProblemDemo-config-custom.xml
      to tomcat\shared\classes\alfresco\web-extension
      4. Restart Alfresco server
      5. Login as admin to Share
      6. From the tasks dashlet select "Start workflow"
      7. From the workflow dropdown select the workflow "Long String Problem Demo" and click "Start workflow"
      8. Open the task from your "My tasks" dashlet
      9. Edit the form field containing more than 4000 characters and set it to any text shorter than 4000 characters
      10. Click "Task done" to finish the task

      [Current behaviour]

      • Redirection to "Home" screen
      • Nullpointer is thrown:
        15:24:06,521 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-12] Exception from executeScript - redirecting to status template error: 03100000 Wrapped Exception (with status template): null
        org.springframework.extensions.webscripts.WebScriptException: 03100000 Wrapped Exception (with status template): null
        	at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1126)
        	at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
        	at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:463)
        	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
        	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:532)
        	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:600)
        	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:380)
        	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:261)
        	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
        	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
        	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
        	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.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
        	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:310)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        	at java.lang.Thread.run(Thread.java:744)
        Caused by: java.lang.NullPointerException
        	at java.lang.String.<init>(String.java:556)
        	at org.alfresco.repo.workflow.activiti.variable.CustomStringVariableType.getValue(CustomStringVariableType.java:81)
        	at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.getValue(VariableInstanceEntity.java:178)
        	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:83)
        	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:80)
        	at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.getVariables(VariableScopeImpl.java:73)
        	at org.activiti.engine.impl.cmd.GetTaskVariablesCmd.execute(GetTaskVariablesCmd.java:62)
        	at org.activiti.engine.impl.cmd.GetTaskVariablesCmd.execute(GetTaskVariablesCmd.java:32)
        	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
        	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
        	at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
        	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
        	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
        	at org.activiti.engine.impl.TaskServiceImpl.getVariables(TaskServiceImpl.java:215)
        	at org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter.getTaskProperties(ActivitiPropertyConverter.java:122)
        	at org.alfresco.repo.workflow.activiti.ActivitiTypeConverter.getTaskProperties(ActivitiTypeConverter.java:485)
        	at org.alfresco.service.cmr.workflow.LazyActivitiWorkflowTask.ensureProperties(LazyActivitiWorkflowTask.java:131)
        	at org.alfresco.service.cmr.workflow.LazyActivitiWorkflowTask$LazyPropertiesMap.get(LazyActivitiWorkflowTask.java:212)
        	at org.alfresco.service.cmr.workflow.LazyActivitiWorkflowTask$LazyPropertiesMap.get(LazyActivitiWorkflowTask.java:150)
        	at org.alfresco.repo.web.scripts.workflow.WorkflowModelBuilder.isPooled(WorkflowModelBuilder.java:404)
        	at org.alfresco.repo.web.scripts.workflow.WorkflowModelBuilder.buildSimple(WorkflowModelBuilder.java:196)
        	at org.alfresco.repo.web.scripts.workflow.TaskInstancesGet.buildModel(TaskInstancesGet.java:187)
        	at org.alfresco.repo.web.scripts.workflow.AbstractWorkflowWebscript.executeImpl(AbstractWorkflowWebscript.java:81)
        	at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
        	... 29 more
        
      • The "My tasks" dashlet is loading endlessly and no more tasks are displayed!

      [Expected behaviour]
      The conversion in the background from byteArray to text should happen correctly without any errros in log.

      [Supporting evidence]

      Extend the AlfrescoProcessEngineConfiguration with a custom class, that uses a working variable type. And then update the activiti-context.xml

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs
                  Reporter:
                  dkoch Dennis Koch
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 hours, 30 minutes
                    4h 30m

                      Structure Helper Panel