Search code examples
javawebsphereclasspathnoclassdeffounderror

java.lang.NoClassDefFoundError while deploying the War in websphere which uses Couchbase cache


I am facing the below error while deploying the war file in Websphere-8.5.5

Caused by: java.lang.NoClassDefFoundError: org/apache/http/params/SyncBasicHttpParams
        at com.couchbase.client.ViewConnection.createConnections(ViewConnection.java:120)
        at com.couchbase.client.ViewConnection.<init>(ViewConnection.java:100)
        at com.couchbase.client.CouchbaseConnectionFactory.createViewConnection(CouchbaseConnectionFactory.java:184)
        at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:247)
        at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:179)
        at com.infosys.aham.services.utils.cache.CouchbaseCacheManager.instantiateCouchbaseManager(CouchbaseCacheManager.java:145)
        at com.infosys.aham.services.utils.cache.CouchbaseCacheManager.<init>(CouchbaseCacheManager.java:55)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
        ... 87 more

I am using Couchbase-Client -1.1.9 and http-core-4.1.3 The http-core jar is bundled in the war file /web-inf/lib folder.

Also while looking in the websphere EnterprizeApplication-->application -->Manage Module --> moduleName--> ClassLoaderViewer --> LoaderView The http-core-4.1.3 is there in the table (jar is present in the classpath). (I also tried with the http-core 4.1.1 jar.)

The application is still not able to find the class present in the given jar. I am new to websphere, please help me out with this.

Thanks in advance.


Solution

  • The http-core classes are already included in WebSphere. To use different implementation create isolated shared library with conflicting libraries and map it to the application.