Skip to content

How to use MySQL instead H2 #119

Description

@chanhlt

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions