Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Conversation

@nickwallen
Copy link
Contributor

@nickwallen nickwallen commented Nov 14, 2019

After merging #1557 from master into the feature/METRON-2088-support-hdp-3.1 feature branch, the HDFSIndexingIntegrationTest fails.

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.185 sec <<< FAILURE! - in org.apache.metron.indexing.integration.HDFSIndexingIntegrationTest
test(org.apache.metron.indexing.integration.HDFSIndexingIntegrationTest)  Time elapsed: 0.177 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.slf4j.impl.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:48)
	...
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
	at org.apache.log4j.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:49)
	... 37 more

Results :

Tests in error:
  HDFSIndexingIntegrationTest>IndexingIntegrationTest.test:72->BaseIntegrationTest.getKafkaComponent:29 » ExceptionInInitializer

Root Cause

It doesn't make sense for a project to pull-in both slf4j-log4j12 and log4j-over-slf4j. The purpose of slf4j-log4j12 is intended to redirect calls made to an SLF4J logger to Log4j. The purpose of log4j-over-slf4j is to redirect calls made to a Log4j logger to SLF4J. Pulling in both would cause endless indirection except for the specific check for this error performed by SLF4j. See the SLF4j documentation here for more information.

The metron-indexing-storm project was pulling in log4j-over-slf4j incorrectly as a transitive. This needs to be explicitly excluded.

Acceptance Testing

The integration tests should pass.

Pull Request Checklist

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

@mmiklavc
Copy link
Contributor

What are we actually doing with log4j-over-slf4j at all? On the surface it seems like we should standardize on slf4j-log4j12 so that we depend exclusively on the slf4j api and route to log4j for the backend logging impl.

@nickwallen
Copy link
Contributor Author

We don't do anything with log4j-over-slf4j. Its a storm-core dependency.

@nickwallen
Copy link
Contributor Author

This just restores one of the exclusions that existed prior to #1557.

@mmiklavc
Copy link
Contributor

+1, thanks @nickwallen

asfgit pushed a commit that referenced this pull request Nov 18, 2019
@nickwallen
Copy link
Contributor Author

Thanks for the review. This has been merged into the feature branch.

@nickwallen nickwallen closed this Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants