the corner office

a blog, by Colin Pretorius

AbstractMethodError and javassist. Woe.

Aw man. Why do these things have to get so complicated? I wanted to whip up a simple webapp using Hibernate. But when I fired up the app, I got:

Exception in thread "main" java.lang.AbstractMethodError: org.slf4j.impl.JDK14LoggerAdapter.trace(Ljava/lang/String;)V
	at org.hibernate.cfg.annotations.PropertyBinder.make(PropertyBinder.java:184)
... etc etc...

I found this discussion and a comment that it was an slf4j version mismatch with hibernate-annotations. So the solution is to explicitly include slf4j-log4j12 in your maven dependency list, before your hibernate-annotations dependency.

So with that sorted, I ran into the next problem:

Exception in thread "main" java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
	at org.hibernate.bytecode.javassist. BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
... etc etc...

To resolve that, you have to add javassist as an explicit Maven dependency.

That cost me the better part of tonight's tinkering time. Bah.

{2009.02.26 17:59}

Comments:

1. Brett Colville (2009.03.05 - 20:27) #

Thanks - very few responses on Google for the slf4j problem. Your fix worked for me - I had a unit test that was passing in Eclipse but failing from Maven.
Now I might get out of here at a reasonable time!

« Virtual losses

» Pork Brains In Milk Gravy