I have simplified my code until finding that I am doing something wrong when trying to connect this vertx application to mysql database, but I can not figure out what.
I have tried this simple code:
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.mysqlclient.MySQLConnectOptions;
import io.vertx.mysqlclient.MySQLPool;
import io.vertx.sqlclient.PoolOptions;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowSet;
public class MainApplication extends AbstractVerticle {
public static MySQLPool mySqlClient;
public void start(Promise<Void> start) {
MySQLConnectOptions connectOptions = new MySQLConnectOptions()
.setPort(******)
.setHost(******)
.setDatabase(******)
.setUser(******)
.setPassword(******);
PoolOptions poolOptions = new PoolOptions().setMaxSize(5);
mySqlClient = MySQLPool.pool(vertx, connectOptions, poolOptions);
}
}
The problem takes place in the last line, and displays the error:
SEVERE: Failed in deploying verticle java.lang.NoClassDefFoundError: io/vertx/sqlclient/impl/SqlConnectionImpl
I tried if it was something related to the dependencies, or to the database but I don't find anything related to this log.