Bonita 7.10 MySQL error: Could not open connection

1
0
-1

Hi, I work on a University on Argentina, and we just started to migrate and digitalize all our process to Bonita bpm.

We recently installed Bonita bpm 7.10 and integrated with MySQL.

When I import the Organization, its Ok. When I install the Business Data Model (BDM), its Ok, -When I install de the process, its ok.

But, when I execute the process and try to create a new case and submit the form, I get the next error:

"Error when starting the case". Error: {"exception":"class org.bonitasoft.engine.exception.BonitaRuntimeException","message":"USERNAME=svismara | org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection"}

The configuration parameters its ok. I think that if there is a problem with the connection then the BDM and actors can't create the tables and persist the actors on the database.

So, I really don't know what is the problem when I submit a new case or process instance.

I try to resolve this for a week, but I cant fixed.

On my Bonita Studio localhost and H2 databases, work fine, but when I deploy on bonita server, its crashes.

We need real help!...All RRHH on the university need that this work!

This is the log.

2020-02-18 11:27:51.286 -0300 WARN: org.hibernate.engine.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: null
2020-02-18 11:27:51.286 -0300 ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper Unable to enlist connection in transaction: enlistResource returns 'false'.
2020-02-18 11:27:51.291 -0300 SEVERE: org.restlet.Component.BonitaRestletApplication Exception or error caught in server resource
org.bonitasoft.engine.exception.BonitaRuntimeException: USERNAME=svismara | org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.bonitasoft.engine.api.impl.ServerAPIImpl.wrapThrowable(ServerAPIImpl.java:142)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:130)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:82)
at com.sun.proxy.$Proxy85.startProcessWithInputs(Unknown Source)
at org.bonitasoft.web.rest.server.api.bpm.process.ProcessInstantiationResource.instantiateProcess(ProcessInstantiationResource.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:508)
at org.restlet.resource.ServerResource.post(ServerResource.java:1341)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:606)
at org.bonitasoft.web.rest.server.api.resource.CommonResource.doHandle(CommonResource.java:206)
at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:662)
at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)
at org.restlet.resource.ServerResource.handle(ServerResource.java:1020)
at org.restlet.resource.Finder.handle(Finder.java:236)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Router.doHandle(Router.java:422)
at org.restlet.routing.Router.handle(Router.java:641)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77)
at org.restlet.Application.handle(Application.java:385)
at org.bonitasoft.web.rest.server.BonitaRestletApplication.handle(BonitaRestletApplication.java:191)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Router.doHandle(Router.java:422)
at org.restlet.routing.Router.handle(Router.java:641)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Router.doHandle(Router.java:422)
at org.restlet.routing.Router.handle(Router.java:641)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
at org.restlet.Component.handle(Component.java:408)
at org.restlet.Server.handle(Server.java:507)
at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.bonitasoft.console.common.server.login.filter.AbstractAuthorizationFilter.doFilter(AbstractAuthorizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.bonitasoft.console.common.server.filter.NoCacheFilter.doFilter(NoCacheFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
at org.bonitasoft.console.common.server.page.CustomPageRequestModifier.forwardIfRequestIsAuthorized(CustomPageRequestModifier.java:61)
at org.bonitasoft.console.common.server.page.PageServlet.service(PageServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.bonitasoft.console.common.server.filter.CacheFilter.proceedWithFiltering(CacheFilter.java:74)
at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.excludePatternFiltering(ExcludingPatternFilter.java:42)
at org.bonitasoft.console.common.server.filter.ExcludingPatternFilter.doFilter(ExcludingPatternFilter.java:35)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.bonitasoft.console.common.server.login.filter.AbstractAuthorizationFilter.doFilter(AbstractAuthorizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.bonitasoft.engine.business.data.impl.JPABusinessDataRepositoryImpl.merge(JPABusinessDataRepositoryImpl.java:372)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.saveBusinessData(ProcessExecutorImpl.java:466)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeSingleBusinessData(ProcessExecutorImpl.java:446)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeBusinessData(ProcessExecutorImpl.java:432)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.initialize(ProcessExecutorImpl.java:384)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:839)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:797)
at org.bonitasoft.engine.api.impl.ProcessStarter.start(ProcessStarter.java:132)
at org.bonitasoft.engine.api.impl.ProcessStarter.start(ProcessStarter.java:103)
at org.bonitasoft.engine.api.impl.ProcessAPIImpl.startProcessWithInputs(ProcessAPIImpl.java:2974)
at org.bonitasoft.engine.api.impl.ProcessAPIImpl.startProcessWithInputs(ProcessAPIImpl.java:2968)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:399)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:371)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:368)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:256)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:120)
... 111 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:1206)
at org.bonitasoft.engine.business.data.impl.JPABusinessDataRepositoryImpl.merge(JPABusinessDataRepositoryImpl.java:370)
... 131 more
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:235)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:63)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:124)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:122)
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:55)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:492)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:197)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:181)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:216)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:334)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:289)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:126)
at org.hibernate.jpa.event.internal.core.JpaMergeEventListener.saveWithGeneratedId(JpaMergeEventListener.java:73)
at org.hibernate.event.internal.DefaultMergeEventListener.saveTransientEntity(DefaultMergeEventListener.java:271)
at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:251)
at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:189)
at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:85)
at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:876)
at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:858)
at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:863)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:1196)
... 132 more
Caused by: java.sql.SQLException: Unable to enlist connection in transaction: enlistResource returns 'false'.
at org.apache.tomcat.dbcp.dbcp2.managed.TransactionContext.setSharedConnection(TransactionContext.java:110)
at org.apache.tomcat.dbcp.dbcp2.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:310)
at org.apache.tomcat.dbcp.dbcp2.managed.ManagedConnection.(ManagedConnection.java:89)
at org.apache.tomcat.dbcp.dbcp2.managed.ManagedDataSource.getConnection(ManagedDataSource.java:64)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:794)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228)
... 158 more

1 answer

1
0
-1

Hi remoncristian,

Bonita server uses distributed or XA transactions because more often than not the transaction has to be executed on both engine and BDM databases. Therefore, in order to be able to integrate the Bonita server with your own database server (MySQL, in your case), XA transactions must be enabled in the latter.

As the documentation explains, when integrating Bonita with a MySQL server, this is what you need to do:

XA Transactions

To support XA transactions, starting from MySQL 8.0, special XA rights must be granted to the database user. For example, if the users for the Bonita BPM and BDM databases are bonita and business_data respectively, you should run the following command:

GRANT XA_RECOVER_ADMIN ON *.* to bonita, business_data;
FLUSH PRIVILEGES;

Can you please go over the documentation section covering the required MySQL customisations and check you have applied them all in your database?

Let me know if this helps.

Regards,

Unai

Comments

Submitted by remoncristian on Thu, 02/20/2020 - 18:11

Thanks a Lot Unai!!!!....I will try your suggestion and will let you know.

thanks a again!

Cristian

Submitted by remoncristian on Fri, 02/21/2020 - 19:06

Hi Unai

I did make an upgrade for MySQL 5.7 to MySql 8, execute the sentence that you recommended:

"GRANT XA_RECOVER_ADMIN ON *.* to bonita, business_data;
FLUSH PRIVILEGES;"

...but nothing happend, the error appear again!. :

"Error when starting the case". Error: {"exception":"class org.bonitasoft.engine.exception.BonitaRuntimeException","message":"USERNAME=svismara | org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection"}

I think, that the problem is at the process when generate de .bar file. Some library or dependency is missing!

I send you in the links images below, :

1)screen capture of process estructure,

2) mySQL users privileges (bonita, business_data)

3) JAR files into server lib bonita

4) configuration file of datasources (bonita.xml file from path: "...bonita/server/conf/Catalina/localhost/bonita.xml"):











auth="Container"
type="com.mysql.cj.jdbc.MysqlXADataSource"
class="com.mysql.cj.jdbc.MysqlXADataSource"
factory="com.mysql.cj.jdbc.MysqlDataSourceFactory"
description="Raw Bonita Datasource"
closeMethod="close"
loginTimeout="0"
serverName="localhost"
portNumber="3306"
port="3306"
databaseName="BonitaBPM"
user="bonita"
password="passXXXX"
explicitUrl="true"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

uniqueName="jdbc/bonitaDSXA"
auth="Container"
factory="org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory"
transactionManager="TransactionManager"
type="javax.sql.XADataSource"
initialSize="8"
maxTotal="50"
minIdle="8"
maxIdle="16"
defaultAutoCommit="false"
validationQuery="SELECT 1"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
logAbandoned="true"
testOnBorrow="true"
xaDataSource="RawBonitaDS" />

auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"
maxTotal="5"
minIdle="1"
maxIdle="5"
maxWaitMillis="10000"
initialSize="1"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
logAbandoned="true"
testOnBorrow="true"
validationQuery="SELECT 1"
username="bonita"
password="passXXXX"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />




auth="Container"
type="com.mysql.cj.jdbc.MysqlXADataSource"
class="com.mysql.cj.jdbc.MysqlXADataSource"
factory="com.mysql.cj.jdbc.MysqlDataSourceFactory"
description="Raw Bonita Business Data Datasource"
closeMethod="close"
loginTimeout="0"
serverName="localhost"
portNumber="3306"
port="3306"
databaseName="BonitaBPM"
user="bonita"
password="passXXXX"
explicitUrl="true"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

name="BusinessDataDS"
uniqueName="jdbc/BusinessDataDSXA"
auth="Container"
factory="org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory"
transactionManager="TransactionManager"
type="javax.sql.XADataSource"
initialSize="4"
maxTotal="20"
minIdle="4"
maxIdle="10"
defaultAutoCommit="false"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
logAbandoned="true"
testOnBorrow="true"
validationQuery="SELECT 1"
xaDataSource="RawBusinessDataDS" />

auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"
maxTotal="5"
minIdle="1"
maxIdle="5"
maxWaitMillis="10000"
initialSize="1"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
logAbandoned="true"
testOnBorrow="true"
validationQuery="SELECT 1"
username="bonita"
password="passXXXX"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />





Our doubts are:

1) could be possible that there are missing any file dependencies on the .bar file?

2) could be possible that there are missing any database's user in configuration file to allow the process to persist the information when submit data?

thank a lot for your help ....we waiting for your answer

you have a nice day

Cristian

Submitted by unai.gaston.caminos on Tue, 03/10/2020 - 17:10

Hi Cristian,

Sorry for the late answer.

I believe the problem may come from the fact that you have specified the same database for both engine and BDM databases:

Engine datasources:

auth="Container"
type="com.mysql.cj.jdbc.MysqlXADataSource"
class="com.mysql.cj.jdbc.MysqlXADataSource"
factory="com.mysql.cj.jdbc.MysqlDataSourceFactory"
description="Raw Bonita Datasource"
...
databaseName="BonitaBPM"
user="bonita"
password="passXXXX"
explicitUrl="true"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

...

name="bonitaSequenceManagerDS"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"
...
username="bonita"
password="passXXXX"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

BDM datasources:

auth="Container"
type="com.mysql.cj.jdbc.MysqlXADataSource"
class="com.mysql.cj.jdbc.MysqlXADataSource"
factory="com.mysql.cj.jdbc.MysqlDataSourceFactory"
description="Raw Bonita Business Data Datasource"
...
databaseName="BonitaBPM"
user="bonita"
password="passXXXX"
explicitUrl="true"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

...

name="NotManagedBizDataDS"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"
...
username="bonita"
password="passXXXX"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/BonitaBPM?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true" />

Could you try creating a separate database for your BDM (e.g. BonitaBDM) and create another user on that database (e.g. business_data)?

(Please make sure to perform the "GRANT XA_RECOVER_ADMIN ON ..." and "FLUSH PRIVILEGES" commands on that new database and corresponding user too.)

For your information, the best practice is to have one database for the engine tables and another database for the BDM tables.

Please let me know if this helps.

Kind regards,

Unai

Notifications