How to connect postgres database

In my process I am using BDM (bussiness data) bussiness object and attributes to that. I configured database.properties file with postgres . But, I am able to see only engine daabase I want to see BDM database also which I created busssiness object table and data in that table.Please help me in getting Bussiness database also. Thanks

Hello.

 

In the database.properties file there should be 2 parts, one for engine database, the other one for business data database.

All properties for engine database are prefixed by db.: db.vendor, db.server.name, db.server.port and so on

All properties for business data database are prefixed by bdm.db.: bdm.db.vendor, bdm.db.server.name and so on

Did you configure both?

 

HTH

Hi baptiste.mesta ,Thank you for your response. yes I configured the same as below, but still I am able to see only db.database.name=bonitaDB not the second one.Please help me


#########################################
# Bonita database properties
#########################################

# valid values are (h2, postgres, sqlserver, oracle, mysql)
db.vendor=postgres
# when using h2, no server or port setting is needed since connexion is made using file protocol mode using relative directory:
db.server.name=localhost
db.server.port=5432
# if your database name contains a backslash (\) character, you must double it (\\):
db.database.name=bonitaDB
db.user=rainbow
# if your database password contains a backslash (\) character, you must double it (\\):
db.password=XXXXXXXX

###################################
# Business Data database properties
###################################
# valid values are (h2, postgres, sqlserver, oracle, mysql)
bdm.db.vendor=postgres
bdm.db.server.name=localhost
bdm.db.server.port=5432
bdm.db.database.name=bussiness_data
bdm.db.user=rainbow
bdm.db.password=XXXXXXXX

Hello,

You should be able to access the tables of your business data by connecting to your postgres directly.

However the database is not the same as the one for bonita tables: bdm.db.database.name=bussiness_data

I am getting below error. please explain me where I want to change files from H2 to postgres


java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.postEngineStart(BOSEngineManager.java:150)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:139)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:144)
    at org.bonitasoft.studio.engine.server.StartEngineJob.run(StartEngineJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.io.IOException: Error while executing POST request (http code: 404) <POST http://localhost:8080/bonita/serverAPI/org.bonitasoft.engine.api.LoginAPI/login HTTP/1.1>
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:144)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.postEngineStart(BOSEngineManager.java:150)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:139)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:144)
    at org.bonitasoft.studio.engine.server.StartEngineJob.run(StartEngineJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    at     < ========== Beginning of the server stack trace ========== >. ( )
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:177)
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:139)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    ... 6 more
Caused by: org.apache.http.client.HttpResponseException:
    at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:69)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:65)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:51)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:169)
    ... 8 more

!ENTRY org.bonitasoft.studio.common 4 0 2020-06-01 11:00:03.390
!MESSAGE
!STACK 0
java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.postEngineStart(BOSEngineManager.java:150)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:139)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:144)
    at org.bonitasoft.studio.engine.BOSEngineManager.loginTenant(BOSEngineManager.java:271)
    at org.bonitasoft.studio.engine.BOSEngineManager.createSession(BOSEngineManager.java:351)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeployProcess(UndeployProcessOperation.java:137)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeploy(UndeployProcessOperation.java:107)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.run(UndeployProcessOperation.java:99)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.undeploy(DeployProcessOperation.java:312)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.run(DeployProcessOperation.java:110)
    at org.bonitasoft.studio.engine.operation.RunProcessOperation.run(RunProcessOperation.java:88)
    at org.bonitasoft.studio.engine.command.RunProcessCommand$1.run(RunProcessCommand.java:122)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.io.IOException: Error while executing POST request (http code: 404) <POST http://localhost:8080/bonita/serverAPI/org.bonitasoft.engine.api.LoginAPI/login HTTP/1.1>
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:144)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.postEngineStart(BOSEngineManager.java:150)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:139)
    at org.bonitasoft.studio.engine.BOSEngineManager.start(BOSEngineManager.java:144)
    at org.bonitasoft.studio.engine.BOSEngineManager.loginTenant(BOSEngineManager.java:271)
    at org.bonitasoft.studio.engine.BOSEngineManager.createSession(BOSEngineManager.java:351)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeployProcess(UndeployProcessOperation.java:137)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeploy(UndeployProcessOperation.java:107)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.run(UndeployProcessOperation.java:99)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.undeploy(DeployProcessOperation.java:312)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.run(DeployProcessOperation.java:110)
    at org.bonitasoft.studio.engine.operation.RunProcessOperation.run(RunProcessOperation.java:88)
    at org.bonitasoft.studio.engine.command.RunProcessCommand$1.run(RunProcessCommand.java:122)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    at     < ========== Beginning of the server stack trace ========== >. ( )
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:177)
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:139)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    ... 14 more
Caused by: org.apache.http.client.HttpResponseException:
    at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:69)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:65)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:51)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:169)
    ... 16 more

!ENTRY org.bonitasoft.studio.engine 1 0 2020-06-01 11:00:03.391
!MESSAGE Attempt to login as walter.bates

!ENTRY org.bonitasoft.studio.common 4 0 2020-06-01 11:00:03.392
!MESSAGE
!STACK 0
java.lang.Exception: Attempt to login with user walter.bates has failed! Please check that this user exists in the active organization and/or that the password is correct in your run configuration of SamplePool (1.0).
    at org.bonitasoft.studio.engine.BOSEngineManager.createSession(BOSEngineManager.java:354)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeployProcess(UndeployProcessOperation.java:137)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeploy(UndeployProcessOperation.java:107)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.run(UndeployProcessOperation.java:99)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.undeploy(DeployProcessOperation.java:312)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.run(DeployProcessOperation.java:110)
    at org.bonitasoft.studio.engine.operation.RunProcessOperation.run(RunProcessOperation.java:88)
    at org.bonitasoft.studio.engine.command.RunProcessCommand$1.run(RunProcessCommand.java:122)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.loginTenant(BOSEngineManager.java:273)
    at org.bonitasoft.studio.engine.BOSEngineManager.createSession(BOSEngineManager.java:351)
    ... 8 more
Caused by: java.io.IOException: Error while executing POST request (http code: 404) <POST http://localhost:8080/bonita/serverAPI/org.bonitasoft.engine.api.LoginAPI/login HTTP/1.1>
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:144)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    at com.sun.proxy.$Proxy67.login(Unknown Source)
    at org.bonitasoft.studio.engine.BOSEngineManager.loginTenant(BOSEngineManager.java:273)
    at org.bonitasoft.studio.engine.BOSEngineManager.createSession(BOSEngineManager.java:351)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeployProcess(UndeployProcessOperation.java:137)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.undeploy(UndeployProcessOperation.java:107)
    at org.bonitasoft.studio.engine.operation.UndeployProcessOperation.run(UndeployProcessOperation.java:99)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.undeploy(DeployProcessOperation.java:312)
    at org.bonitasoft.studio.engine.operation.DeployProcessOperation.run(DeployProcessOperation.java:110)
    at org.bonitasoft.studio.engine.operation.RunProcessOperation.run(RunProcessOperation.java:88)
    at org.bonitasoft.studio.engine.command.RunProcessCommand$1.run(RunProcessCommand.java:122)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    at     < ========== Beginning of the server stack trace ========== >. ( )
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:177)
    at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:139)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    ... 11 more
Caused by: org.apache.http.client.HttpResponseException:
    at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:69)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:65)
    at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:51)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
    at org.bonitasoft.engine.api.HTTPServerAPI.executeHttpPost(HTTPServerAPI.java:169)
    ... 13 more

Hello.

It looks like, according to the stack trace, that you are in a Studio environment. The Studio uses an embedded H2 database.

Changing the database is only supported for the distribution installation, not for the studio development environment.

Information on that is available here: https://documentation.bonitasoft.com/bonita/7.10/tomcat-bundle