问题描述
代码:JsonConfig jsonConfig = JsonUtil.configJson("yyyy-MM-dd");JSONObject jobject = JSONObject.fromObject(pageBean,jsonConfig);这行报错了common-lang.jar,还有一个common-lang-1.0.1.jar,两者怎么使用啊》我的工程下都有java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.isBlank(Ljava/lang/String;)Zat net.sf.json.JsonConfig.getMergedExcludes(JsonConfig.java:561)at net.sf.json.JsonConfig.getMergedExcludes(JsonConfig.java:587)at net.sf.json.JSONObject._fromBean(JSONObject.java:902)at net.sf.json.JSONObject.fromObject(JSONObject.java:194)at ajax.TimeServlet.doPost(TimeServlet.java:109)at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)at java.lang.Thread.run(Thread.java:595) 问题补充:7454103 写道
解决方案
jar包版本太低。使用commons-lang-2.4.jar
解决方案二:
删掉一个 试试 可能jar 包冲突了!