Installing Bonita 7.11 and Configuring it with MySQL

Hi I'm new to Bonita. I installed BonitaStudioCommunity edition and made necessary configurations as mentioned in https://documentation.bonitasoft.com/bonita/7.11/database-configuration . It mentions the steps of making changes in /setup/database.properties and running start-bonita.bat and I'm getting initialization errors. I've increased max_allowed_packet in MySQL config too. Since the studio fails to activate tomcat server, I downloaded Runtime bundle separately and tried again, and I get the same initialization error. But I can see the tables and necessary data are getting populated to the MySQL DB. The undermentioned is the error-log I'm getting. If anyone can help me to fix it, that would be great.

020-07-04 14:19:01.927 +0530 INFO (localhost-startStop-1) org.quartz.core.QuartzScheduler JobFactory set to: org.bonitasoft.engine.scheduler.impl.TransactionalSimpleJobFactory@5c9e5f6e
2020-07-04 14:19:02.333 +0530 INFO (localhost-startStop-1) org.quartz.core.QuartzScheduler Scheduler QuartzScheduler_$_NON_CLUSTERED started.
2020-07-04 14:19:02.898 +0530 WARN (localhost-startStop-1) org.hibernate.engine.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: S1000
2020-07-04 14:19:02.899 +0530 ERROR (localhost-startStop-1) org.hibernate.engine.jdbc.spi.SqlExceptionHelper Packet for query is too large (4,486,717 > 1,048,576). You can change this value on the server by setting the 'max_allowed_packet' variable.
2020-07-04 14:19:02.908 +0530 SEVERE (localhost-startStop-1) org.bonitasoft.engine.tenant.TenantServicesManager Error while executing the START of the service org.bonitasoft.engine.page.impl.PageServiceImpl
2020-07-04 14:19:03.007 +0530 SEVERE (localhost-startStop-1) org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita] Exception sending context initialized event to listener instance of class [org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener]
java.lang.RuntimeException: Error while initializing the Engine
    at org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener.contextInitialized(EngineInitializerListener.java:34)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:614)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1823)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.bonitasoft.engine.platform.StartNodeException: Platform starting failed.
    at org.bonitasoft.engine.api.impl.PlatformAPIImpl.startNode(PlatformAPIImpl.java:145)
    at org.bonitasoft.engine.EngineInitializer.initializeEngine(EngineInitializer.java:75)
    at org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener.contextInitialized(EngineInitializerListener.java:32)
    ... 13 more
Caused by: org.bonitasoft.engine.commons.exceptions.SLifecycleException: Unable to START a service. All services are STOPPED again. Error: Error while executing the START of the service org.bonitasoft.engine.transaction.JTATransactionServiceImpl: org.hibernate.exception.GenericJDBCException: could not execute statement
    at org.bonitasoft.engine.tenant.TenantServicesManager.doStart(TenantServicesManager.java:123)
    at org.bonitasoft.engine.tenant.TenantServicesManager.start(TenantServicesManager.java:87)
    at org.bonitasoft.engine.tenant.TenantStateManager.start(TenantStateManager.java:101)
    at org.bonitasoft.engine.platform.PlatformManager.start(PlatformManager.java:111)
    at org.bonitasoft.engine.api.impl.PlatformAPIImpl.startNode(PlatformAPIImpl.java:143)
    ... 15 more
Caused by: org.bonitasoft.engine.commons.exceptions.SLifecycleException: Error while executing the START of the service org.bonitasoft.engine.transaction.JTATransactionServiceImpl: org.hibernate.exception.GenericJDBCException: could not execute statement
    at org.bonitasoft.engine.tenant.TenantServicesManager.startServices(TenantServicesManager.java:146)
    at org.bonitasoft.engine.tenant.TenantServicesManager.lambda$null$0(TenantServicesManager.java:115)
    at org.bonitasoft.engine.tenant.TenantServicesManager.executeInClassloader(TenantServicesManager.java:208)
    at org.bonitasoft.engine.tenant.TenantServicesManager.lambda$null$1(TenantServicesManager.java:114)
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:286)
    at org.bonitasoft.engine.tenant.TenantServicesManager.lambda$doStart$2(TenantServicesManager.java:113)
    at org.bonitasoft.engine.tenant.TenantServicesManager.inTenantSession(TenantServicesManager.java:228)
    at org.bonitasoft.engine.tenant.TenantServicesManager.doStart(TenantServicesManager.java:111)
    ... 19 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement
    at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1535)
    at org.hibernate.query.internal.AbstractProducedQuery.uniqueResult(AbstractProducedQuery.java:1568)
    at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.selectOne(AbstractHibernatePersistenceService.java:342)
    at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.selectOne(AbstractHibernatePersistenceService.java:262)
    at org.bonitasoft.engine.page.impl.PageServiceImpl.getPageByName(PageServiceImpl.java:356)
    at org.bonitasoft.engine.page.impl.PageServiceImpl.importProvidedPage(PageServiceImpl.java:632)
    at org.bonitasoft.engine.page.impl.PageServiceImpl.importProvidedPage(PageServiceImpl.java:622)
    at org.bonitasoft.engine.page.impl.PageServiceImpl.start(PageServiceImpl.java:612)
    at org.bonitasoft.engine.tenant.TenantServicesManager.startServices(TenantServicesManager.java:140)
    ... 26 more
Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3226)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3751)
    at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:91)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
    at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
    at java.util.LinkedHashMap.forEach(Unknown Source)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:348)
    at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:57)
    at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:108)
    at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1309)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1389)
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1558)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1526)
    ... 34 more
Caused by: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (4,486,717 > 1,048,576). You can change this value on the server by setting the 'max_allowed_packet' variable.
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:107)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1109)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1057)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1377)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1042)
    at com.mysql.cj.jdbc.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:595)
    at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
    at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
    ... 48 more

2020-07-04 14:19:03.446 +0530 SEVERE (localhost-startStop-1) org.bonitasoft.console.common.server.servlet.PlatformTenantListener Error while initializing the default tenant
org.bonitasoft.engine.exception.BonitaRuntimeException: USERNAME=install | java.lang.NullPointerException
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.wrapThrowable(ServerAPIImpl.java:143)
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:131)
    at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:79)
    at com.sun.proxy.$Proxy103.getLastUpdateDate(Unknown Source)
    at org.bonitasoft.forms.server.ThemeExtractor.getThemeLastUpdateDateFromEngine(ThemeExtractor.java:82)
    at org.bonitasoft.forms.server.ThemeExtractor.retrieveAndExtractCurrentTheme(ThemeExtractor.java:46)
    at org.bonitasoft.console.common.server.servlet.PlatformTenantListener.initializeDefaultTenant(PlatformTenantListener.java:78)
    at org.bonitasoft.console.common.server.servlet.PlatformTenantListener.contextInitialized(PlatformTenantListener.java:64)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:614)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1823)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at org.bonitasoft.engine.theme.impl.ThemeServiceImpl.getLastUpdateDate(ThemeServiceImpl.java:204)
    at org.bonitasoft.engine.api.impl.ThemeAPIImpl.getLastUpdateDate(ThemeAPIImpl.java:86)
    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:427)
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.lambda$invokeAPIInTransaction$1(ServerAPIImpl.java:395)
    at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:286)
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:391)
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:265)
    at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:121)
    ... 19 more

Hi,

Studio comes with an embedded engine using h2 database, it is not supported to plug another database for this environment.

You need to install a bundle.

The exception you get talk about packet size, there is a specific paragraph in the doc about packet size and MySQL. Did you see it ?

Maximum packet size

MySQL defines a maximum packet size on the server side. The default value for this setting is appropriate for most standard use cases. However, you need to increase the packet size if you see the following error: Error: 1153 SQLSTATE: 08S01 (ER_NET_PACKET_TOO_LARGE) Message: Got a packet bigger than ‘max_allowed_packet’ bytes
You need to update the file my.ini (for Windows) or my.cnf (for Linux) to avoid the ER_NET_PACKET_TOO_LARGE problem. Look for max_allowed_packet setting and increase the value.

For more information, see the MySQL website.

HTH
Romain

I'm not particularly sure anything on bundle. Please put me the documentation link if you have. Also for your info my initial max_allowed_packet was 16M, but i increased upto 128M when I got the above error. What is the max size do you recommend?

It's in the same doc article.

In the log the packet is 4,486,717 bytes (about 4.5 Mo) and the max is 1,048,576 bytes (1Mb).

So I suggest setting max_allowed_packet=128M  in my.cnf or my.ini