Groovy - Error while communicating with the engine.

Hi there,

I have a java program that works perfectly with postgres driver 9.2, and it also works in my groovy scripts except one.

Here is my code:

Basically I am trying to upload the document d1 to postgres as a byte. This works in java but I cannot get it to work in groovy, which it should.

Any ideas? Thanks in advance.
Seán

String host = "localhost"; String port = "5432"; String user = ""; String usrp = "!"; String dbse = ""; def tble = "";
conn1 = BonitaSql.newInstance ("jdbc:postgresql://"+host+":"+port+"/"+dbse,user, usrp, new org.postgresql.Driver());

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, 2015);
calendar.set(Calendar.MONTH, 1);
calendar.set(Calendar.DAY_OF_MONTH, 1);
date = new java.sql.Date(calendar.getTime().getTime());

String gubedocumentname = d1.getContentFileName();
String mimeType = d1.getContentMimeType();
title = (title==null||title.isEmpty()) ? d1.getContentFileName():title;
final byte[] content = processRuntimeAPI.getDocumentContent(d1.getContentStorageId());
final ByteArrayInputStream gubedocument = new ByteArrayInputStream(content);

gubedocumentid = 0;

// gubedocumentname = “”;
gubeversionmajor = 0;
gubeversionminor = 0;
gubeversionmini = 0;
uploader = “”;
approver = “”;
uploaddate = date;
approvaldate = date;
//gubedocument = “”;

uploader = BonitaUsers.getUser(apiAccessor,taskAssigneeId).firstName+" "+BonitaUsers.getUser(apiAccessor,taskAssigneeId).lastName;
//groovy prepared statement
//http://groovy.329449.n5.nabble.com/blobs-in-groovy-sql-td343980.html
//sql.execute('CREATE TABLE testBlob (bits BLOB)')
//def is = new ByteArrayInputStream('Alles in Butter'.getBytes())
//def is = gubedocument.toString().getBytes();

def ps = conn1.connection.prepareStatement("INSERT INTO gubedocuments VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
ps.setLong(1, 0);
ps.setString(2, gubedocumentname);
ps.setLong(3, 0);
ps.setLong(4, 0);
ps.setLong(5, 0);
ps.setString(6, uploader);
ps.setString(7, "");
ps.setDate(8, uploaddate);
ps.setDate(9, approvaldate);
ps.setBinaryStream(10, gubedocument);
ps.executeUpdate();

if(ps.updateCount == 1){
	if(debug){dI++; logger.severe(dI+thisTrace+"@conn1.updateCount "+conn1.updateCount);}
	successful = true;
}
else{
	if(debug){dI++; logger.severe(dI+thisTrace+"@conn1.updateCount "+conn1.updateCount);}
	successful = false;
}

Log file:

2015-02-26 16:16:37 org.bonitasoft.tomcat.H2Listener INFO: Starting H2 server : [-tcp, -tcpPort, 9091, -baseDir, E:\Bonita\Bonita 642\BonitaBPMCommunity-6.4.2-00-Scratch\workspace\tomcat/bonita/server/platform/work] 2015-02-26 16:16:46 org.bonitasoft.engine.EngineInitializer INFO: Initializing Bonita Engine... 2015-02-26 16:16:46 org.bonitasoft.engine.EngineInitializer INFO: Initializing Spring context... 2015-02-26 16:16:46 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@254ea7be: startup date [Thu Feb 26 16:16:46 AST 2015]; root of context hierarchy 2015-02-26 16:16:46 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@147e23c0: startup date [Thu Feb 26 16:16:46 AST 2015]; parent: org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@254ea7be 2015-02-26 16:16:53 org.bonitasoft.engine.EngineInitializer INFO: Initializing platform... 2015-02-26 16:16:53 org.bonitasoft.engine.EngineInitializer INFO: Creating platform... 2015-02-26 16:16:55 org.bonitasoft.engine.EngineInitializer INFO: Platform initialized successfully. 2015-02-26 16:16:55 org.bonitasoft.engine.EngineInitializer INFO: Starting platform... 2015-02-26 16:16:55 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.classloader.ClassLoaderServiceImpl 2015-02-26 16:16:55 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.cache.ehcache.PlatformEhCacheCacheService 2015-02-26 16:16:55 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.cache.ehcache.EhCacheCacheService 2015-02-26 16:16:55 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@16267da9: startup date [Thu Feb 26 16:16:55 AST 2015]; parent: org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@147e23c0 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting flow nodes... 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Found 0 flow nodes to restart on tenant 1 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.RestartProcessHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Found 0 process to restart on tenant 1 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Reinitializing message instances in non-stable state to make them reworked by BPMEventHandlingJob 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | 0 message instances found and reset. 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Reinitializing waiting message events in non-stable state to make them reworked by BPMEventHandlingJob 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | 0 waiting message events found and reset. 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl on tenant with ID 1 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.service.impl.PermissionServiceImpl on tenant with ID 1 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.tracking.TimeTracker on tenant with ID 1 2015-02-26 16:16:56 org.bonitasoft.engine.tracking.TimeTracker INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Starting TimeTracker... 2015-02-26 16:16:56 org.bonitasoft.engine.tracking.TimeTracker INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | TimeTracker started. 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.work.ExecutorWorkService on tenant with ID 1 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Using default implementation for ThreadExecutor 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Using db table-based data access locking (synchronization). 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: JobStoreCMT initialized. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Quartz scheduler 'QuartzScheduler' initialized from an externally provided properties instance. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Quartz scheduler version: 2.2.1 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.SchedulerServiceImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start scheduler 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Freed 1 triggers from 'acquired' / 'blocked' state. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Handling 2 trigger(s) that missed their scheduled fire-time. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Recovering 0 jobs that were in-progress at the time of the last shut-down. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Recovery complete. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Removed 0 'complete' triggers. 2015-02-26 16:16:56 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Removed 1 stale fired job entries. 2015-02-26 16:16:56 org.bonitasoft.engine.handler.SchedulerServiceRestartHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Rescheduling all scheduler Triggers in ERROR state 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.StarterThread INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Restarting elements in the Thread 41 2015-02-26 16:16:56 org.bonitasoft.engine.EngineInitializer INFO: Platform started successfully 2015-02-26 16:16:56 org.bonitasoft.engine.api.impl.StarterThread INFO: THREAD_ID=41 | HOSTNAME=Mainframe | Restarting elements for tenant 1 2015-02-26 16:16:56 org.bonitasoft.engine.EngineInitializer INFO: Initialization of Bonita Engine done! ( took 9817ms) 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=41 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting 0 flow nodes for tenant 1 2015-02-26 16:16:56 org.bonitasoft.engine.execution.work.RestartProcessHandler INFO: THREAD_ID=41 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting 0 processes for tenant 1 2015-02-26 16:16:56 org.bonitasoft.console.server.listener.StudioWatchdogListener WARNING: Bonita Studio watchdog process has started on 6969 with a delay of 20000ms 2015-02-26 16:32:14 org.bonitasoft.tomcat.H2Listener INFO: Starting H2 server : [-tcp, -tcpPort, 9091, -baseDir, E:\Bonita\Bonita 642\BonitaBPMCommunity-6.4.2-00-Scratch\workspace\tomcat/bonita/server/platform/work] 2015-02-26 16:32:23 org.bonitasoft.engine.EngineInitializer INFO: Initializing Bonita Engine... 2015-02-26 16:32:23 org.bonitasoft.engine.EngineInitializer INFO: Initializing Spring context... 2015-02-26 16:32:23 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@24a5f4ff: startup date [Thu Feb 26 16:32:23 AST 2015]; root of context hierarchy 2015-02-26 16:32:23 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@1b583737: startup date [Thu Feb 26 16:32:23 AST 2015]; parent: org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@24a5f4ff 2015-02-26 16:32:31 org.bonitasoft.engine.EngineInitializer INFO: Initializing platform... 2015-02-26 16:32:31 org.bonitasoft.engine.EngineInitializer INFO: Creating platform... 2015-02-26 16:32:32 org.bonitasoft.engine.EngineInitializer INFO: Platform initialized successfully. 2015-02-26 16:32:32 org.bonitasoft.engine.EngineInitializer INFO: Starting platform... 2015-02-26 16:32:32 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.classloader.ClassLoaderServiceImpl 2015-02-26 16:32:32 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.cache.ehcache.PlatformEhCacheCacheService 2015-02-26 16:32:32 org.bonitasoft.engine.api.impl.PlatformAPIImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start service of platform : org.bonitasoft.engine.cache.ehcache.EhCacheCacheService 2015-02-26 16:32:32 org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext INFO: Refreshing org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@7178a676: startup date [Thu Feb 26 16:32:32 AST 2015]; parent: org.bonitasoft.engine.service.impl.AbsoluteFileSystemXmlApplicationContext@1b583737 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting flow nodes... 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Found 0 flow nodes to restart on tenant 1 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.RestartProcessHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Found 0 process to restart on tenant 1 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Reinitializing message instances in non-stable state to make them reworked by BPMEventHandlingJob 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | 0 message instances found and reset. 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Reinitializing waiting message events in non-stable state to make them reworked by BPMEventHandlingJob 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.BPMEventWorksHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | 0 waiting message events found and reset. 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl on tenant with ID 1 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.service.impl.PermissionServiceImpl on tenant with ID 1 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.tracking.TimeTracker on tenant with ID 1 2015-02-26 16:32:33 org.bonitasoft.engine.tracking.TimeTracker INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | Starting TimeTracker... 2015-02-26 16:32:33 org.bonitasoft.engine.tracking.TimeTracker INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | TimeTracker started. 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.transaction.SetServiceState INFO: THREAD_ID=23 | HOSTNAME=Mainframe | TENANT_ID=1 | start tenant-level service org.bonitasoft.engine.work.ExecutorWorkService on tenant with ID 1 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Using default implementation for ThreadExecutor 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Using db table-based data access locking (synchronization). 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: JobStoreCMT initialized. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Quartz scheduler 'QuartzScheduler' initialized from an externally provided properties instance. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory INFO: Quartz scheduler version: 2.2.1 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.SchedulerServiceImpl INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Start scheduler 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Freed 1 triggers from 'acquired' / 'blocked' state. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Handling 1 trigger(s) that missed their scheduled fire-time. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Recovering 0 jobs that were in-progress at the time of the last shut-down. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Recovery complete. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Removed 0 'complete' triggers. 2015-02-26 16:32:33 org.bonitasoft.engine.scheduler.impl.BonitaJobStoreCMT INFO: Removed 1 stale fired job entries. 2015-02-26 16:32:33 org.bonitasoft.engine.handler.SchedulerServiceRestartHandler INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Rescheduling all scheduler Triggers in ERROR state 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.StarterThread INFO: THREAD_ID=23 | HOSTNAME=Mainframe | Restarting elements in the Thread 41 2015-02-26 16:32:33 org.bonitasoft.engine.EngineInitializer INFO: Platform started successfully 2015-02-26 16:32:33 org.bonitasoft.engine.api.impl.StarterThread INFO: THREAD_ID=41 | HOSTNAME=Mainframe | Restarting elements for tenant 1 2015-02-26 16:32:33 org.bonitasoft.engine.EngineInitializer INFO: Initialization of Bonita Engine done! ( took 10322ms) 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.RestartFlowNodesHandler INFO: THREAD_ID=41 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting 0 flow nodes for tenant 1 2015-02-26 16:32:33 org.bonitasoft.engine.execution.work.RestartProcessHandler INFO: THREAD_ID=41 | HOSTNAME=Mainframe | TENANT_ID=1 | Restarting 0 processes for tenant 1 2015-02-26 16:32:33 org.bonitasoft.console.server.listener.StudioWatchdogListener WARNING: Bonita Studio watchdog process has started on 6969 with a delay of 20000ms 2015-02-26 16:32:35 org.bonitasoft.engine.api.impl.transaction.process.DisableProcess INFO: THREAD_ID=59 | HOSTNAME=Mainframe | TENANT_ID=1 | The user has disabled process in version <1.0> with id <8453983743812230485> 2015-02-26 16:32:36 org.bonitasoft.engine.api.impl.ProcessManagementAPIImplDelegate INFO: THREAD_ID=59 | HOSTNAME=Mainframe | TENANT_ID=1 | The user has deleted process with id = <8453983743812230485> 2015-02-26 16:32:45 org.bonitasoft.engine.api.impl.ProcessAPIImpl INFO: THREAD_ID=59 | HOSTNAME=Mainframe | TENANT_ID=1 | The user has installed process in version <1.0> with id <6370548183239008865> 2015-02-26 16:32:45 org.bonitasoft.engine.api.impl.transaction.process.EnableProcess INFO: THREAD_ID=59 | HOSTNAME=Mainframe | TENANT_ID=1 | The user has enabled process in version <1.0> with id <6370548183239008865> 2015-02-26 16:32:47 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita] INFO: RestletServlet: [Restlet] ServerServlet: component class is null 2015-02-26 16:32:57 org.bonitasoft.engine.api.impl.ProcessStarter INFO: THREAD_ID=55 | HOSTNAME=Mainframe | TENANT_ID=1 | The user has started the process instance <26001> of process in version <1.0> and id <6370548183239008865> 2015-02-26 16:32:57 org.bonitasoft.engine.bpm.model.impl.BPMInstancesCreator WARNING: THREAD_ID=72 | HOSTNAME=Mainframe | TENANT_ID=1 | Creating a transient data instance with a null expression is not a good practice. 2015-02-26 16:34:02 org.bonitasoft SEVERE: 1 Document03putToPostgresql upload: Trace Start 2015-02-26 16:34:02 org.bonitasoft SEVERE: 2 Document03putToPostgresql upload: d1DocumentImpl{id=1501, processInstanceId=26001, name='d1', author=204, creationDate=Thu Feb 26 16:34:01 AST 2015, hasContent=true, fileName='BonBug01-1.0.log', contentMimeType='application/octet-stream', contentStorageId='1501', url='documentDownload?fileName=BonBug01-1.0.log&contentStorageId=1501', description='null', version='1', index=-1} 2015-02-26 16:34:02 org.bonitasoft SEVERE: 3 Document03putToPostgresql upload: @if(d1==null){ 2015-02-26 16:34:02 org.bonitasoft SEVERE: 4 Document03putToPostgresql upload: @if(d1==null){} else 2015-02-26 16:34:02 org.bonitasoft SEVERE: 5 Document03putToPostgresql upload: @String gubedocumentname BonBug01-1.0.log 2015-02-26 16:34:02 org.bonitasoft SEVERE: 6 Document03putToPostgresql upload: @String mimeType application/octet-stream 2015-02-26 16:34:02 org.bonitasoft SEVERE: 7 Document03putToPostgresql upload: @title BonBug01-1.0.log 2015-02-26 16:34:02 org.bonitasoft SEVERE: 9 Document03putToPostgresql upload: @final ByteArrayInputStream java.io.ByteArrayInputStream@3956f4ac 2015-02-26 16:34:02 org.bonitasoft SEVERE: 10 Document03putToPostgresql upload: @// postgresql Upload Call 2015-02-26 16:34:05 org.bonitasoft SEVERE: 11 Document03putToPostgresql upload: @Calendar 2015-02-26 16:34:05 org.bonitasoft SEVERE: 12 Document03putToPostgresql upload: @VarAssign 2015-02-26 16:34:05 org.bonitasoft SEVERE: 13 Document03putToPostgresql upload: @VarAssign String insertQuery1

2015-02-26 16:34:05 org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil
SEVERE: A error occured while executing the command.
org.bonitasoft.engine.command.CommandExecutionException: USERNAME=walter.bates | org.bonitasoft.engine.command.SCommandExecutionException: Error executing command ‘Map<String, Serializable> ExecuteActionsAndTerminateTask(List, Map<String, Serializable>, long activityInstanceId)’
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:214)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:184)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:363)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:332)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:288)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:339)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:274)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:128)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
at com.sun.proxy.$Proxy18.execute(Unknown Source)
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:186)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.executeActionsAndTerminate(FormWorkflowAPIImpl.java:354)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:994)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:784)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:128)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: org.bonitasoft.engine.command.SCommandExecutionException: Error executing command ‘Map<String, Serializable> ExecuteActionsAndTerminateTask(List, Map<String, Serializable>, long activityInstanceId)’
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:87)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:57)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:212)
… 52 more
Caused by: org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class java.sql.SQLFeatureNotSupportedException with message = Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) is not yet implemented.
Expression : SExpressionImpl [name=upload, content=/**/

, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:643)
at org.bonitasoft.engine.execution.state.ReadyActivityStateImpl.onEnterToOnFinish(ReadyActivityStateImpl.java:47)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:73)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:35)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:130)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:184)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:166)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.executeFlowNode(ProcessExecutorImpl.java:229)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.executeActivity(ExecuteActionsAndTerminateTask.java:156)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:84)
… 54 more
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class java.sql.SQLFeatureNotSupportedException with message = Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) is not yet implemented.
Expression : SExpressionImpl [name=upload, content=/**/

, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.getOperationValue(OperationServiceImpl.java:181)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:106)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:92)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:78)
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:640)
… 63 more
Caused by: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class java.sql.SQLFeatureNotSupportedException with message = Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) is not yet implemented.
Expression : SExpressionImpl [name=upload, content=/**/

, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.evaluate(GroovyScriptExpressionExecutorCacheStrategy.java:142)
at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.evaluate(ExpressionServiceImpl.java:86)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionWithResolvedDependencies(ExpressionResolverServiceImpl.java:215)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsFlatten(ExpressionResolverServiceImpl.java:120)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluate(ExpressionResolverServiceImpl.java:83)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.getOperationValue(OperationServiceImpl.java:176)
… 67 more
Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.java:710)
at org.postgresql.jdbc4.AbstractJdbc4Statement.setBinaryStream(AbstractJdbc4Statement.java:134)
at java_sql_PreparedStatement$setBinaryStream.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at Script1.run(Script1.groovy:277)
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.evaluate(GroovyScriptExpressionExecutorCacheStrategy.java:123)
… 72 more

2015-02-26 16:34:05 org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl
SEVERE: Username<walter.bates> Form<Document03putToPostgresql–1.0–Step1$entry> Submitted Fields<d11 (java.io.File) => E:\Bonita\Bonita 642\BonitaBPMCommunity-6.4.2-00-Scratch\workspace\tomcat\bonita\client\tenants\1\tmp\tmp_6651481252174149357.log> Task Error while communicating with the engine.
org.bonitasoft.console.common.server.utils.BPMEngineException: A error occured while executing the command.
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:204)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.executeActionsAndTerminate(FormWorkflowAPIImpl.java:354)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:994)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:784)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:128)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Thanks Florian,

First I had to remove all references to the previous driver and then had to change all my connector definitions etc. the 9.2 was simply getting in the way of 9.4

Then I have added the length() statement is now…

ps.setBinaryStream(10, gubedocument, (int) contentByte.length);

But now I have a different problem…Groovy is unable to Map the parameters to the postgres driver…

Caused by: org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.postgresql.util.PSQLException with message = Unable to bind parameter values for statement.

Full Log.

2015-02-28 08:52:12 org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil SEVERE: A error occured while executing the command. org.bonitasoft.engine.command.CommandExecutionException: USERNAME=walter.bates | org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTask(List, Map, long activityInstanceId)' at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:214) at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:184) at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:173) at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:363) at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:332) at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:288) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:339) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:274) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:128) at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88) at com.sun.proxy.$Proxy18.execute(Unknown Source) at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:186) at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.executeActionsAndTerminate(FormWorkflowAPIImpl.java:354) at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:994) at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:784) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:128) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTask(List, Map, long activityInstanceId)' at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:87) at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:57) at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:212) ... 51 more Caused by: org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.postgresql.util.PSQLException with message = Unable to bind parameter values for statement. Expression : SExpressionImpl [name=upload, content=/**/

, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:643)
at org.bonitasoft.engine.execution.state.ReadyActivityStateImpl.onEnterToOnFinish(ReadyActivityStateImpl.java:47)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:73)
at org.bonitasoft.engine.execution.state.FlowNodeStateWithConnectors.execute(FlowNodeStateWithConnectors.java:35)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:130)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:184)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:166)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.executeFlowNode(ProcessExecutorImpl.java:229)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.executeActivity(ExecuteActionsAndTerminateTask.java:156)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.execute(ExecuteActionsAndTerminateTask.java:84)
… 53 more
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.postgresql.util.PSQLException with message = Unable to bind parameter values for statement.
Expression : SExpressionImpl [name=upload, content=/**/

, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.getOperationValue(OperationServiceImpl.java:181)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:106)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:92)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:78)
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:640)
… 62 more
Caused by: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.postgresql.util.PSQLException with message = Unable to bind parameter values for statement.
Expression : SExpressionImpl [name=upload, content=/**/

}, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=d1, content=d1, returnType=org.bonitasoft.engine.bpm.document.Document, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_DOCUMENT]], SExpressionImpl [name=processInstanceId, content=processInstanceId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.evaluate(GroovyScriptExpressionExecutorCacheStrategy.java:142)
at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.evaluate(ExpressionServiceImpl.java:86)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionWithResolvedDependencies(ExpressionResolverServiceImpl.java:215)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsFlatten(ExpressionResolverServiceImpl.java:120)
at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluate(ExpressionResolverServiceImpl.java:83)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.getOperationValue(OperationServiceImpl.java:176)
… 66 more
Caused by: org.postgresql.util.PSQLException: Unable to bind parameter values for statement.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:277)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:366)
at java_sql_PreparedStatement$executeUpdate.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at Script1.run(Script1.groovy:331)
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.evaluate(GroovyScriptExpressionExecutorCacheStrategy.java:123)
… 71 more
Caused by: java.io.EOFException: Premature end of input stream, expected 399 bytes, but only read 0.
at org.postgresql.core.PGStream.SendStream(PGStream.java:503)
at org.postgresql.core.v3.SimpleParameterList.streamBytea(SimpleParameterList.java:256)
at org.postgresql.core.v3.SimpleParameterList.writeV3Value(SimpleParameterList.java:342)
at org.postgresql.core.v3.QueryExecutorImpl.sendBind(QueryExecutorImpl.java:1449)
at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1684)
at org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:1205)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:253)
… 80 more

2015-02-28 08:52:12 org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl
SEVERE: Username<walter.bates> Form<Document03putToPostgresql–1.0–Step1$entry> Submitted Fields<d11 (java.io.File) => E:\Bonita\Bonita 642\BonitaBPMCommunity-6.4.2-00-Scratch\workspace\tomcat\bonita\client\tenants\1\tmp\tmp_7532766789080416313.ini> Task Error while communicating with the engine.
org.bonitasoft.console.common.server.utils.BPMEngineException: A error occured while executing the command.
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:204)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.executeActionsAndTerminate(FormWorkflowAPIImpl.java:354)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:994)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:784)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:128)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Hi,

do you have the correct driver?

Maybe you should search for more Details by this message:

Groovy script throws an exception of type class java.sql.SQLFeatureNotSupportedException with message = Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) is not yet implemented.

And i am not shure but i heard it is not possible to store a binary stream format. (maybe only by using cmis with alfresco).

Hi,

yes I have the correct driver, the same driver is used in a JAVA program and it works perfectly as I said at the beginning.

As for not being able to store binary in database - that’s been possible for several years. Usually called BLOBs, in postgresql we call them bytea.

This should be perfectly possible, I’ve struggled all day. As I say this is perfectly good code and works in a batch program, just not online.

regards
Seán

Hi,

By driver, you means “jdbc:postgresql…” or the .jar ? Maybe the jar file is an old one, that’s why the method is not yet implemented.

Hi Florian,

the jar is postgresql-9.2-1002.jdbc4.jar which is pretty new, I’ve even changed it to the latest postgresql-9.4-1201.jdbc41.jar with no success.

Thanks for your help here…

regards

Hi,

According to this post URL , you need to set the length of the input as third parameter.

Hi,

Is your file contains XML content ? This might cause the problem.

And can you use input stream instead of ByteArrayInputStream ?