-1

I have updated my uber jar from 6.2.0-SP1 to 6.4.0. After that all my Junit is failing with the following error.

If i remove the logger from the class then issue is not coming. Junit is working.

Error message 1: java.lang.StackOverflowError: null at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39

Error message 2: java.lang.StackOverflowError: null at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39) at org.apache.log4j.LogManager.getLogger(LogManager.java:45)

Full Log trace :

java.lang.StackOverflowError: null
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
    at org.apache.log4j.Category.<init>(Category.java:57)
    at org.apache.log4j.Logger.<init>(Logger.java:37)
    at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:43)
    at org.apache.log4j.LogManager.getLogger(LogManager.java:45)
    at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
    at org.apache.log4j.Category.<init>(Category.java:57)
    at org.apache.log4j.Logger.<init>(Logger.java:37)
    at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:43)
  • I don't think there's really enough detail here for anyone to help you. Do you have a complete stack trace? What does your JUnit test look like? – Rob McDougall Aug 20 '19 at 18:41
  • @RobMcDougall: I have added stack trace log. I found in uber 6.4 jar has org.apache.log4j and org.slf4j.log4j.* package but those package is not available in uber6.2 which has added separate dependency slf4j-api. I have removed "slf4j-api" dependency when i am using uber 6.4 but still same issue. – Vijay Marudhachalam Aug 21 '19 at 15:07

2 Answers2

0

With the rare information you gave us, I would guess you have not set up the logger correctly anymore due to the update you made(perhaps the newer version requires some more configuration). (Would like to post this as a comment, but my reputation is too low, sry :) )

Because of the improve info you gave, it really looks like you have no logger intialized. Maybe the getLogger-Method tries to find a logger recursive which causes the StackOverflowError.

0

I have fixed this issue by excluding the slf4j-log4j12 from the bundle which is referred in one of the custom jar. Now there is no cyclic call between slf4j-api and slf4j-log4j12.