Cannot submit task form c69a23bd-6928-11ea-b338-4a4520ef37ce: ENGINE-17007 Cannot set variable with name file. Java serialization format is prohibited

I have seen this question appear already on this forum but I still cannot get around my problem.

I have process with several tasks in. One of the final tasks is a user task that is linked with a form. I am attempting to display a value which is stored as a property on a custom class I have created (and I have already used in other tasks) in the form. the below code is the html for the form including the script

<p>
Where shall the file live in?
</p>

I have looked into my pom file and there is the data dependency, the spin one I have seen people say you need to be able to deal with the different formats of data. But mine is in the “test” scope, so I tried changing this to main and it brought about many other issues.

Any help would be greatly appreciated

<form class="form-horizontal">
  <div class="form-group">
<label class="control-label">Vehicles Team?</label>
<div class="controls">
  <input type="checkbox"
         cam-variable-name="Vehicle"
         cam-variable-type="Boolean"/>
</div>
  </div>
  <div class="form-group">
<label class="control-label">Parts Team?</label>
<div class="controls">
  <input type="checkbox"
         cam-variable-name="Part"
         cam-variable-type="Boolean"
         class="form-control"/>
</div>
  </div>
  
  <h2>File Name is: {{file.Name}}</h2>

  <script cam-script type="text/form-script">
  
  
   	 camForm.on('form-loaded', function() {
  // tell the form SDK to fetch the variable named 'file'
  camForm.variableManager.fetchVariable('file');
  	 });
  
camForm.on('variables-fetched', function() {
  // work with the variable (bind it to the current AngularJS $scope)
  $scope.file = camForm.variableManager.variable('file').value;
 });
  
  </script>
</form>

Any help would be greatly appreciated

But the value file.Name never displays and then once I try submit I get the cannot submit error as displayed in the title of this issue

@EthanVenencia can you provide the complete stacktrace of the exception from logs?

is this what you are after?

Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-17007 Cannot set variable with name file. Java serialization format is prohibited
at org.camunda.bpm.engine.impl.core.CoreLogger.javaSerializationProhibitedException(CoreLogger.java:77)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.checkJavaSerialization(AbstractVariableScope.java:402)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocal(AbstractVariableScope.java:348)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:325)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:335)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:310)
at org.camunda.bpm.engine.impl.form.handler.DefaultFormHandler.submitFormVariables(DefaultFormHandler.java:305)
at org.camunda.bpm.engine.impl.form.handler.SubmitFormVariablesInvocation.invoke(SubmitFormVariablesInvocation.java:42)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:92)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:63)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler$2.call(DelegateFormHandler.java:83)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler$2.call(DelegateFormHandler.java:79)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler.doCall(DelegateFormHandler.java:70)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler$1.call(DelegateFormHandler.java:58)
at org.camunda.bpm.engine.impl.context.ProcessApplicationClassloaderInterceptor.call(ProcessApplicationClassloaderInterceptor.java:48)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:121)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:132)
at org.camunda.bpm.engine.impl.context.Context.executeWithinProcessApplication(Context.java:206)
at org.camunda.bpm.engine.impl.context.Context.executeWithinProcessApplication(Context.java:193)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler.performContextSwitch(DelegateFormHandler.java:56)
at org.camunda.bpm.engine.impl.form.handler.DelegateFormHandler.submitFormVariables(DelegateFormHandler.java:79)
at org.camunda.bpm.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:43)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.FormServiceImpl.submitTaskForm(FormServiceImpl.java:91)
at org.camunda.bpm.engine.rest.sub.task.impl.TaskResourceImpl.submit(TaskResourceImpl.java:148)
… 62 more

@EthanVenencia, try adding the below property in your configuration.

<property name="javaSerializationFormatEnabled">true</property>

1 Like

Which file does this go in exactly?
The only configuration file i have touched is the pom file, with all the dependencies. But it doesn’t seem like that should go in there.

Oh is it the xml file? think iv found it

@EthanVenencia its process engine config file. How did you setup your camunda server? You can add it in processes.xml.

Refer this:
https://docs.camunda.org/manual/7.12/reference/deployment-descriptors/tags/process-engine/

javaSerializationFormatEnabled Boolean Sets if Java serialization format can be used, when setting variables by their serialized representation. Default value: false

1 Like

@aravindhrs I have set this in the processes.xml file, I have ran a mavern clean, then mavern install and I am still getting the same error and I am unable to show the value from the custom class in the form.

I have set variables, recieved variables in previous java delegate methods.

But when trying to set this variable from the customer class in javaScript I keep getting this error

this is my file contents

<?xml version="1.0" encoding="UTF-8"?>
<process-application
  xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <process-archive>
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
      <property name="javaSerializationFormatEnabled">true</property>
    </properties>
  </process-archive>

</process-application>

How did you build the payload for customer class in the form using javascript?

@aravindhrs below is everything within the form at the moment

<p>
Where shall the file live in?
</p>

<form class="form-horizontal">
  <div class="form-group">
    <label class="control-label">Vehicles Team?</label>
    <div class="controls">
      <input type="checkbox"
             cam-variable-name="Vehicle"
             cam-variable-type="Boolean"/>
    </div>
  </div>
  <div class="form-group">
    <label class="control-label">Parts Team?</label>
    <div class="controls">
      <input type="checkbox"
             cam-variable-name="Part"
             cam-variable-type="Boolean"
             class="form-control"/>
    </div>
  </div>
  
  <h2>File Name is: {{file.Name}}</h2>

  <script cam-script type="text/form-script">
  
  
   	 camForm.on('form-loaded', function() {
      // tell the form SDK to fetch the variable named 'file'
      camForm.variableManager.fetchVariable('file');
  	 });
  
    camForm.on('variables-fetched', function() {
      // work with the variable (bind it to the current AngularJS $scope)
      $scope.file = camForm.variableManager.variable('file').value;
     });
  
  </script>
</form>

Refer this example:

@aravindhrs I have used this example as close as possible. This is what I used at first but as far as I can see I cant find what I have done wrong.

To me it doesn’t look like an issue with how i’m retrieving the data, more about it still not being able to get the data in the correct format.

I have noticed in the cockpit when I inspect the variable that this shows for the deseralized version of the object.

camForm.variableManager.fetchVariable('file');

Already the file is uploaded? fetchVariable try to get persisted value from engine and bind bind it to an angular scope variable.

its due to javaSerializationFormatEnabled is false.

This file object already exists, it was created and set in a previous task

@aravindhrs But i have set this to true? I have cleaned and rebuild and moved the War file over to tomcat again, and i still get the same issue

At the moment this File class is setup in either of the first two service tasks ( Import file from server, Download file from Email)

I then retrieve it and check a value set on it within the “Check FIle Exsistance” task to decide the next path.

Now in the final user task I want to use it in the form to display one of the file fields. Which is where i have this issue.

@EthanVenencia, this javaSerializationFormatEnabled is required when you store custom objects in engine. But your use case is file already exists and you’re trying to download or list the files in user task forms. For downloading a file, refer this post:

@aravindhrs Hello, I am experiencing the same issue described here, after migrating to 7.15, we get this error after submitting our forms on the Camunda Tasklist because there is a hasmap variable not deserialized, result of evaluating a dmn table (single result). I already added the property and even added the spin dependency.
Could you please help me to find a solution for this?
Thanks!

@Alejandra if you provide minimal github project for this issue, i can take a look into it. It will be quicker to provide solution rather than asking every details about setup.

Additionally, you can check this example: camunda-bpm-examples/usertask/task-form-embedded-serialized-java-object at master · camunda/camunda-bpm-examples · GitHub

Thanks for the reply. I already saw the example, but i am not using this variable, i just required to load all the variables and it fails after submitting the form.