You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading to v5.1.0 now gives me an error on startup :
java.lang.AbstractMethodError: org.apache.commons.logging.LogFactory.setAttribute(Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:638)
.....
Seems something to do with the spring-jcl jar, I checked the jars before/after the upgrade and they are identical (other than the version changes).
I use the bridge logging to commons-logging. If I exclude the spring-jcl jar the app starts up OK. v5.0.8 was OK.
We're aiming to be compatible with standard commons-logging there, so we'll have a look at adding such a setAttribute method (although we're not going to do anything with it).
That said, you seem to have overlapping Commons Logging implementations on your classpath. spring-jcl, commons-logging and log4j-jcl are all Commons Logging bridges implementing the very same API. You could drop two of them and things should still run; we recommend just using spring-jcl, of course :-)
I had not realised there was a spring version of jcl, hence the log4j-jcl. btw, I use log4j 2 as a base, my app uses commons-logging and bridge into log4j 2, then bridge all the other log stuff/versions into Log4j 2.
..When I last reviewed all the logging stuff, I thought I understood what was going on, but now it looks like log soup!
I've narrowed this AbstractMethodError down to scenarios where standard Commons Logging parses a commons-logging.properties file. The plain presence of commons-logging.jar does not trigger this.
In any case, the recommended solution is to only have one Commons Logging bridge on the classpath. spring-jcl is a complete replacement there, with no other JCL artifacts needed on the classpath next to it.
Addressed through implementing the Commons Logging attribute methods in LogFactoryService now, in case we're running against an overlapping commons-logging.jar with a commons-logging.properties file around.
gregh3269 opened SPR-17302 and commented
Hello,
Upgrading to v5.1.0 now gives me an error on startup :
java.lang.AbstractMethodError: org.apache.commons.logging.LogFactory.setAttribute(Ljava/lang/String;Ljava/lang/Object;)V
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:638)
.....
Seems something to do with the spring-jcl jar, I checked the jars before/after the upgrade and they are identical (other than the version changes).
I use the bridge logging to commons-logging. If I exclude the spring-jcl jar the app starts up OK. v5.0.8 was OK.
Here are my dependancies
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<!-- Actual Logging Implementation log4j 2 --->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>2.11.1</version>
</dependency>
<!-- Logging redirects --->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.1</version>
</dependency>
<!-- Log4j 1.x API Bridge -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.11.1</version>
</dependency>
<!-- slf4j Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
Cheers Greg
Affects: 5.1 GA
Issue Links:
Referenced from: commits d6dfde3
The text was updated successfully, but these errors were encountered: