10:49:51 [main] INFO Reflections - Reflections took 233 ms to scan 2 urls, producing 86 keys and 277 values
10:49:51 [main] INFO ConfigLoader - Loading LoginConfig config.
10:49:52 [main] INFO LoginConfig - Cached 10 KeyPairs for RSA communication
10:49:52 [main] INFO LoginConfig - Stored 20 keys for Blowfish communication
10:49:52 [main] INFO ServerNamesConfigParser - Loaded 127 server names
10:49:52 [main] INFO HikariDataSource - HikariPool-1 - Started.
10:49:52 [main] INFO DatabaseFactory - Database connection working.
10:49:52 [main] INFO DatabaseInstaller - Installing tables in database.
10:49:52 [main] INFO VersionPrinter - Flyway 4.0 by Boxfuse
10:49:52 [main] INFO DbSupportFactory - Database: jdbc:mariadb://localhost:3306/auth?characterEncoding=utf-8 (MySQL 10.3)
10:49:53 [main] INFO DbMigrate - Current version of schema `auth`: 1
10:49:53 [main] INFO DbMigrate - Schema `auth` is up to date. No migration necessary.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.mmocore.authserver.AuthServer.<init>(AuthServer.java:37)
at org.mmocore.authserver.AuthServer.main(AuthServer.java:96)
Caused by: org.mmocore.commons.jdbchelper.JdbcException: Error running query:
SELECT server_id FROM gameservers
Error: (conn=65) Table 'auth.gameservers' doesn't exist
at org.mmocore.commons.jdbchelper.JdbcHelper.genericQuery(JdbcHelper.java:353)
at org.mmocore.commons.jdbchelper.JdbcHelper.query(JdbcHelper.java:1516)
at org.mmocore.authserver.database.dao.impl.GameServerDAO.load(GameServerDAO.java:30)
at org.mmocore.authserver.manager.GameServerManager.load(GameServerManager.java:34)
at org.mmocore.authserver.manager.GameServerManager.<init>(GameServerManager.java:25)
at org.mmocore.authserver.manager.GameServerManager.<clinit>(GameServerManager.java:19)
... 2 more
Caused by: java.sql.SQLSyntaxErrorException: (conn=65) Table 'auth.gameservers' doesn't exist
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:177)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110)
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:228)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:334)
at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:505)
at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111)
at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
at org.mmocore.commons.jdbchelpe
# ================================================================
# Настройки базы данных
# ================================================================
# Database connection settings.
dataSource.url = jdbc:mariadb://localhost:3306/auth?characterEncoding=utf-8
dataSource.user = root
dataSource.password = root
# This is the name of the DataSource class provided by the JDBC driver.
# Consult the documentation for your specific JDBC driver to get this class name.
dataSourceClassName = org.mariadb.jdbc.MySQLDataSource
# This property controls the maximum number of milliseconds that a client (that's you) will wait for a connection from the pool.
# If this time is exceeded without a connection becoming available, a SQLException will be thrown.
# 1000 ms is the minimum value. Default: 30000 (30 seconds)
connectionTimeout = 30000
# This property controls the maximum amount of time that a connection is allowed to sit idle in the pool.
# Whether a connection is retired as idle or not is subject to a maximum variation of +30 seconds,
# and average variation of +15 seconds. A connection will never be retired as idle before this timeout.
# A value of 0 means that idle connections are never removed from the pool.
# Default: 600000 (10 minutes)
idleTimeout = 600000
# This property controls the maximum lifetime of a connection in the pool.
# When a connection reaches this timeout it will be retired from the pool, subject to a maximum variation of +30 seconds.
# An in-use connection will never be retired, only when it is closed will it then be removed.
# We strongly recommend setting this value, and it should be at least 30 seconds less than any database-level connection timeout.
# A value of 0 indicates no maximum lifetime (infinite lifetime), subject of course to the idleTimeout setting.
# Default: 1800000 (30 minutes)
maxLifetime = 1800000
# This property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.
# Basically this value will determine the maximum number of actual connections to the database backend.
# A reasonable value for this is best determined by your execution environment.
# When the pool reaches this size, and no idle connections are available,
# calls to getConnection() will block for up to connectionTimeout milliseconds before timing out.
maximumPoolSize = 10
# This property controls the amount of time that a connection can be out of the pool before a message is logged
# indicating a possible connection leak.
# A value of 0 means leak detection is disabled.
# Lowest acceptable value for enabling leak detection is 2000 (2 secs).
# Default: 0
leakDetectionThreshold = 3000
package org.mmocore.commons.database.installer;
import org.flywaydb.core.Flyway;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.sql.DataSource;
import java.nio.file.Path;
/**
* @author Java-man
*/
public final class DatabaseInstaller {
private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseInstaller.class);
private DatabaseInstaller() {
}
public static void start(final DataSource dataSource, final Path databaseFilesDir) {
LOGGER.info("Installing tables in database.");
final Flyway flyway = new Flyway();
flyway.setValidateOnMigrate(false);
flyway.setBaselineOnMigrate(true);
flyway.setDataSource(dataSource);
flyway.setLocations("filesystem:" + databaseFilesDir);
flyway.migrate();
}
}
Ну я хз.марья с жтсом работает из коробки, смотри откуда она выкапывает файлы для заливки в базу и сравнивай со своими путями
private static final Path DATABASE_FILES_DIR = Paths.get("sql/");
CREATE TABLE `account_bonus` (
`account` varchar(255) NOT NULL,
`rate_xp` double NOT NULL,
`rate_sp` double NOT NULL,
`rate_adena` double NOT NULL,
`rate_drop` double NOT NULL,
`rate_spoil` double NOT NULL,
`rate_epaulette` double NOT NULL,
`bonus_expire` BIGINT(20) UNSIGNED NOT NULL,
PRIMARY KEY (`account`)
);
CREATE TABLE `account_block` (
`account_id` BIGINT(10) UNSIGNED NOT NULL,
`block_type` ENUM('','email','sms') NOT NULL DEFAULT '',
`phone_sms` VARCHAR(20) NULL DEFAULT NULL,
`phone_hash` VARCHAR(32) NULL DEFAULT NULL,
`want_block` ENUM('','email','sms') NOT NULL DEFAULT '',
`send_email` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`send_time` INT(4) UNSIGNED NULL DEFAULT NULL,
`send_ip` VARCHAR(15) NULL DEFAULT NULL,
`email_lang` CHAR(2) NOT NULL DEFAULT 'RU',
`want_key` VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY (account_id)
)
COMMENT='Block IP'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
CREATE TABLE `account_log` (
`time` int(11) NOT NULL,
`login` varchar(32) NOT NULL,
`ip` varchar(15) NOT NULL,
KEY `login` (`login`),
KEY `ip` (`ip`)
) DEFAULT CHARSET=utf8;
CREATE TABLE `accounts` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`login` VARCHAR(32) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`creationDate` INT(11) NOT NULL DEFAULT '-1',
`last_access` INT(11) NOT NULL DEFAULT '0',
`access_level` INT(11) NOT NULL DEFAULT '0',
`last_ip` VARCHAR(15) NULL DEFAULT NULL,
`last_server` INT(11) NOT NULL DEFAULT '0',
`l2email` varchar(50) NOT NULL DEFAULT 'null@null',
`ban_expire` INT(11) NOT NULL DEFAULT '0',
`allow_ip` VARCHAR(255) NOT NULL DEFAULT '',
`points` INT(11) NOT NULL DEFAULT '0',
`checkemail` smallint(1) NOT NULL DEFAULT '0',
`report_points` TINYINT UNSIGNED NOT NULL DEFAULT '10',
INDEX `last_ip` (`last_ip`),
PRIMARY KEY (`id`),
UNIQUE INDEX `login` (`login`)
) DEFAULT CHARSET=utf8;
CREATE TABLE auth_log (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
act_time INT(10) NOT NULL,
ip INT(15) UNSIGNED NOT NULL DEFAULT '0',
failed TINYINT(10) UNSIGNED NOT NULL DEFAULT '0',
login TINYINT(10) UNSIGNED NOT NULL DEFAULT '1',
account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (id),
INDEX account_id (account_id),
INDEX act_time (act_time),
INDEX ip (ip)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
CREATE TABLE `gameservers` (
`server_id` int(11) NOT NULL,
`host` varchar(255) NOT NULL,
PRIMARY KEY (`server_id`)
) DEFAULT CHARSET=utf8;
Угу, затарахтело.V1__Add_authserver_tables.sql
попробуй сабж нейм для sql-скрипта
"C:\Program Files\Java\JDK 1.8\bin\java.exe" "-javaagent:D:\Program Files\IntelliJ IDEA\lib\idea_rt.jar=64030:D:\Program Files\IntelliJ IDEA\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\JDK 1.8\jre\lib\charsets.jar;C:\Program Files\Java\JDK 1.8\jre\lib\deploy.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\dnsns.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\jaccess.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\localedata.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\nashorn.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\sunec.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\JDK 1.8\jre\lib\ext\zipfs.jar;C:\Program Files\Java\JDK 1.8\jre\lib\javaws.jar;C:\Program Files\Java\JDK 1.8\jre\lib\jce.jar;C:\Program Files\Java\JDK 1.8\jre\lib\jfr.jar;C:\Program Files\Java\JDK 1.8\jre\lib\jfxswt.jar;C:\Program Files\Java\JDK 1.8\jre\lib\jsse.jar;C:\Program Files\Java\JDK 1.8\jre\lib\management-agent.jar;C:\Program Files\Java\JDK 1.8\jre\lib\plugin.jar;C:\Program Files\Java\JDK 1.8\jre\lib\resources.jar;C:\Program Files\Java\JDK 1.8\jre\lib\rt.jar;D:\Project\production\authserver;D:\Project\production\commons;D:\Project\lib\smrt-core.jar;D:\Project\lib\guava-19.0.jar;D:\Project\lib\ognl-3.1.2.jar;D:\Project\lib\jdom2-2.0.6.jar;D:\Project\lib\junit-3.8.1.jar;D:\Project\lib\config-1.2.1.jar;D:\Project\lib\jsr305-3.0.1.jar;D:\Project\lib\quartz-2.2.2.jar;D:\Project\lib\log4j-api-2.5.jar;D:\Project\lib\trove4j-3.0.3.jar;D:\Project\lib\commons-io-2.4.jar;D:\Project\lib\HikariCP-2.4.5.jar;D:\Project\lib\log4j-core-2.5.jar;D:\Project\lib\disruptor-3.3.4.jar;D:\Project\lib\servlet-api-2.3.jar;D:\Project\lib\slf4j-api-1.7.21.jar;D:\Project\lib\annotations-3.0.1.jar;D:\Project\lib\commons-lang3-3.4.jar;D:\Project\lib\flyway-core-5.1.1.jar;D:\Project\lib\jackson-core-2.7.3.jar;D:\Project\lib\jdk.tools-jdk1.8.0.jar;D:\Project\lib\reflections-0.9.10.jar;D:\Project\lib\commons-logging-1.1.jar;D:\Project\lib\commons-math3-3.6.1.jar;D:\Project\lib\javassist-3.20.0-GA.jar;D:\Project\lib\xmlrpc-common-3.1.3.jar;D:\Project\lib\xmlrpc-server-3.1.3.jar;D:\Project\lib\htmlcompressor-1.5.2.jar;D:\Project\lib\jcip-annotations-1.0.jar;D:\Project\lib\log4j-slf4j-impl-2.5.jar;D:\Project\lib\scala-library-2.10.4.jar;D:\Project\lib\akka-actor_2.10-2.3.6.jar;D:\Project\lib\ws-commons-util-1.0.2.jar;D:\Project\lib\jackson-databind-2.7.3.jar;D:\Project\lib\netty-all-4.0.36.Final.jar;D:\Project\lib\thymeleaf-3.0.0.BETA02.jar;D:\Project\lib\attoparser-2.0.0.BETA05.jar;D:\Project\lib\unbescape-1.1.2.RELEASE.jar;D:\Project\lib\jackson-annotations-2.7.0.jar;D:\Project\lib\mariadb-java-client-2.2.5.jar;D:\Project\lib\atlassian-util-concurrent-4.0.0.jar;D:\Project\lib\infinispan-embedded-8.2.1.Final.jar;D:\Project\lib\jboss-transaction-api_1.1_spec-1.0.1.Final.jar" org.mmocore.authserver.AuthServer
12:27:59 [main] INFO Reflections - Reflections took 179 ms to scan 2 urls, producing 86 keys and 277 values
12:27:59 [main] INFO ConfigLoader - Loading LoginConfig config.
12:28:00 [main] INFO LoginConfig - Cached 10 KeyPairs for RSA communication
12:28:00 [main] INFO LoginConfig - Stored 20 keys for Blowfish communication
12:28:00 [main] INFO ServerNamesConfigParser - Loaded 127 server names
12:28:00 [main] INFO HikariDataSource - HikariPool-1 - Started.
12:28:00 [main] INFO DatabaseFactory - Database connection working.
12:28:00 [main] INFO DatabaseInstaller - Installing tables in database.
12:28:00 [main] INFO VersionPrinter - Flyway Community Edition 5.1.1 by Boxfuse
12:28:00 [main] INFO DatabaseFactory - Database: jdbc:mariadb://localhost:3306/auth (MySQL 10.3)
12:28:00 [main] WARN Database - Flyway upgrade recommended: MariaDB 10.3 is newer than this version of Flyway and support has not been tested.
12:28:00 [main] INFO DbMigrate - Current version of schema `auth`: << Empty Schema >>
12:28:00 [main] INFO DbMigrate - Migrating schema `auth` to version 1 - Add authserver tables
12:28:01 [main] INFO DbMigrate - Successfully applied 1 migration to schema `auth` (execution time 00:00.462s)
12:28:01 [main] INFO GameServerManager - Loaded 0 registered GameServer(s).
12:28:01 [main] INFO AuthServer - Listening for gameservers on *:9014
12:28:01 [main] INFO AuthServer - Listening for clients on *:2106
12:28:01 [main] INFO XmlRpcServer - Listening on 127.0.0.1:5600
Понял, спасибо за разжевывание.да, почитай про "flyway file name convention"
Вы не можете просматривать ссылку пожалуйста воспользуйтесь следующими ссылками Вход или Регистрация
оно не жрёт файлы без v***__somefile.sql.
ну и использует версию в названии для контроля заливки новых скриптов.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?