How can I deploy the BDM on the server 2022.1

I am using Bonitasoft 2022.1. I try to deploy bdm on the server with Rest API or website, but I always get this error:

'An error occurred when deploying the BDM. Consult the logs for more information.'

In a strange way I found those Tables in my postgreSQL, so I am sure it has added, but I can't use that with my process.

<------------------------------------------------------------------------------------------------>
Caused by: org.postgresql.util.PSQLException: ERROR: prepared transactions are disabled
  Hint: Set max_prepared_transactions to a nonzero value.
<------------------------------------------------------------------------------------------------>
I found other error in the log.

And I  edit value of max_prepared_transactions in the postgresql.conf

it was successfully. Thank you.

Hi, Can you share the error trace you find in the log: server/logs/bonita.log ? 

2022-04-01T17:31:02,632+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.a.i.TenantAdministrationAPIImpl - Uninstalling the currently deployed BDM
2022-04-01T17:31:02,632+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.t.TenantStateManager - Executing synchronized tenant maintenance operation BDM Uninstallation for tenant 1
2022-04-01T17:31:02,635+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.t.TenantStateManager - Successful synchronized tenant maintenance operation BDM Uninstallation for tenant 1
2022-04-01T17:31:02,635+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.a.i.TenantAdministrationAPIImpl - BDM successfully uninstalled
2022-04-01T17:31:02,635+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.a.i.TenantAdministrationAPIImpl - Starting the installation of the BDM.
2022-04-01T17:31:02,636+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | INFO  | [http-nio-8080-exec-21|111] o.b.e.t.TenantStateManager - Executing synchronized tenant maintenance operation BDM Installation for tenant 1
2022-04-01T17:31:02,666+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | WARN  | [http-nio-8080-exec-21|111] o.b.e.a.i.TenantAdministrationAPIImpl - Caught an error when installing/updating the BDM, the transaction will be reverted and the previous BDM restored.
2022-04-01T17:31:02,667+0000 | ip-172-31-4-22.ap-southeast-1.compute.internal | ERROR | [http-nio-8080-exec-21|111] o.r.C.BonitaRestletApplication - Exception or error caught in server resource
org.bonitasoft.web.toolkit.client.common.exception.api.APIException: An error has occurred when deploying Business Data Model.
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:73) ~[console-server-7.14.0.jar:?]
    at jdk.internal.reflect.GeneratedMethodAccessor193.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.restlet.resource.ServerResource.doHandle(ServerResource.java:508) ~[org.restlet-2.3.12.jar:?]
    at org.restlet.resource.ServerResource.post(ServerResource.java:1341) ~[org.restlet-2.3.12.jar:?]
    at org.restlet.resource.ServerResource.doHandle(ServerResource.java:606) [org.restlet-2.3.12.jar:?]
    at org.bonitasoft.web.rest.server.api.resource.CommonResource.doHandle(CommonResource.java:213) [console-server-7.14.0.jar:?]
    at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:662) ~[org.restlet-2.3.12.jar:?]
    at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348) ~[org.restlet-2.3.12.jar:?]
    at org.restlet.resource.ServerResource.handle(ServerResource.java:1020) [org.restlet-2.3.12.jar:?]
    at org.restlet.resource.Finder.handle(Finder.java:236) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.doHandle(Router.java:422) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.handle(Router.java:641) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77) [org.restlet-2.3.12.jar:?]
    at org.restlet.Application.handle(Application.java:385) [org.restlet-2.3.12.jar:?]
    at org.bonitasoft.web.rest.server.BonitaRestletApplication.handle(BonitaRestletApplication.java:209) [console-server-7.14.0.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.doHandle(Router.java:422) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.handle(Router.java:641) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.doHandle(Router.java:422) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Router.handle(Router.java:641) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.doHandle(Filter.java:150) [org.restlet-2.3.12.jar:?]
    at org.restlet.routing.Filter.handle(Filter.java:197) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) [org.restlet-2.3.12.jar:?]
    at org.restlet.Component.handle(Component.java:408) [org.restlet-2.3.12.jar:?]
    at org.restlet.Server.handle(Server.java:507) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63) [org.restlet-2.3.12.jar:?]
    at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143) [org.restlet-2.3.12.jar:?]
    at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117) [org.restlet.ext.servlet-2.3.12.jar:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [servlet-api.jar:4.0.FR]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) [urlrewritefilter-4.0.3.jar:4.0.3]
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) [urlrewritefilter-4.0.3.jar:4.0.3]
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) [urlrewritefilter-4.0.3.jar:4.0.3]
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394) [urlrewritefilter-4.0.3.jar:4.0.3]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.bonitasoft.console.common.server.login.filter.RestAPIAuthorizationFilter.proceedWithFiltering(RestAPIAuthorizationFilter.java:78) [console-server-7.14.0.jar:?]
    at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:37) [console-common-7.14.0.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.bonitasoft.console.common.server.login.filter.TokenValidatorFilter.proceedWithFiltering(TokenValidatorFilter.java:70) [console-server-7.14.0.jar:?]
    at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:37) [console-common-7.14.0.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.bonitasoft.console.common.server.login.filter.ContentTypeSecurityFilter.proceedWithFiltering(ContentTypeSecurityFilter.java:65) [console-common-7.14.0.jar:?]
    at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:37) [console-common-7.14.0.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.bonitasoft.console.common.server.login.filter.FrameSecurityFilter.proceedWithFiltering(FrameSecurityFilter.java:66) [console-common-7.14.0.jar:?]
    at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:37) [console-common-7.14.0.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.bonitasoft.console.common.server.filter.NoCacheFilter.doFilter(NoCacheFilter.java:51) [console-common-7.14.0.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.58]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.58]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:9.0.58]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [catalina.jar:9.0.58]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) [catalina.jar:9.0.58]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [catalina.jar:9.0.58]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.58]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [catalina.jar:9.0.58]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:359) [catalina.jar:9.0.58]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-coyote.jar:9.0.58]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.58]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889) [tomcat-coyote.jar:9.0.58]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1735) [tomcat-coyote.jar:9.0.58]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.58]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-util.jar:9.0.58]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:9.0.58]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.58]
    at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: org.bonitasoft.engine.business.data.BusinessDataRepositoryDeploymentException: USERNAME=install | org.bonitasoft.engine.business.data.SBusinessDataRepositoryDeploymentException: org.bonitasoft.engine.business.data.generator.BDMJarGenerationException: org.bonitasoft.engine.business.data.generator.CodeGenerationException: Error when generating source files for business object model
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.installBusinessDataModel(TenantAdministrationAPIImpl.java:167) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.updateBusinessDataModel(TenantAdministrationAPIImpl.java:202) ~[bonita-server-7.14.0.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:431) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:399) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:395) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:125) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79) ~[bonita-common-7.14.0.jar:?]
    at com.sun.proxy.$Proxy136.updateBusinessDataModel(Unknown Source) ~[?:?]
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:64) ~[console-server-7.14.0.jar:?]
    ... 91 more
Caused by: org.bonitasoft.engine.business.data.SBusinessDataRepositoryDeploymentException: org.bonitasoft.engine.business.data.generator.BDMJarGenerationException: org.bonitasoft.engine.business.data.generator.CodeGenerationException: Error when generating source files for business object model
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.generateClientBDMZip(BusinessDataModelRepositoryImpl.java:267) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.createAndDeployClientBDMZip(BusinessDataModelRepositoryImpl.java:224) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.install(BusinessDataModelRepositoryImpl.java:164) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.lambda$installBusinessDataModel$1(TenantAdministrationAPIImpl.java:163) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.tenant.TenantStateManager.executeTenantManagementOperation(TenantStateManager.java:279) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.installBusinessDataModel(TenantAdministrationAPIImpl.java:162) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.updateBusinessDataModel(TenantAdministrationAPIImpl.java:202) ~[bonita-server-7.14.0.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:431) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:399) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:395) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:125) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79) ~[bonita-common-7.14.0.jar:?]
    at com.sun.proxy.$Proxy136.updateBusinessDataModel(Unknown Source) ~[?:?]
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:64) ~[console-server-7.14.0.jar:?]
    ... 91 more
Caused by: org.bonitasoft.engine.business.data.generator.BDMJarGenerationException: org.bonitasoft.engine.business.data.generator.CodeGenerationException: Error when generating source files for business object model
    at org.bonitasoft.engine.business.data.generator.AbstractBDMJarBuilder.build(AbstractBDMJarBuilder.java:70) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.generateClientBDMZip(BusinessDataModelRepositoryImpl.java:259) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.createAndDeployClientBDMZip(BusinessDataModelRepositoryImpl.java:224) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.install(BusinessDataModelRepositoryImpl.java:164) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.lambda$installBusinessDataModel$1(TenantAdministrationAPIImpl.java:163) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.tenant.TenantStateManager.executeTenantManagementOperation(TenantStateManager.java:279) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.installBusinessDataModel(TenantAdministrationAPIImpl.java:162) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.updateBusinessDataModel(TenantAdministrationAPIImpl.java:202) ~[bonita-server-7.14.0.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:431) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:399) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:395) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:125) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79) ~[bonita-common-7.14.0.jar:?]
    at com.sun.proxy.$Proxy136.updateBusinessDataModel(Unknown Source) ~[?:?]
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:64) ~[console-server-7.14.0.jar:?]
    ... 91 more
Caused by: org.bonitasoft.engine.business.data.generator.CodeGenerationException: Error when generating source files for business object model
    at org.bonitasoft.engine.business.data.generator.AbstractBDMJarBuilder.addSourceFilesToDirectory(AbstractBDMJarBuilder.java:79) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.client.ClientBDMJarBuilder.addSourceFilesToDirectory(ClientBDMJarBuilder.java:43) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.AbstractBDMJarBuilder.build(AbstractBDMJarBuilder.java:63) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.generateClientBDMZip(BusinessDataModelRepositoryImpl.java:259) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.createAndDeployClientBDMZip(BusinessDataModelRepositoryImpl.java:224) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.install(BusinessDataModelRepositoryImpl.java:164) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.lambda$installBusinessDataModel$1(TenantAdministrationAPIImpl.java:163) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.tenant.TenantStateManager.executeTenantManagementOperation(TenantStateManager.java:279) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.installBusinessDataModel(TenantAdministrationAPIImpl.java:162) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.updateBusinessDataModel(TenantAdministrationAPIImpl.java:202) ~[bonita-server-7.14.0.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:431) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:399) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:395) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:125) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79) ~[bonita-common-7.14.0.jar:?]
    at com.sun.proxy.$Proxy136.updateBusinessDataModel(Unknown Source) ~[?:?]
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:64) ~[console-server-7.14.0.jar:?]
    ... 91 more
Caused by: java.lang.IllegalArgumentException: Class com.company.model.CustomDemandModel already exists in target runtime environment
file:/opt/BonitaCommunity-2022.1-u0/server/temp/bonita_engine_436@ip-172-31-4-22.ap-southeast-1.compute.internal/platform/classloaders/local/TENANT/1/engine-classloader10309050609169181856/BDR18310324308165006357.jar
Current JVM Id where the class is found: 436@ip-172-31-4-22.ap-southeast-1.compute.internal
Make sure you did not manually add the jar files bdm-model.jar / bdm-dao.jar somewhere on the classpath.
Those jar files are handled by Bonita internally and should not be manipulated outside Bonita.
    at org.bonitasoft.engine.business.data.generator.EntityCodeGenerator.validateClassNotExistsInRuntime(EntityCodeGenerator.java:203) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.EntityCodeGenerator.addEntity(EntityCodeGenerator.java:68) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.AbstractBDMCodeGenerator.buildJavaModelFromBom(AbstractBDMCodeGenerator.java:78) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.AbstractBDMCodeGenerator.generateBom(AbstractBDMCodeGenerator.java:67) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.AbstractBDMJarBuilder.addSourceFilesToDirectory(AbstractBDMJarBuilder.java:77) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.client.ClientBDMJarBuilder.addSourceFilesToDirectory(ClientBDMJarBuilder.java:43) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.generator.AbstractBDMJarBuilder.build(AbstractBDMJarBuilder.java:63) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.generateClientBDMZip(BusinessDataModelRepositoryImpl.java:259) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.createAndDeployClientBDMZip(BusinessDataModelRepositoryImpl.java:224) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl.install(BusinessDataModelRepositoryImpl.java:164) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.lambda$installBusinessDataModel$1(TenantAdministrationAPIImpl.java:163) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.tenant.TenantStateManager.executeTenantManagementOperation(TenantStateManager.java:279) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.installBusinessDataModel(TenantAdministrationAPIImpl.java:162) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl.updateBusinessDataModel(TenantAdministrationAPIImpl.java:202) ~[bonita-server-7.14.0.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:431) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:399) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:395) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:269) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:125) ~[bonita-server-7.14.0.jar:?]
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79) ~[bonita-common-7.14.0.jar:?]
    at com.sun.proxy.$Proxy136.updateBusinessDataModel(Unknown Source) ~[?:?]
    at org.bonitasoft.web.rest.server.api.bdm.BusinessDataModelResource.addBDM(BusinessDataModelResource.java:64) ~[console-server-7.14.0.jar:?]
    ... 91 more

According to the log extract, it looks like there is a classoader issue, that's weird: 
Caused by: java.lang.IllegalArgumentException: Class com.company.model.CustomDemandModel already exists in target runtime environment
file:/opt/BonitaCommunity-2022.1-u0/server/temp/bonita_engine_436@ip-172-31-4-22.ap-southeast-1.compute.internal/platform/classloaders/local/TENANT/1/engine-classloader10309050609169181856/BDR18310324308165006357.jar
Current JVM Id where the class is found: 436@ip-172-31-4-22.ap-southeast-1.compute.internal
Make sure you did not manually add the jar files bdm-model.jar / bdm-dao.jar somewhere on the classpath.
Those jar files are handled by Bonita internally and should not be manipulated outside Bonita.

Can you try the following workaround and let me know if it helps?

You need to restart the platform:
Step 1 : ./stop-bonita.sh
Make sure your temp folder is cleaned: /opt/BonitaCommunity-2022.1-u0/server/temp/ 
Then Step 2: ./start-bonita.sh
Step 3: Deploy the BDM again, it should be a success.

Let me know?

Great! Yes, the info is here: https://documentation.bonitasoft.com/bonita/2022.1/runtime/database-configuration#postgres_setup

Good catch!