Modify bonita.war results in can't retrieve default Id

Hello people I'm trying to make a really small change (change the background css from portal from being red to blue) in bonita.war. I unzipped it, modified the css, the ziped it again. But when I try to run it on tomcat I get the following error:

Exception report message org.bonitasoft.console.common.server.utils.DefaultTenantIdException: Can't retrieve default tenant id description The server encountered an internal error that prevented it from fulfilling this request. exception javax.servlet.ServletException: org.bonitasoft.console.common.server.utils.DefaultTenantIdException: Can't retrieve default tenant id org.bonitasoft.console.common.server.sso.filter.InternalSSOFilter.doFilter(InternalSSOFilter.java:109) root cause org.bonitasoft.console.common.server.utils.DefaultTenantIdException: Can't retrieve default tenant id org.bonitasoft.console.common.server.utils.TenantsManagementUtils.getDefaultTenantId(TenantsManagementUtils.java:205) org.bonitasoft.console.common.server.login.TenantIdAccessor.getDefaultTenantId(TenantIdAccessor.java:52) org.bonitasoft.console.common.server.login.TenantIdAccessor.ensureTenantId(TenantIdAccessor.java:46) org.bonitasoft.console.common.server.login.filter.AutoLoginRule.doAuthorize(AutoLoginRule.java:31) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.isAuthorized(AuthorizationFilter.java:86) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.doAuthorizationFiltering(AuthorizationFilter.java:68) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:58) org.bonitasoft.console.common.server.sso.filter.InternalSSOFilter.doFilter(InternalSSOFilter.java:103) root cause org.bonitasoft.engine.platform.NodeNotStartedException: The current node has not been started yet. Method PlatformAPI.startNode() must be called previously. org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:213) org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:105) org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88) com.sun.proxy.$Proxy0.login(Unknown Source) org.bonitasoft.console.common.server.utils.TenantsManagementUtils.getDefaultTenantId(TenantsManagementUtils.java:200) org.bonitasoft.console.common.server.login.TenantIdAccessor.getDefaultTenantId(TenantIdAccessor.java:52) org.bonitasoft.console.common.server.login.TenantIdAccessor.ensureTenantId(TenantIdAccessor.java:46) org.bonitasoft.console.common.server.login.filter.AutoLoginRule.doAuthorize(AutoLoginRule.java:31) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.isAuthorized(AuthorizationFilter.java:86) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.doAuthorizationFiltering(AuthorizationFilter.java:68) org.bonitasoft.console.common.server.login.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:58) org.bonitasoft.console.common.server.sso.filter.InternalSSOFilter.doFilter(InternalSSOFilter.java:103)

 

any ideas? I'm lost here

What gusto2 said worked, i was able to test and develop on the working directory, but when redeployed the bonita.war, I got the same 

"cant retrieve default tenant id" error, it turns out bonita was trying to create the bonita journal's tables in mysql, but they were already created, thus, it failed.

So, I backed up the DB, dropped the tables, re-created it and it worked

reading catalina logs, I think it might have something to do with this error, but im still clueless

org.hibernate.connection.DatasourceConnectionProvider configure
SEVERE: Could not find datasource: java:comp/env/bonitaDS
javax.naming.NamingException: no resource registered with uniqueName 'jdbc/bonitaDSXA', available resources: []
    at bitronix.tm.resource.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:55)

Hi, I have no asnwer, just an idea. When you have a clean working BonitaBPM instance (let's assume a Tomcat bundle), there's an application context file: ./conf/Catalina/{host}/bonita.xml where the datasource is defined. However - if you redeploy the war file, it may get deleted (by undeploy) and I see no context.xml in the bonita.war, so no new context file is deployed automatically. Try to preserve and redeploy the context file.

Or - as a solution - developing - update the working directory (not the WAR). For deployment - update the WAR in the deployment bundle, but redeploy with all configuration files (all the conf/ folder) updates.

Gabriel

thanks for the tips!

I'm able to develop and test using the working directory, but for deployment, even if I copy context. xml and bonita.xml after deployment, I still get the same error.

I tried to modify bonita.war on the bundle, and then do a clean install on a clean machine and I still get the error

Dear Alsonso,

Can you explain in more detail how did you accomplish this, step by step if possible?

Thank you for your time.

Hi Everyone,

Can anyone explain the steps to change the bonita database from h2 to mysql/postgres. I am receiving the same tenant Id exception(Error while initializing the default tenant — The current node has not been started yet. Method PlatformAPI.startNode() must be called previously). I modified each file specified in the documentation http://documentation.bonitasoft.com/database-configuration-2

MySQL Test:
I tried to change database to mysql, bonita tables got imported to database but localhost:8080/bonita portal doesn’t work (shows 500 Error).
PostGres Test:
I tried to change database to postgres, bonita tables didn’t import and localhost:8080/bonita portal doesn’t work (shows 500 Error).

Any help would be needful.

Thanks,
Sindhu