2
回答
这是什么情况:The return type is incompatible with JspSourceDependent.getDependants()
滴滴云服务器,限时包月0.9元,为开发者而生>>>   

这是什么情况:The return type is incompatible with JspSourceDependent.getDependants()

An error occurred at line: [39] in the generated java file: [C:\apache-tomcat-8.0.23\webapps\jfinal\work\org\apache\jsp\index\index_jsp.java]

The return type is incompatible with JspSourceDependent.getDependants()


Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
at com.jfinal.render.JspRender.render(JspRender.java:67)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:93)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)


举报
壶漏子
发帖于3年前 2回/3K+阅
共有2个答案 最后回答: 3年前

擦,居然是jetty-server-8.1.8.jar的原因。在jetty-server-8.1.8.jar里getDependants的返回值是List<String>型。

package org.apache.jasper.runtime;


import java.util.List;


public abstract interface JspSourceDependent {
    public abstract List<String> getDependants();
}


-------------------------------------------------------------------------

而Apache Tomcat/8.0.23生成的返回类型是Map<java.lang.String,java.lang.Long>的。

/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: Apache Tomcat/8.0.23
 * Generated at: 2015-07-04 10:18:01 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp.index;


import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;


public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent,
                 org.apache.jasper.runtime.JspSourceImports {


  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();


  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;


  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

顶部