MetaChrome
MetaChrome

Reputation: 3220

NoClassDefFoundError with jetty-maven-plugin

I am getting a:

he Cause java.lang.NoClassDefFoundError Msg:net/spy/memcached/MemcachedClient

When executing jetty:run -e in eclipse. Why isn't this dependency being added into the classpath?

Upvotes: 1

Views: 1596

Answers (3)

MetaChrome
MetaChrome

Reputation: 3220

The dependency had a provided scope. Change this.

Upvotes: 1

Mark O'Connor
Mark O'Connor

Reputation: 77951

Your code is missing a runtime dependency. I searched Maven Central for the missing class

http://search.maven.org/#search|ga|1|fc%3A%22net.spy.memcached.MemcachedClient%22

Try adding the following to your POM:

<dependency>
    <groupId>org.apache.servicemix.bundles</groupId>
    <artifactId>org.apache.servicemix.bundles.spymemcached</artifactId>
    <version>2.5_2</version>
    <packaging>bundle</packaging>
</dependency>

Upvotes: 1

Ryan Stewart
Ryan Stewart

Reputation: 128779

Which classpath do you expect it to be added to? If something in your project is trying to load it, ensure you have a project dependency that has that class in it. It looks like it comes from ServiceMix. If you've added something to Jetty itself to make it require that class, then add the dependency to the jetty plugin.

Upvotes: 2

Related Questions