osgi/osgi.enroute

How to use MySQL instead H2

chanhlt opened this issue · 0 comments

Hi everyone, I am trying switch to use MySQL but it seems not work.
It works fine with default H2 configuration.

{
	":configurator:resource-version": 1,
	":configurator:symbolic-name": "my.app.config",
	":configurator:version": "1.0-SNAPSHOT",
	"org.apache.aries.tx.control.jdbc.xa~microservice": {
		"name": "app.database",
		"osgi.jdbc.driver.class": "org.h2.Driver",
		"url": "jdbc:h2:./data/database"
	},
	"my.app.impl.AlarmDAOImpl": {
		"provider.target": "(name=app.database)"
	}
}

But when change to use MySQL like this:

{
	":configurator:resource-version": 1,
	":configurator:symbolic-name": "my.app.config",
	":configurator:version": "1.0-SNAPSHOT",
	"org.apache.aries.tx.control.jdbc.xa~microservice": {
		"name": "app.database",
		"osgi.jdbc.driver.class": "com.mysql.cj.Driver",
		"url": "jdbc:mysql://root:123@localhost:3306/test?useSSL=false"
	},
	"my.app.impl.AlarmDAOImpl": {
		"provider.target": "(name=app.database)"
	}
}

My app seems to get crash and I cannot access the REST endpoint anymore.
Can anyone help me take a look at my configuration?