Problem mit log4j - beim Start des Images kommt immer die Meldung: "ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console..."
This commit is contained in:
parent
9bbbe0fa4d
commit
8e81f08656
123
pom.xml
123
pom.xml
@ -25,6 +25,7 @@
|
|||||||
<!-- Dependency versions -->
|
<!-- Dependency versions -->
|
||||||
<junit.version>5.9.1</junit.version>
|
<junit.version>5.9.1</junit.version>
|
||||||
<javafx.version>19</javafx.version>
|
<javafx.version>19</javafx.version>
|
||||||
|
<log4j.version>2.19.0</log4j.version>
|
||||||
<lombok.version>1.18.24</lombok.version>
|
<lombok.version>1.18.24</lombok.version>
|
||||||
<jetbrains.annotations.version>23.0.0</jetbrains.annotations.version>
|
<jetbrains.annotations.version>23.0.0</jetbrains.annotations.version>
|
||||||
|
|
||||||
@ -42,10 +43,10 @@
|
|||||||
<moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin>
|
<moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin>
|
||||||
<jpackage.maven.plugin>0.1.3</jpackage.maven.plugin>
|
<jpackage.maven.plugin>0.1.3</jpackage.maven.plugin>
|
||||||
<maven.pmd.version>3.16.0</maven.pmd.version>
|
<maven.pmd.version>3.16.0</maven.pmd.version>
|
||||||
<pmd.version>6.49.0</pmd.version>
|
<pmd.version>6.50.0</pmd.version>
|
||||||
<codehaus.version.plugin>2.11.0</codehaus.version.plugin>
|
<codehaus.version.plugin>2.11.0</codehaus.version.plugin>
|
||||||
<spotbugs.maven.plugin>4.7.2.0</spotbugs.maven.plugin>
|
<spotbugs.maven.plugin>4.7.2.0</spotbugs.maven.plugin>
|
||||||
<spotbugs.version>4.7.2</spotbugs.version>
|
<spotbugs.version>4.7.3</spotbugs.version>
|
||||||
|
|
||||||
<!-- other properties -->
|
<!-- other properties -->
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
@ -86,6 +87,18 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-api</artifactId>
|
||||||
|
<version>${log4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
<version>${log4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
@ -198,6 +211,7 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.moditect</groupId>
|
<groupId>org.moditect</groupId>
|
||||||
<artifactId>moditect-maven-plugin</artifactId>
|
<artifactId>moditect-maven-plugin</artifactId>
|
||||||
@ -207,22 +221,110 @@
|
|||||||
<id>add-module-info-to-dependencies</id>
|
<id>add-module-info-to-dependencies</id>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<jvmVersion>${java.version}</jvmVersion>
|
||||||
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
||||||
<overwriteExistingFiles>true</overwriteExistingFiles>
|
<overwriteExistingFiles>true</overwriteExistingFiles>
|
||||||
<!-- Beispiel wie eine Dependency ohne module-info diese bekommen kann! -->
|
|
||||||
<!--
|
|
||||||
<modules>
|
<modules>
|
||||||
|
<!--
|
||||||
<module>
|
<module>
|
||||||
<artifact>
|
<artifact>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
</artifact>
|
</artifact>
|
||||||
<moduleInfo>
|
<moduleInfo>
|
||||||
<name>org.json</name>
|
<name>org.apache.logging.log4j.core</name>
|
||||||
</moduleInfo>
|
</moduleInfo>
|
||||||
</module>
|
</module>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<module>
|
||||||
|
<artifact>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
<version>${log4j.version}</version>
|
||||||
|
</artifact>
|
||||||
|
<moduleInfoSource>
|
||||||
|
open module org.apache.logging.log4j.core {
|
||||||
|
requires java.logging;
|
||||||
|
requires java.rmi;
|
||||||
|
|
||||||
|
requires transitive java.compiler;
|
||||||
|
requires transitive java.desktop;
|
||||||
|
requires transitive java.management;
|
||||||
|
requires transitive java.naming;
|
||||||
|
requires transitive java.scripting;
|
||||||
|
requires transitive java.sql;
|
||||||
|
requires transitive java.xml;
|
||||||
|
|
||||||
|
exports org.apache.logging.log4j.core;
|
||||||
|
exports org.apache.logging.log4j.core.appender;
|
||||||
|
exports org.apache.logging.log4j.core.appender.db;
|
||||||
|
exports org.apache.logging.log4j.core.appender.db.jdbc;
|
||||||
|
exports org.apache.logging.log4j.core.appender.mom;
|
||||||
|
exports org.apache.logging.log4j.core.appender.mom.jeromq;
|
||||||
|
exports org.apache.logging.log4j.core.appender.mom.kafka;
|
||||||
|
exports org.apache.logging.log4j.core.appender.nosql;
|
||||||
|
exports org.apache.logging.log4j.core.appender.rewrite;
|
||||||
|
exports org.apache.logging.log4j.core.appender.rolling;
|
||||||
|
exports org.apache.logging.log4j.core.appender.rolling.action;
|
||||||
|
exports org.apache.logging.log4j.core.appender.routing;
|
||||||
|
exports org.apache.logging.log4j.core.async;
|
||||||
|
exports org.apache.logging.log4j.core.config;
|
||||||
|
exports org.apache.logging.log4j.core.config.arbiters;
|
||||||
|
exports org.apache.logging.log4j.core.config.builder.api;
|
||||||
|
exports org.apache.logging.log4j.core.config.builder.impl;
|
||||||
|
exports org.apache.logging.log4j.core.config.composite;
|
||||||
|
exports org.apache.logging.log4j.core.config.json;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.convert;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.processor;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.util;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.validation;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.validation.constraints;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.validation.validators;
|
||||||
|
exports org.apache.logging.log4j.core.config.plugins.visitors;
|
||||||
|
exports org.apache.logging.log4j.core.config.properties;
|
||||||
|
exports org.apache.logging.log4j.core.config.status;
|
||||||
|
exports org.apache.logging.log4j.core.config.xml;
|
||||||
|
exports org.apache.logging.log4j.core.config.yaml;
|
||||||
|
exports org.apache.logging.log4j.core.filter;
|
||||||
|
exports org.apache.logging.log4j.core.filter.mutable;
|
||||||
|
exports org.apache.logging.log4j.core.impl;
|
||||||
|
exports org.apache.logging.log4j.core.jackson;
|
||||||
|
exports org.apache.logging.log4j.core.jmx;
|
||||||
|
exports org.apache.logging.log4j.core.layout;
|
||||||
|
exports org.apache.logging.log4j.core.layout.internal;
|
||||||
|
exports org.apache.logging.log4j.core.lookup;
|
||||||
|
exports org.apache.logging.log4j.core.message;
|
||||||
|
exports org.apache.logging.log4j.core.net;
|
||||||
|
exports org.apache.logging.log4j.core.net.ssl;
|
||||||
|
exports org.apache.logging.log4j.core.osgi;
|
||||||
|
exports org.apache.logging.log4j.core.parser;
|
||||||
|
exports org.apache.logging.log4j.core.pattern;
|
||||||
|
exports org.apache.logging.log4j.core.script;
|
||||||
|
exports org.apache.logging.log4j.core.selector;
|
||||||
|
exports org.apache.logging.log4j.core.time;
|
||||||
|
exports org.apache.logging.log4j.core.time.internal;
|
||||||
|
exports org.apache.logging.log4j.core.tools;
|
||||||
|
exports org.apache.logging.log4j.core.tools.picocli;
|
||||||
|
exports org.apache.logging.log4j.core.util;
|
||||||
|
exports org.apache.logging.log4j.core.util.datetime;
|
||||||
|
exports org.apache.logging.log4j.core.util.internal;
|
||||||
|
|
||||||
|
provides javax.annotation.processing.Processor with
|
||||||
|
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor;
|
||||||
|
provides org.apache.logging.log4j.core.util.ContextDataProvider with
|
||||||
|
org.apache.logging.log4j.core.impl.ThreadContextDataProvider;
|
||||||
|
provides org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory with
|
||||||
|
org.apache.logging.log4j.core.message.ExtendedThreadInfoFactory;
|
||||||
|
provides org.apache.logging.log4j.spi.Provider with
|
||||||
|
org.apache.logging.log4j.core.impl.Log4jProvider;
|
||||||
|
|
||||||
|
}
|
||||||
|
</moduleInfoSource>
|
||||||
|
</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
-->
|
|
||||||
|
|
||||||
<module>
|
<module>
|
||||||
<mainClass>${main.class}</mainClass>
|
<mainClass>${main.class}</mainClass>
|
||||||
@ -230,7 +332,9 @@
|
|||||||
</module>
|
</module>
|
||||||
|
|
||||||
<jdepsExtraArgs>
|
<jdepsExtraArgs>
|
||||||
--ignore-missing-deps
|
<arg>--ignore-missing-deps</arg>
|
||||||
|
<arg>--multi-release</arg>
|
||||||
|
<arg>${java.version}</arg>
|
||||||
</jdepsExtraArgs>
|
</jdepsExtraArgs>
|
||||||
</configuration>
|
</configuration>
|
||||||
<goals>
|
<goals>
|
||||||
@ -255,6 +359,7 @@
|
|||||||
<module>${main.module}</module>
|
<module>${main.module}</module>
|
||||||
</launcher>
|
</launcher>
|
||||||
<compression>2</compression>
|
<compression>2</compression>
|
||||||
|
<!-- <jarInclusionPolicy>NONE</jarInclusionPolicy> -->
|
||||||
<jarInclusionPolicy>APP_WITH_DEPENDENCIES</jarInclusionPolicy>
|
<jarInclusionPolicy>APP_WITH_DEPENDENCIES</jarInclusionPolicy>
|
||||||
<stripDebug>true</stripDebug>
|
<stripDebug>true</stripDebug>
|
||||||
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
|
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
|
||||||
|
|||||||
@ -1,14 +1,16 @@
|
|||||||
package de.kneitzel;
|
package de.kneitzel;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.event.ActionEvent;
|
|
||||||
import javafx.event.EventHandler;
|
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
public class JavaFXApp extends Application {
|
public class JavaFXApp extends Application {
|
||||||
|
static final Logger logger = LogManager.getLogger(JavaFXApp.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) {
|
||||||
@ -24,6 +26,7 @@ public class JavaFXApp extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
logger.warn("Starting ...");
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,8 @@ module FXAppModule {
|
|||||||
requires javafx.graphics;
|
requires javafx.graphics;
|
||||||
requires javafx.controls;
|
requires javafx.controls;
|
||||||
requires javafx.web;
|
requires javafx.web;
|
||||||
|
requires org.apache.logging.log4j;
|
||||||
|
// requires org.apache.logging.log4j.core;
|
||||||
|
|
||||||
exports de.kneitzel;
|
exports de.kneitzel;
|
||||||
opens de.kneitzel;
|
opens de.kneitzel;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user