Error while running query: operator does not exist: character varying ~~ bytea

Hi

 

I've been using Bonita for two years and developed some processes and reports well.

 

Almost all reports use custom query, some of them call query by rest API and others call them direct.

For example:

../API/extension/myreport?p={{pageNumber - 1}}&c={{numberOfItems}}{{params}}

or

../API/bdm/businessData/org.iut.model.table?q=findReq&p={{pageNumber - 1}}&c={{pageSize}}{{params2}}

But there is a weird problem in both methods that I have not seen before. It's fine in local but on the server it doesn't run when value of parameter in null or empty !!

 

I am getting the following error message in first method:

org.bonitasoft.console.common.server.page.RestApiRenderer Error when executing rest api extension call to apiExtension|GET|myreport
groovy.lang.MissingMethodException: No signature of method: static org.iut.model.myTableDAO.findReq() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer) values: [, , , , , 0, 2147483647]

 

and this error in second method:

Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying ~~ bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

 

I changed query over and over but I can't success.

first query is like this:

SELECT w
FROM mytable w
WHERE (  w.a like  CONCAT('%',  :applicantname , '%')   OR :applicantname IS NULL)
AND (  w.b like   CONCAT('%', :applicantusername , '%')    OR :applicantusername IS NULL)
AND (    w.c like   CONCAT('%',  :department  , '%')    OR :department  IS NULL  )
AND  (  w.tim <= :untilDate OR  :untilDate IS NULL  )
AND (   w.tim>=  :fromDate OR  :fromDate IS NULL )    
ORDER BY w.persistenceId desc

I added lower funtion in query but it dosn't work!

Then I added checking null in first of query ....

Then I summarized  query and removed 2 parameters and changed name of paramet like defaults, but it dsn't work !!!

SELECT w
FROM wkshpRequest w
WHERE (  :a IS NULL OR   w.a like  CONCAT('%',  :a, '%')  )
AND (    :b IS NULL OR   w.b like   CONCAT('%', :b, '%')   )
AND (   :c IS NULL OR   w.c like   CONCAT('%',  :c, '%')   )  
ORDER BY w.persistenceId desc

All of above qeuries in local and h2 database is OK but in the server and Postgres doesn't work!!!

I'm using Bonita Community 7.8.4 and Postgres 9.6 on the server.

 

 

 

 

 

Hi,

First thing that pulled my attention: static org.iut.model.myTableDAO.findReq() this is weird that your DAO contains static methods.

DAO classes are generated by Bonita and should not be static. Can you send the BDM you are using, along with the REST API Extension that makes the DAO call, just to make sure the code is not weird and may not "succeed" on H2 for bad reasons...

There are also threads on StackOverflow that may point to same problems as yours: https://stackoverflow.com/search?q=character+varying+bytea

Regards,