Can't retrieve default tenant id

 
Bonita BPM Community 6.2.2 bundled with Tomcat
Ubuntu 12.10 64bit with Oracle Java version 7.51
 
Tomcat is running, when I access http://localhost:8080 I get the default tomcat home page, add /bonita I get the following error message;
 
HTTP Status 500 - org.bonitasoft.console.common.server.utils.DefaultTenantIdException: Can't retrieve default tenant id
Reviewing the log I find

Feb 27, 2014 10:42:09 AM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: localhost:9091" [90067-170])

Further down in the log I find this;

aused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: localhost:9091" [90067-170]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
 at org.h2.message.DbException.get(DbException.java:158)
 at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:399)
 at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:287)
 at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:109)
 at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:93)
 at org.h2.Driver.connect(Driver.java:72)

I have completely removed reference to the H2 listener from server.xml, following is the line I removed;

<Listener className="org.bonitasoft.tomcat.H2Listener" tcpPort="9091" baseDir="${catalina.home}/bonita/server/platform/work" start="true" />

I'm connecting to a mysql database on an external server, I have updated bitronix-resources.properties to point to my sql server as shown;

 

esource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
resource.ds1.driverProperties.user=xxxx
resource.ds1.driverProperties.password=xxxx
resource.ds1.driverProperties.URL=jdbc:mysql://srvmysql:3306/bonita?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8
resource.ds1.driverProperties.testQuery=SELECT 1

And my bonita.xml been update;

<Resource name="bonitaSequenceManagerDS" 
              auth="Container" 
              type="javax.sql.DataSource"
              maxActive="17" 
              minIdle="5" 
              maxWait="10000" 
              initialSize="3"
              maxPoolSize="15"
              minPoolSize="3"
              maxConnectionAge="0"
              maxIdleTime="1800"
              maxIdleTimeExcessConnections="120"
              idleConnectionTestPeriod="30"
              acquireIncrement="3"
              validationQuery="SELECT 1"
              validationInterval="30000"
              testConnectionOnCheckout="true"
              removeAbandoned="true"
              logAbandoned="true"
              username="xxxxxx"
              password="xxxxx"
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://srvmysql:3306/bonita?dontTrackOpenResources=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>

 

 

Finally setup the xetevn.sh with the proper database type; B_OPTS="-Dsysprop.bonita.db.vendor=mysql". Added mysql-connector-java-5.1.29-bin.jar to the /lib directory. I have went into platform-tenant-config.porperties and added the line platform.create=true.

What else am I missing? Happy to supply my log but like to know what is the best way to share it?

Thanks for your help.

 

 

Hi TheB2B,

there are a bunch of things on the checklist for server setup. I read your submission and I think you've covered most of them. Have you created the (empty) bonita DB on srvmysql and given user xxxxxx admin rights to it?

try starting up and see what the log says the problem is.

and you can post the log entry here if you like - just take care to truncate it so that it is only the bit from the startup.

thx,

-declan

Tested the user and password set in bonita by logging into the mysql database from the bonita server. I was able to login with the designated user, create tables. I did have to issue command "use BonitaV6" before I could create a table. How does this user know which database to use or is it expected that this user be able to create the database?

Found the issue with my setup, under the setup insturcations there is this

Note: add to the appropriate section in the file bitronix-resources.properties

resource.ds1.driverProperties.testquery=Select 1 (or "Select 1 from Dual" for oracle)
<div>
	&nbsp;</div>

<div>
	I comment it out and now connecting to mysql and i can access the default web page.</div>

I don't understand, I was postive I posted a solution to my issue, but now I don't see it. It would appear I owe you an apology. Want I found out in the inst. located here http://documentation.bonitasoft.com/tomcat-bundle was to add the following line

Note: add to the appropriate section in the file bitronix-resources.properties

resource.ds1.driverProperties.testquery=Select 1 (or "Select 1 from Dual" for oracle)
<div>
	&nbsp;</div>

<div>
	When I commented this line out it started working.</div>

I had the same problem and also in log file there was an ERROR which said “packet for query is too large”.
By adding max_allowed_packet = 32M in my.cnf file bellow** [mysqld] **and restarting mysql server I could connect to portal and load login page.

Preformed the points suggested, still unable to successfully get Bonita running.

Any further suggestions? I'm open to try most anything at this point, provide more information, looking for some help here please.

can you post the log file here, or put it in a dropbox location and share it with me?

i've configured bonita lots of times to use different databases, including mySQL. the problems are usually diagnosed in the log file, but the log file can is not structured very well, so it can be difficult to figure out where the error is. that's why getting a look at the log file would (i think) ne useful.

-declan

 

Here is what I believe you are looking for;

https://db.tt/33fCceB0

If not let me know, thanks for the help!

Hi TheB2B,

so, apologies for getting back to you so late - i was swamped on a project.

Thanks for posting the log file. I think key line from the log is :

Caused by: bitronix.tm.utils.PropertyException: no writeable property 'testQuery' in class 'com.mysql.jdbc.jdbc2.optional.MysqlXADataSource'

so look at the line :

resource.ds1.driverProperties.URL=jdbc:mysql://srvmysql:3306/bonita?dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8 resource.ds1.driverProperties.testQuery=SELECT 1
 
in the bitronix resource properties file. Are there any issues with it? driverProperties for the mySQL driver allow a testQuery property, so my best guess, without looking at the file is that there is a stray character here. check that all the properties are on a new line, and that there are no trailing spaces.
 
let me know if that helps?
 
thx,
-declan

Found source of the problem, in the setup inst there is a line to add the following;

Note: add to the appropriate section in the file bitronix-resources.properties

resource.ds1.driverProperties.testquery=Select 1 (or "Select 1 from Dual" for oracle)
<div>
	&nbsp;</div>

<div>
	When I commented the line, I was able to connect to the sql server and web page now loads. I my case this part of the inst is invalid, wonder if anybody else has had similar experinces?</div>

the database to use is in the connect string (the URL in the config file). in the example you posted you are looking for the database called bonita - it is what is directly after the portnumber/ in the URL. if it's called bonita here, and bonitaV6 on your server, that might be the problem.

otherwise, can we see the log file? (you can post it here, or if you have a dropbox you can share). 

And sorry I was away from the thread for so long - I'm glad you got it sorted out.

Strange that the commend vanished. if it happens again we can refer it to the admin on this site.