[FIX] logger dependency error

This commit is contained in:
Edouard DUPIN 2025-01-06 19:41:40 +01:00
parent b71ea1bcd8
commit 1631d1cab9
4 changed files with 26 additions and 21 deletions

View File

@ -34,6 +34,11 @@
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.4.11</version> <version>1.4.11</version>
</dependency> </dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>

View File

@ -49,15 +49,15 @@ public class WebLauncher {
final static Logger LOGGER = LoggerFactory.getLogger(WebLauncher.class); final static Logger LOGGER = LoggerFactory.getLogger(WebLauncher.class);
protected UpdateJwtPublicKey keyUpdater = null; protected UpdateJwtPublicKey keyUpdater = null;
protected HttpServer server = null; protected HttpServer server = null;
public WebLauncher() { public WebLauncher() {
ConfigBaseVariable.bdDatabase = "karusic"; ConfigBaseVariable.bdDatabase = "karusic";
} }
private static URI getBaseURI() { private static URI getBaseURI() {
return UriBuilder.fromUri(ConfigBaseVariable.getlocalAddress()).build(); return UriBuilder.fromUri(ConfigBaseVariable.getlocalAddress()).build();
} }
public void migrateDB() throws Exception { public void migrateDB() throws Exception {
WebLauncher.LOGGER.info("Create migration engine"); WebLauncher.LOGGER.info("Create migration engine");
final MigrationEngine migrationEngine = new MigrationEngine(); final MigrationEngine migrationEngine = new MigrationEngine();
@ -73,16 +73,16 @@ public class WebLauncher {
migrationEngine.migrateWaitAdmin(new DbConfig()); migrationEngine.migrateWaitAdmin(new DbConfig());
WebLauncher.LOGGER.info("Migrate the DB [STOP]"); WebLauncher.LOGGER.info("Migrate the DB [STOP]");
} }
public static void main(final String[] args) throws Exception { public static void main(final String[] args) throws Exception {
// Loop-back of logger JDK logging API to SLF4J // Loop-back of logger JDK logging API to SLF4J
LogManager.getLogManager().reset(); LogManager.getLogManager().reset();
SLF4JBridgeHandler.install(); SLF4JBridgeHandler.install();
WebLauncher.LOGGER.info("[START] application wake UP"); WebLauncher.LOGGER.info("[START] application wake UP");
final WebLauncher launcher = new WebLauncher(); final WebLauncher launcher = new WebLauncher();
launcher.migrateDB(); launcher.migrateDB();
launcher.process(); launcher.process();
WebLauncher.LOGGER.info("end-configure the server & wait finish process:"); WebLauncher.LOGGER.info("end-configure the server & wait finish process:");
Thread.currentThread().join(); Thread.currentThread().join();
@ -90,7 +90,7 @@ public class WebLauncher {
launcher.stopOther(); launcher.stopOther();
WebLauncher.LOGGER.info("STOP the REST server:"); WebLauncher.LOGGER.info("STOP the REST server:");
} }
public void plop(final String aaa) { public void plop(final String aaa) {
// List available Image Readers // List available Image Readers
WebLauncher.LOGGER.trace("Available Image Readers:"); WebLauncher.LOGGER.trace("Available Image Readers:");
@ -101,7 +101,7 @@ public class WebLauncher {
WebLauncher.LOGGER.trace("Reader CN: " + reader.getOriginatingProvider().getPluginClassName()); WebLauncher.LOGGER.trace("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
// ImageIO.deregisterServiceProvider(reader.getOriginatingProvider()); // ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
} }
// List available Image Writers // List available Image Writers
WebLauncher.LOGGER.trace("\nAvailable Image Writers:"); WebLauncher.LOGGER.trace("\nAvailable Image Writers:");
final Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(aaa); final Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(aaa);
@ -111,9 +111,9 @@ public class WebLauncher {
WebLauncher.LOGGER.trace("Writer CN: " + writer.getOriginatingProvider().getPluginClassName()); WebLauncher.LOGGER.trace("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
} }
} }
public void process() throws InterruptedException, DataAccessException { public void process() throws InterruptedException, DataAccessException {
ImageIO.scanForPlugins(); ImageIO.scanForPlugins();
plop("jpeg"); plop("jpeg");
plop("png"); plop("png");
@ -123,7 +123,7 @@ public class WebLauncher {
// Configure resources // Configure resources
// =================================================================== // ===================================================================
final ResourceConfig rc = new ResourceConfig(); final ResourceConfig rc = new ResourceConfig();
// add multipart models .. // add multipart models ..
rc.register(MultiPartFeature.class); rc.register(MultiPartFeature.class);
// global authentication system // global authentication system
@ -143,17 +143,17 @@ public class WebLauncher {
rc.register(TrackResource.class); rc.register(TrackResource.class);
rc.register(DataResource.class); rc.register(DataResource.class);
rc.register(ProxyResource.class); rc.register(ProxyResource.class);
rc.register(HealthCheck.class); rc.register(HealthCheck.class);
rc.register(Front.class); rc.register(Front.class);
ContextGenericTools.addJsr310(rc); ContextGenericTools.addJsr310(rc);
// add jackson to be discover when we are ins standalone server // add jackson to be discover when we are ins standalone server
rc.register(JacksonFeature.class); rc.register(JacksonFeature.class);
// enable this to show low level request // enable this to show low level request
// rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName()); // rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());
// System.out.println("Connect on the BDD:"); // System.out.println("Connect on the BDD:");
// System.out.println(" getDBHost: '" + ConfigVariable.getDBHost() + "'"); // System.out.println(" getDBHost: '" + ConfigVariable.getDBHost() + "'");
// System.out.println(" getDBPort: '" + ConfigVariable.getDBPort() + "'"); // System.out.println(" getDBPort: '" + ConfigVariable.getDBPort() + "'");
@ -171,13 +171,13 @@ public class WebLauncher {
serverLink.shutdownNow(); serverLink.shutdownNow();
} }
}, "shutdownHook")); }, "shutdownHook"));
// =================================================================== // ===================================================================
// start periodic update of the token ... // start periodic update of the token ...
// =================================================================== // ===================================================================
this.keyUpdater = new UpdateJwtPublicKey(); this.keyUpdater = new UpdateJwtPublicKey();
this.keyUpdater.start(); this.keyUpdater.start();
// =================================================================== // ===================================================================
// run JERSEY // run JERSEY
// =================================================================== // ===================================================================
@ -189,14 +189,14 @@ public class WebLauncher {
e.printStackTrace(); e.printStackTrace();
} }
} }
public void stop() { public void stop() {
if (this.server != null) { if (this.server != null) {
this.server.shutdownNow(); this.server.shutdownNow();
this.server = null; this.server = null;
} }
} }
public void stopOther() { public void stopOther() {
this.keyUpdater.kill(); this.keyUpdater.kill();
try { try {

View File

@ -44,7 +44,7 @@ public class TestBase {
@Test @Test
public static void TestEmpty() throws Exception { public static void TestEmpty() throws Exception {
} }
} }

View File

@ -7,6 +7,6 @@ import org.slf4j.LoggerFactory;
public class WebLauncherTest extends WebLauncher { public class WebLauncherTest extends WebLauncher {
final private static Logger LOGGER = LoggerFactory.getLogger(WebLauncherTest.class); final private static Logger LOGGER = LoggerFactory.getLogger(WebLauncherTest.class);
public WebLauncherTest() {} public WebLauncherTest() {}
} }