Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.NoSuchMethodError exception for having correct JAR loaded
    primarykey
    data
    text
    <p>I am writing a Java web app and put in Tomcat to run.</p> <p>When I tried to use a method included in JAR (which I am sure it contains the method I need), it shows:</p> <pre><code>java.lang.NoSuchMethodError: com.couchbase.client.CouchbaseClient.asyncGetBulk(Ljava/util/Collection;)Ljava </code></pre> <p>But I tried to started tomcat by <code>-verbose:class</code>, I see the following log:</p> <pre><code>[Loaded net.spy.memcached.ops.VBucketAware from file:/.../apache-tomcat-5.5.30/webapps/.../WEB-INF/lib/spymemcached-2.8.2.jar] [Loaded net.spy.memcached.protocol.binary.SingleKeyOperationImpl from file:/.../apache-tomcat-5.5.30/webapps/.../WEB-INF/lib/spymemcached-2.8.2.jar] [Loaded net.spy.memcached.protocol.binary.GetOperationImpl from file:/.../apache-tomcat-5.5.30/webapps/.../WEB-INF/lib/spymemcached-2.8.2.jar] Exception in thread "Thread-2139" java.lang.NoSuchMethodError: com.couchbase.client.CouchbaseClient.asyncGetBulk(Ljava/util/Collection;)Ljava/util/concurrent/Future </code></pre> <p>While spymemcached-2.8.2.jar contains the method, so I do not understand why it fails.</p> <p>This is how I call the method:</p> <pre><code>Future&lt;Map&lt;String,Object&gt;&gt; f = client.asyncGetBulk(key); </code></pre> <p>Thanks for your help.</p> <p><strong>Update 1:</strong></p> <p>By using the code @Narendra Pathai provides, I got the following result</p> <pre><code>[ file:/.../WEB-INF/classes/, file:/.../WEB-INF/lib/activation-1.1.jar, file:/.../WEB-INF/lib/commons-codec-1.5.jar, file:/.../WEB-INF/lib/commons-lang-2.2.jar, file:/.../WEB-INF/lib/commons-logging-1.1.1.jar, file:/.../WEB-INF/lib/couchbase-client-1.0.3.jar, file:/.../WEB-INF/lib/jaxb-api-2.1.jar, file:/.../WEB-INF/lib/jaxb-impl-2.1.9.jar, file:/.../WEB-INF/lib/jettison-1.1.jar, file:/.../WEB-INF/lib/netty-3.2.0.Final.jar, file:/.../WEB-INF/lib/runtime-0.4.1.5.jar, file:/.../WEB-INF/lib/spymemcached-2.8.2.jar, file:/.../WEB-INF/lib/stax-api-1.0-2.jar, file:/.../WEB-INF/lib/xxx_core.jar, file:/.../WEB-INF/lib/xxx_couchbase.jar ] </code></pre> <p>They do not contain the file with the path <code>com.couchbase.client.CouchbaseClient.asyncGetBulk</code> except couchbase-client-1.0.3.jar.</p> <p><strong>Update 2:</strong></p> <p>By using the code:</p> <pre><code>CodeSource codeSource = CouchbaseClient.class.getProtectionDomain().getCodeSource(); if (codeSource != null) { log.debug(codeSource.getLocation()); } CodeSource codeSource2 = net.spy.memcached.MemcachedClient.class.getProtectionDomain().getCodeSource(); if (codeSource2 != null) { log.debug(codeSource2.getLocation()); } </code></pre> <p>I have got the following result:</p> <pre><code>file:/.../WEB-INF/lib/couchbase-client-1.0.3.jar file:/.../WEB-INF/lib/spymemcached-2.8.2.jar </code></pre> <p>It seems that they are correct too.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload