java.lang.NoSuchMethodError

1,432 views
Skip to first unread message

Zachary Kimberg

unread,
Aug 2, 2013, 4:36:29 PM8/2/13
to dropwiz...@googlegroups.com
I am getting an error when I try to run any example of dropwizard. The full text of the error is:

Exception in thread "main" java.lang.NoSuchMethodError: com.yammer.dropwizard.logging.LogFormatter.setOutputPatternAsHeader(Z)V
at com.yammer.dropwizard.logging.LogFormatter.<init>(LogFormatter.java:14)
at com.yammer.dropwizard.logging.LogbackFactory.buildConsoleAppender(LogbackFactory.java:92)
at com.yammer.dropwizard.config.LoggingFactory.bootstrap(LoggingFactory.java:34)
at com.yammer.dropwizard.Service.<clinit>(Service.java:19)

I have gotten this example with many different examples that all work correctly on other computers.  Does anyone know how to fix this?

BmRb

unread,
Aug 22, 2013, 4:08:57 AM8/22/13
to dropwiz...@googlegroups.com
I have the same issue. Did you figure out how to fix it? 

cheers,

Nick Telford

unread,
Aug 22, 2013, 6:04:55 AM8/22/13
to dropwiz...@googlegroups.com
It sounds like you have a different version of Logback on your classpath. This is probably a transitive dependency brought in by something else you're depending on. You may need to add an exclusion for logback to that dependency.

Zachary Kimberg

unread,
Aug 22, 2013, 7:56:29 AM8/22/13
to dropwiz...@googlegroups.com
I did eventually figure it out.  For me, some program had added an incompatible version of logback directly into my jre(Program Files/jre7/lib/ext and Program Files/jdk1.7.0_25/jre/lib/ext).  I deleted the files logback-classic.jar, logback-core.jar, slf4j-api.jar, and xuggle-xuggle-jar from that folder and it worked again.
Zach

BmRb

unread,
Aug 22, 2013, 1:23:50 PM8/22/13
to dropwiz...@googlegroups.com
I fixed the problem by excluding the logback from one of dependencies. It was an old version of logback clashing with the one I had. Many thanks. 
Reply all
Reply to author
Forward
0 new messages