I recently had:
java.lang.NoSuchMethodError: org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.<init>(IIIIIZ)V
happening to me when I attempted to container:start
(from xsbt-web-plugin) within an sbt session on a Spray/spray-servlet application. I was going to great lengths to search my $CLASSPATH
and dependency's transitive dependencies to determine what was relying on an older version of Netty causing the Datastax driver to fail. I was coming up empty handed.
Then I ran the application from IntelliJ and it worked just fine. This meant either my shell or sbt session was suspect.
My default $CLASSPATH
variable is empty so I figured it probably wasn't my shell.
Executing show fullClasspath
from within an sbt session gave me a ton of paths but only the expected netty dependency.
So I added the following code to try and narrow down just where the older netty jar was coming from:
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder
val c = classOf[LengthFieldBasedFrameDecoder]
logger.debug(s"${c.getProtectionDomain.getCodeSource}")
and lo and behold it was coming from the very plugin that enabled container:start
:
(file:/Users/cfeduke/.ivy2/cache/com.github.jsimone/webapp-runner/jars/webapp-runner-7.0.34.1.jar <no signer certificates>)
(as a transitive dependency)
Unfortunately modifying and updating the source for xsbt-web-plugin to exclude("org.jboss.netty", "netty")
- this was a much older version of netty bundled, before the change to the "io.netty" organization - didn't seem to fix the problem.