We are trying to user log4j2 ( moving from log4j1 ) but have an issue probably related to the classpath but I couldN,t fix it after multiple tries
We are using a separate module (NbfgLogging) that use a java class to configure LOG4J.
The configuration works without an issue but ,for some reason, it disable the scan of the @webservice scan.
Looking at the console of WAS, the services are not anymore registered
COMMONS-LOGGING.PROPERTIES
priority=1
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
#org.apache.commons.logging.Log=org.apache.logging.log4j.Logger
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
#org.apache.commons.logging.Log=java.util.logging.Logger
DEPENDENCIES IN THE SEPARATE MODULE FILE ( NbfgLogging )
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
DEPENDENCIES IN THE WAR FILES ( that create the issue. No scan of the @webservices )
<dependency>
<groupId>com.nbfg.fw.foundation</groupId>
<artifactId>NbfgLogging</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
LOGS OF THE SERVER ( other lines
[12/14/21 13:13:50:512 EST] 00000177 AbstractInjec W CWNEN0070W: The javax.ws.rs.HeaderParam annotation class will not be recognized because it was loaded from the file:/C:/blp/IBM/WebSphere/wp_profile/installedApps/portail-devCell/PA_Xxxxx.ear/CP-3.4.4-SNAPSHOT.war/WEB-INF/lib/javax.ws.rs-api-2.0.1.jar location rather than from a product class loader.
[12/14/21 13:13:50:513 EST] 00000177 AbstractInjec W CWNEN0070W: The javax.annotation.Resource annotation class will not be recognized because it was loaded from the file:/C:/blp/IBM/WebSphere/wp_profile/installedApps/portail-devCell/PA_Xxxxxx.ear/CP-3.4.4-SNAPSHOT.war/WEB-INF/lib/javax.annotation-api-1.2.jar location rather than from a product class loader.
******************************
I have tried the following that solve the issue of the scan of @webservice. But the looger is not working anymore.
I have tried other exclusions ... without any succes.
DEPENDENCIES IN THE WAR FILES ( with exclusion )
<dependency>
<groupId>com.nbfg.fw.foundation</groupId>
<artifactId>NbfgLogging</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
LOGS OF THE SERVER ( other lines are not included )
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
------------------------------
Daniel JANS
CogitoSum
Laval
(514) 236-3699
------------------------------