Bonitasoft 7.0.1 - Tomcat bundle - Switching to MySql

Hi,
I am trying to switch the database from H2 to MySql and i am getting when i start my tomcat server.
I followed the steps from documentation.
I am getting below error. Please help.

2015-08-06 14:43:21.781 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initializeEngine
INFO: Initializing Bonita Engine…
2015-08-06 14:43:21.782 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initializeEngine
INFO: Initializing Spring context…
2015-08-06 14:43:34.414 -0400 org.hibernate.type.TypeFactory org.hibernate.type.TypeFactory$TypeScopeImpl injectSessionFactory
WARN: HHH000233: Scoping types to session factory org.hibernate.internal.SessionFactoryImpl@329913c7 after already scoped org.hibernate.internal.SessionFactoryImpl@35f2b7ea
2015-08-06 14:43:39.259 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initializeEngine
INFO: Initializing platform…
2015-08-06 14:43:39.260 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initPlatform
INFO: Creating platform…
2015-08-06 14:43:40.491 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initializeEngine
INFO: Platform initialized successfully.
2015-08-06 14:43:40.491 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer startPlatform
INFO: Starting platform…
2015-08-06 14:43:40.742 -0400 org.bonitasoft.engine.EngineInitializer org.bonitasoft.engine.EngineInitializer initializeEngine
INFO: Exception while initializing the engine: org.bonitasoft.engine.platform.StartNodeException: Platform starting failed.
2015-08-06 14:43:40.742 -0400 org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener contextInitialized
SEVERE: Error while initializing the Engine
org.bonitasoft.engine.platform.StartNodeException: Platform starting failed.
at org.bonitasoft.engine.api.impl.PlatformAPIImpl.startNode(PlatformAPIImpl.java:248)
at org.bonitasoft.engine.PlatformTenantManager.updatePlatform(PlatformTenantManager.java:53)
at org.bonitasoft.engine.PlatformTenantManager.startPlatform(PlatformTenantManager.java:60)
at org.bonitasoft.engine.EngineInitializer.startPlatform(EngineInitializer.java:147)
at org.bonitasoft.engine.EngineInitializer.initializeEngine(EngineInitializer.java:101)
at org.bonitasoft.engine.api.internal.servlet.EngineInitializerListener.contextInitialized(EngineInitializerListener.java:42)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1862)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bonitasoft.engine.exception.BonitaRuntimeException: java.io.IOException: Folder denoted by path C:\BonitaBPM7\bonita\engine-server\work\tenants\1 does not exist.
at org.bonitasoft.engine.service.impl.SpringFileSystemBeanAccessor.getContext(SpringFileSystemBeanAccessor.java:80)
at org.bonitasoft.engine.service.impl.SpringFileSystemBeanAccessor.getService(SpringFileSystemBeanAccessor.java:39)
at org.bonitasoft.engine.service.impl.SpringTenantServiceAccessor.getSessionService(SpringTenantServiceAccessor.java:297)
at org.bonitasoft.engine.api.impl.PlatformAPIImpl.beforeServicesStartOfRestartHandlersOfTenant(PlatformAPIImpl.java:371)
at org.bonitasoft.engine.api.impl.PlatformAPIImpl.startNode(PlatformAPIImpl.java:230)
… 18 more
Caused by: java.io.IOException: Folder denoted by path C:\BonitaBPM7\bonita\engine-server\work\tenants\1 does not exist.
at org.bonitasoft.engine.home.Folder.checkFolderExists(Folder.java:52)
at org.bonitasoft.engine.home.Folder.listFiles(Folder.java:83)
at org.bonitasoft.engine.home.BonitaHomeServer.getXmlResourcesOfFolder(BonitaHomeServer.java:165)
at org.bonitasoft.engine.home.BonitaHomeServer.getConfigurationFiles(BonitaHomeServer.java:175)
at org.bonitasoft.engine.home.BonitaHomeServer.getTenantConfigurationFiles(BonitaHomeServer.java:203)
at org.bonitasoft.engine.service.impl.SpringTenantFileSystemBeanAccessor.getResources(SpringTenantFileSystemBeanAccessor.java:42)
at org.bonitasoft.engine.service.impl.SpringFileSystemBeanAccessor.getContext(SpringFileSystemBeanAccessor.java:70)
… 22 more

2015-08-06 14:43:40.960 -0400 org.bonitasoft.console.common.server.servlet.PlatformTenantListener org.bonitasoft.console.common.server.servlet.PlatformTenantListener contextInitialized
SEVERE: Error while initializing the default tenant
org.bonitasoft.engine.platform.NodeNotStartedException: The current node has not been started yet. Method PlatformAPI.startNode() must be called previously.
at org.bonitasoft.engine.api.impl.ServerAPIImpl.checkMethodAccessibility(ServerAPIImpl.java:290)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIOutsideTransaction(ServerAPIImpl.java:283)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:276)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:131)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
at com.sun.proxy.$Proxy7.login(Unknown Source)
at org.bonitasoft.console.common.server.servlet.PlatformTenantListener.initializeDefaultTenant(PlatformTenantListener.java:61)
at org.bonitasoft.console.common.server.servlet.PlatformTenantListener.contextInitialized(PlatformTenantListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1862)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Hi,

this trace seems to says that you started a Tomcat bundle with H2, that initialized an H2 database and fill initial bonita-home folder, then stop it, changed configuration to MySql, then restarted Tomcat.

Is it more or less what you did ?

If so, your database and your bonita-home folder are out-of-sync. “Switching” between database vendors will not work. If you want to start a fresh Tomcat bundle configured with MySql, do required change in database settings prior to first start of the Tomcat

L.

Fixed as above

Hi,
i am new bonitasoft ,
i need only eclipse with bonitasoft project

Regards
Ram

Thank you Laurent for your reply, but i did made the changes before i start the tomcat server.
You are recommending that i need to start the tomcat with H2 first and then stop it and change that to MySql?

Thanks,
Phani

No, no, no. Laurent is correct.

It looks like you might have done it right but something is wrong.

To do this correctly you must:

Download
Extract - DO NOT start the services

follow these instructions: http://documentation.bonitasoft.com/database-configuration-2
Note this issue with MySQL: http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html
Note: *MySQL does not support surrogate characters. If you want to use surrogate characters in your processes, you need to use another type of database. *

You should also have a look at: http://documentation.bonitasoft.com/database-configuration-business-data-1

Actually - @Laurent - (Bonita should) have a look at these instructions, maybe the part 1) another database and 2) BDM database should be combined now that BDM is in all versions…

regards

Hi Sean,
Thank you for your reply and removed existing installation and redid it from scratch and it worked. :slight_smile:
Thank you,
Phani

Hi kishoreup, I’m sorry to disturb you… but I’m having the same problem while trying to configure Bonita to use Mysql database. I followed all the instructions in the Bonita documentation but still Tomcat try to initialize with an h2 database.

Did u get the same exception ?

Caused by: java.util.NoSuchElementException: Cannot find a Listener with classname org.bonitasoft.tomcat.H2Listener
at org.bonitasoft.studio.engine.server.PortConfigurator.findListenerWithClassName(PortConfigurator.java:171)
at org.bonitasoft.studio.engine.server.PortConfigurator.h2TCPPort(PortConfigurator.java:157)