KindEditor上传文件出错,HTTP Status 500 - Unable to compile class for JSP:该如何处理

   阅读
KindEditor上传文件出错,HTTP Status 500 - Unable to compile class for JSP:
有没有人在使用KindEditor的上传功能时遇到下面这样的问题。
HTTPStatus500-UnabletocompileclassforJSP:

typeExceptionreport

messageUnabletocompileclassforJSP:

descriptionTheserverencounteredaninternalerrorthatpreventeditfromfulfillingthisrequest.

exception

org.apache.jasper.JasperException:UnabletocompileclassforJSP:

Anerroroccurredatline:124inthejspfile:/editor_plugins/jsp/upload_json.jsp
JSONObjectcannotberesolvedtoatype
121:%>
122:<%!
123:privateStringgetError(Stringmessage){
124:JSONObjectobj=newJSONObject();
125:obj.put("error",1);
126:obj.put("message",message);
127:returnobj.toJSONString();


Anerroroccurredatline:124inthejspfile:/editor_plugins/jsp/upload_json.jsp
JSONObjectcannotberesolvedtoatype
121:%>
122:<%!
123:privateStringgetError(Stringmessage){
124:JSONObjectobj=newJSONObject();
125:obj.put("error",1);
126:obj.put("message",message);
127:returnobj.toJSONString();


Anerroroccurredatline:39inthejspfile:/editor_plugins/jsp/upload_json.jsp
ServletFileUploadcannotberesolved
36:
37:response.setContentType("text/html;charset=UTF-8");
38:
39:if(!ServletFileUpload.isMultipartContent(request)){
40:out.println(getError("乱码。。。"));
41:return;
42:}


Anerroroccurredatline:79inthejspfile:/editor_plugins/jsp/upload_json.jsp
FileItemFactorycannotberesolvedtoatype
76:dirFile.mkdirs();
77:}
78:
79:FileItemFactoryfactory=newDiskFileItemFactory();
80:ServletFileUploadupload=newServletFileUpload(factory);
81:upload.setHeaderEncoding("UTF-8");
82:Listitems=upload.parseRequest(request);


Anerroroccurredatline:79inthejspfile:/editor_plugins/jsp/upload_json.jsp
DiskFileItemFactorycannotberesolvedtoatype
76:dirFile.mkdirs();
77:}
78:
79:FileItemFactoryfactory=newDiskFileItemFactory();
80:ServletFileUploadupload=newServletFileUpload(factory);
81:upload.setHeaderEncoding("UTF-8");
82:Listitems=upload.parseRequest(request);


Anerroroccurredatline:80inthejspfile:/editor_plugins/jsp/upload_json.jsp
ServletFileUploadcannotberesolvedtoatype
77:}
78:
79:FileItemFactoryfactory=newDiskFileItemFactory();
80:ServletFileUploadupload=newServletFileUpload(factory);
81:upload.setHeaderEncoding("UTF-8");
82:Listitems=upload.parseRequest(request);
83:Iteratoritr=items.iterator();


Anerroroccurredatline:80inthejspfile:/editor_plugins/jsp/upload_json.jsp
ServletFileUploadcannotberesolvedtoatype
77:}
78:
79:FileItemFactoryfactory=newDiskFileItemFactory();
80:ServletFileUploadupload=newServletFileUpload(factory);
81:upload.setHeaderEncoding("UTF-8");
82:Listitems=upload.parseRequest(request);
83:Iteratoritr=items.iterator();


Anerroroccurredatline:85inthejspfile:/editor_plugins/jsp/upload_json.jsp
FileItemcannotberesolvedtoatype
82:Listitems=upload.parseRequest(request);
83:Iteratoritr=items.iterator();
84:while(itr.hasNext()){
85:FileItemitem=(FileItem)itr.next();
86:StringfileName=item.getName();
87:longfileSize=item.getSize();
88:if(!item.isFormField()){


Anerroroccurredatline:85inthejspfile:/editor_plugins/jsp/upload_json.jsp
FileItemcannotberesolvedtoatype
82:Listitems=upload.parseRequest(request);
83:Iteratoritr=items.iterator();
84:while(itr.hasNext()){
85:FileItemitem=(FileItem)itr.next();
86:StringfileName=item.getName();
87:longfileSize=item.getSize();
88:if(!item.isFormField()){


Anerroroccurredatline:115inthejspfile:/editor_plugins/jsp/upload_json.jsp
JSONObjectcannotberesolvedtoatype
112:return;
113:}
114:
115:JSONObjectobj=newJSONObject();
116:obj.put("error",0);
117:obj.put("url",saveUrl+newFileName);
118:out.println(obj.toJSONString());


Anerroroccurredatline:115inthejspfile:/editor_plugins/jsp/upload_json.jsp
JSONObjectcannotberesolvedtoatype
112:return;
113:}
114:
115:JSONObjectobj=newJSONObject();
116:obj.put("error",0);
117:obj.put("url",saveUrl+newFileName);
118:out.println(obj.toJSONString());


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
noteThefullstacktraceoftherootcauseisavailableintheApacheTomcat/7.0.47logs.

ApacheTomcat/7.0.47

------解决思路----------------------
你没有阅读jsp文件夹下的README.txt文件

使用方法:

1.解压zip文件,将所有文件复制到Tomcat的webapps/kindeditor目录下。

2.将kindeditor/jsp/lib目录下的3个jar文件复制到Tomcat的lib目录下,并重新启动Tomcat。
*commons-fileupload-1.2.1.jar
*commons-io-1.4.jar
*json_simple-1.1.jar

3.打开浏览器,输入http://localhost:[P0RT]/kindeditor/jsp/demo.jsp。

------解决思路----------------------
引用:
你的也是这个问题吗?

看一下jsp文件夹下的README.txt文件,看看对应的jar包有没有导入,还有对应的上传路径有没有设置正确!


请问你具体是怎么操作的?
阅读