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. poj1778 All Discs Considered

    思路: 拓扑排序.贪心. 实现: #include <bits/stdc++.h> using namespace std; vector<]; int n1, n2; inline ...

  2. ubuntu下删除和新建用户(并有su权限)

    http://blog.csdn.net/speedme/article/details/8206144ubuntu下删除和新建用户(并有su权限) 如何创建ubuntu新用户?输入:sudo add ...

  3. MySQL 8.*版本 修改root密码

    MySQL .*版本 修改root密码 查看版本:select version() from dual; 1.6. 登录mysql: 登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码, ...

  4. Java面试问题——线程全面详解总结

    一.多线程是什么?为什么要用多线程? 介绍多线程之前要介绍线程,介绍线程则离不开进程. 首先进程 :是一个正在执行中的程序,每一个进程执行都有一个执行顺序,该顺序是一个执行路径,或者叫一个控制单元: ...

  5. 梦想MxWeb3D,三维CAD协同设计平台 2019.05.05更新

    SDK开发包下载地址: http://www.mxdraw.com/ndetail_20140.html 在线演示网址: http://www.mxdraw.com:3000/ 1.  增加CAD绘图 ...

  6. 我的MYSQL学习心得链接

    http://www.cnblogs.com/lyhabc/p/3793524.html

  7. 洛谷——P2007 魔方

    P2007 魔方 常神牛家的魔方都是3*3*3的三阶魔方,大家都见过. 模拟即可: #include<iostream> #include<cstdio> #include&l ...

  8. Linux之iptables(六、rich规则)

    其它规则 当基本firewalld语法规则不能满足要求时,可以使用以下更复杂的规则 rich-rules 富规则,功能强,表达性语言 Direct configuration rules 直接规则,灵 ...

  9. 将登录代码模块化,然后用add address接口来调用它,success!

    登录模块,单独写成mylogin()方法,保存为modeltry119.py,然后接口的文件只写接口, 在post请求时,引用mylogin()返回的cookies就好了. requests.post ...

  10. STM32 内存管理实验

    参考原文<STM32F1开发指南> 内存管理简介 内存管理,是指软件运行时对计算机内存资源的分配和使用的技术.最主要的目的是如何高效.快速的分配,并且在适当的时候释放和回收内存资源.内存管 ...