eclipse java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8356781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
提问by samme4life
I am tring to configure a dynamic web project using eclipse helos. I use tomcat 6. When I add the libraries to the WebContent/lib it works fine. But I want to a folder called lib in the project's root level(root/lib). When I put my library files to that folder it builds fine. Run fine to the login page. When I try to log in it gives "java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool" Please help me with this.
我正在尝试使用 eclipse helos 配置一个动态 Web 项目。我使用 tomcat 6。当我将库添加到 WebContent/lib 时,它工作正常。但是我想在项目的根级别(root/lib)中创建一个名为 lib 的文件夹。当我将库文件放入该文件夹时,它构建得很好。运行到登录页面。当我尝试登录时,它给出了“java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool”请帮我解决这个问题。
回答by duffymo
You're creating a web app and deploying it as a WAR file in a Java EE container. That means that your deployment must follow the WAR standards. Put your JARs in WEB-INF/lib. The container will find them there.
您正在创建一个 Web 应用程序并将其部署为 Java EE 容器中的 WAR 文件。这意味着您的部署必须遵循 WAR 标准。将您的 JAR 文件放在 WEB-INF/lib 中。容器会在那里找到它们。
Tomcat 6 and 7 have changed things up so JDBC driver JARs need to go in the server /lib directory. The app server expects to find them with its class loader. Try putting the MySQL JDBC connector JAR in /lib and see if that helps.
Tomcat 6 和 7 发生了变化,因此 JDBC 驱动程序 JAR 需要进入服务器 /lib 目录。应用服务器希望通过其类加载器找到它们。尝试将 MySQL JDBC 连接器 JAR 放在 /lib 中,看看是否有帮助。