Linux下基于JSP的报表集成到项目中后,显示不出来,查看tomcat的日志。有例如以下报错信息:

The return type is incompatible with JspSourceDependent.getDependants()

Stacktrace:] with root cause

 org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [33] in the generated java file: [/home/programs/apache-tomcat-PowerSupervise/work/Catalina/localhost/PowerSupervise/org/apache/jsp/reportPages/jspReport/fileRecordReport_jsp.java]

大致就是生成的JSP相应的java文件33行报错,解析错误。找到相应的java文件里相应代码。例如以下:

package org.apache.jsp.reportPages.jspReport;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*; public final class fileRecordReport_jsp extends org.apache.jasper.runtime.HttpJspBase
<strong> implements org.apache.jasper.runtime.JspSourceDependent</strong> { 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; static {
_jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(1);
_jspx_dependants.put("/WEB-INF/reportConfig/runqianReport4.tld", Long.valueOf(1435203638000L));
} private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005freport_005fhtml_0026_005fwidth_005fseparator_005fselectText_005fscrollWidth_005fscrollHeight_005fscale_005freportFileName_005fparams_005fneedScroll_005fname_005ffuncBarLocation_005fexceptionPage_005fnobody; private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
<strong>
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}</strong>

网上搜了搜。大部分原因是因为这个JspSourceDependent类冲突引起的,只是找遍全部WEB-INF/lib和tomcat下的lib以及jre中下有关jsp解析的jar包,除tomcat的lib下。没发现有类似版本号不同反复的jar包。于是在集成开发环境ECLIPSE中打入这个类。竟然能找到这个类。提示自己主动引入后,例如以下:

然后ctrl键盘按住。点击这个类。最终找到了这个类所在的jar包及路径了,例如以下:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center">

竟然在jetty-server-8.1.8.jar里也有此类,怪不得呢,于是删除了此类,报表恢复正常了。

网上也例如以下情况出现此问题:

1、jsper-runtime.jar存在冲突,删除就可以。

2、在升级tomcat后的项目中,后出现此问题。解决的方法是新建jsp文件。把老jsp文件的内容copy过来。就攻克了。只是这是网友的解决方法,针对这样的情况,个人之见,根本原因还是jar包版本号与旧的已生成的_jsp.java类中的类存在冲突。仅仅需把tomcat的work文件夹下的东西删除重新启动tomcat用新的环境又一次解析JSP就可以。

JasperException问题与解决的方法。the return type is incompatible with,JspSourceDependent.getDependants(),jsper.jar冲突,JSP解析异常

The return type is incompatible with JspSourceDependent.getDependants():JasperException问题分析与解决方法的更多相关文章

  1. 使用JFinal的第一个项目出现的问题(The return type is incompatible with JspSourceDependent.getDependants())

    四月 08, 2016 4:35:34 下午 org.apache.catalina.core.ApplicationDispatcher invoke严重: Servlet.service() fo ...

  2. C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析与解决方法

    对于C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析,目前本人分析两种情况,如下: 情况一: 借鉴麒麟.NET ...

  3. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 解决方法

    在VS2012中生成时出错:error C4430: missing type specifier - int assumed. Note: C++ does not support default- ...

  4. Type.GetType()在跨程序集反射时返回null的解决方法

    在开发中,经常会遇到这种情况,在程序集A.dll中需要反射程序集B.dll中的类型.如果使用稍有不慎,就会产生运行时错误.例如使用Type.GetType("BNameSpace.Class ...

  5. Dynamics CRM2015 The plug-in type does not exist in the specified assembly问题的解决方法

    在用插件工具PluginProfiler调试时,报"The plug-in type  xxxx  does not exist in the specified assembly" ...

  6. 关于在调用JAVAFX相关包时遇到Access restriction: The type 'Application' is not API (restriction on required library)的解决方法

    点击工具栏的Project->Properties->Java Build Path->Libraries-> 双击第一项 点击Add添加允许javafx 然后就不会报错了

  7. variable '' of type '' referenced from scope '', but it is not defined 异常解决方法

    最近在做一个功能,通过拼接lamdba表达试来实现的功能,但测试时总是出现一个错误,如下图所示,网上也找不到答案,差点都放弃了.. 如上图图所示,我是想通过一个lamdba表达式(上图的IdField ...

  8. Generic method return type

    Here's the Animal class: public class Animal{ private Map<String,Animal> friends =new HashMap& ...

  9. c++11: trailing return type in functions(函数返回类型后置)

    In C++03, the return type of a function template cannot be generalized if the return type relies on ...

随机推荐

  1. 从React看weight开发

    从当前云发展的势头来看几乎所有互联网应用都趋向大一统的趋势,一个node下面加一堆应用,同时我们项目也趋向把复杂的大应用拆分成多个小应用,通过各种复杂的Api来协作,通信,达到同样的效果. 可以看出, ...

  2. PSP辅助软件开发计划

    PSP辅助软件开发计划 作者: 日期:2013年11月14号 1开发目的 鉴于软件开发过程中,程序员往往无法在规定时间内完成任务,而且无法给出拖延的时间从而造成项目进度计划不准确.开发此软件帮助程序员 ...

  3. Expectation-Maximization(EM) 算法

    Expectation-Maximization 算法是统计学中用来给带隐含变量的模型做最大似然(和最大后验概率)的一种方法.EM 的应用特别广泛,经典的比如做概率密度估计用的 Gaussian Mi ...

  4. Exception Information

    https://developer.apple.com/library/content/technotes/tn2004/tn2123.html Exception Information The t ...

  5. C++写注册表

    1.       注册表简介 注册表是为Windows NT和Windows95中所有32位硬件/驱动和32位应用程序设计的数据文件,用于存储系统和应用程序的设置信息.16位驱动在Winnt (Win ...

  6. du 命令计算隐藏文件夹或文件

    du -sh * .[^.]*

  7. Python【每日一问】34

    问: 基础题: 定义函数实现以下功能:求出 0-n 所能组成的奇数个数,位数最多 n+1 (0<n<10),比如键盘输入n=7,求出0-7所能组成的奇数个数 提高题: 有如下分数序列: 2 ...

  8. HTML5大数据可视化效果(一)彩虹爆炸图

    前言 25年过去了,Brooks博士著名的“没有银弹”的论断依旧没有被打破.HTML5也是一样.但这并不妨碍HTML5是一个越来越有威力的“炸蛋”:发展迅速.势不可挡.随着HTML5技术的普及,用HT ...

  9. 洛谷—— P1450 [HAOI2008]硬币购物

    P1450 [HAOI2008]硬币购物 硬币购物一共有$4$种硬币.面值分别为$c1,c2,c3,c4$.某人去商店买东西,去了$tot$次.每次带$di$枚$ci$硬币,买$si$的价值的东西.请 ...

  10. Session共享实现方案调研

    1.背景 随 着互联网的日益壮大,网站的pv和uv成线性或者指数倍的增加.单服务器单数据库早已经不能满足实际需求.目前大多数大型网站的服务器都采用了分布式服务 集群的部署方式,所谓集群,就是让一组计算 ...