gpt4 book ai didi

java.lang.ClassNotFoundException : org. apache.commons.lang.exception.NetableRuntimeException 异常

转载 作者:搜寻专家 更新时间:2023-10-30 21:45:21 25 4
gpt4 key购买 nike

我正在尝试从数据库中检索数据。当我运行程序时它显示错误 java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NetableRuntimeException WEB-INF --> lib 目录,我不知道为什么它为 JSONArray 显示这个错误。

我的代码是:

        StringBuilder sb=new StringBuilder(1024);
sb.append("select * from ").append(uname.trim()).append("vcomments").append(" where itemid=").append(itemId).append(" and albumid=").append(albumId);
sql=sb.toString();
stmt = conn.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
//ArrayList<String> CommArray=new ArrayList();
JSONArray arrayObj=new JSONArray(); //#100


while(rs.next()){
Commenter comment = new Commenter();
comment.setUname(rs.getString("uname").trim());
comment.setComment(rs.getString("comments").trim());
arrayObj.add(comment.toString());

}
commentObj=gson.toJsonTree(arrayObj);
myObj.add("commentInfo", commentObj);
out.println(myObj.toString());
rs.close();
stmt.close();
stmt = null;


conn.close();
conn = null;

}

控制台输出是:

 SEVERE: Servlet.service() for servlet [VComment] in context with path [/skypark] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at skypark.VComment.doGet(VComment.java:100)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

请任何人告诉我如何解决这个问题......谢谢......

最佳答案

我遇到了同样的问题,并且 - 和你一样 - 我下载了最新的 commons-lang。但实际上我可以通过下载 apache commons-lang 2.6 来解决它( DDL ) 并将 jar 放在 WEB-INF/lib 下

希望您同时解决了它。

关于java.lang.ClassNotFoundException : org. apache.commons.lang.exception.NetableRuntimeException 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15004822/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com