【发布时间】:2015-07-16 04:38:35
【问题描述】:
在 Websphere-8.5.5 中部署 war 文件时遇到以下错误
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
我正在使用 Couchbase-Client -1.1.9 和 http-core-4.1.3 http-core jar 捆绑在 war 文件 /web-inf/lib 文件夹中。
同时在 websphere 中查看 EnterprizeApplication-->application -->Manage Module --> moduleName--> ClassLoaderViewer --> LoaderView http-core-4.1.3 在表中(jar 存在于类路径中)。 (我也尝试过使用 http-core 4.1.1 jar。)
应用程序仍然无法找到给定 jar 中存在的类。 我是 websphere 新手,请帮我解决这个问题。
提前致谢。
【问题讨论】:
-
我的文件夹名为“web-inf”或“WEB-INF”?名称必须大写。
-
NoClassDefFound 表示该类已在编译中使用但在运行时未找到,因此在运行时不在类加载器中。尝试将 http-core jar 放在 websphere 的 lib 文件夹中。
-
大写“WEB-INF”
-
@Fran Montero - 你能指定我在哪里可以找到 lib 文件夹(在 websphere 中)。 jar 也存在于 WAR 文件的 lib 文件夹中,即使这样,为什么 websphere 也找不到 jar/class。
-
http-core 类已经包含在 WebSphere 中,要使用不同的实现,请尝试在您的 Web 模块中将 Parent 设置为最后,如果它没有帮助,您将需要创建具有冲突库的隔离共享库并将其映射到应用程序。
标签: java websphere classpath noclassdeffounderror