ApachePHPMySQL 2018-01-10
前几天整UEditor,又报了一个错:
SEVERE: Servlet.service() for servlet jsp threw exception Throwable occurred: java.lang.NoSuchMethodError: org/apache/commons/io/FileUtils.getTempDirectory()Ljava/io/File; at com.baidu.ueditor.upload.StorageManager.getTmpFile(StorageManager.java:117) at com.baidu.ueditor.upload.StorageManager.saveFileByInputStream(StorageManager.java:51) at com.baidu.ueditor.upload.BinaryUploader.save(BinaryUploader.java:75) at com.baidu.ueditor.upload.Uploader.doExec(Uploader.java:24) at com.baidu.ueditor.ActionEnter.invoke(ActionEnter.java:80) at com.baidu.ueditor.ActionEnter.exec(ActionEnter.java:49) at org.apache.jsp.core.ueditor.jsp.controller_jsp._jspService(controller_jsp.java:74) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
这是jar包报的错 。
我下的UEditor是1.4.3的,它自带的commons-io.jar是2.4的,而我原本项目里的是1.4的,因此出现问题。
解决方法很简单,将1.4的替换成2.4的就好啦。
值得一提的是:下载的UEditor自带了它这个版本需要的jar包,系统里边最好使用这些j版本的ar包,因为可能会出现类似于上面的问题。当然替换的前提条件是新的jar包不影响原有功能。
将下载好的文件解压到thinkphp项目中,本文是解压到PUBLIC目录下并改文件夹名称为ueditor. <textarea type="text" name="content" id="Edito