Getting errors related to "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar"

1,652 views
Skip to first unread message

Vishvesh Mulay

unread,
Apr 30, 2015, 7:50:39 PM4/30/15
to dropwiz...@googlegroups.com
Hi,

Thanks for providing a wonderful framework for quick REST api development. 

I am developing a REST web service using drop wizard that includes triggering a hive query in the backend.  In order to do that, i have to include maven dependency "hive-jdbc" which brings along with it the "slf4j-log4j" maven artifact.

Since dropwizard comes with "log4j-over-slf4j"  it errors out at server startup saying 

"

Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError."



Now the obvious thing to do is to exclude one of them. So I tried removing both artifacts (one by one) and I get same error when I remove either of them. 

File attached is the complete stack trace. 

At this point, I am quite confused and don't know how to move forward.  Any help will be appreciated.


Thanks,
Vishvesh
dropwizard_error.txt

Jochen Schalanda

unread,
May 1, 2015, 4:27:02 AM5/1/15
to dropwiz...@googlegroups.com
Hi Vishvesh,

the correct way to resolve this is to exclude slf4j-log4j12 from your project. Dropwizard comes with Logback as logging framework behind SLF4J, so adding log4j naturally causes some problems.

As for the other errors, it seems that there are some Jersey 1.x artifacts on your class path (com.jersey.* instead of org.glassfish.jersey.*) which cause the dependency injection framework used by Jersey 2.x (HK2) to run amok. You should remove those Jersey 1.x artifacts from your project as well.


Cheers,
Jochen

--
You received this message because you are subscribed to the Google Groups "dropwizard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<dropwizard_error.txt>

Vishvesh Mulay

unread,
May 1, 2015, 8:04:18 PM5/1/15
to dropwiz...@googlegroups.com
Yeah, hive-jdbc brought about jersey jars. I excluded them.

If the jersey 1.x and 2.x have different packages,  I am not sure how its going to work ; I am just hoping that those jersey jars are not required at runtime in my flow.
Reply all
Reply to author
Forward
0 new messages