Search code examples
javajasper-reports

Got "The type java.lang.CharSequence cannot be resolved" error when compile JasperReports template


I use Netbeans 8.1 and iReport 5.5.0 plugin. I made a change in my report field.

$F{SASI_NO}.contains("-E")?$F{SASI_NO}.split("-")[0]:$F{SASI_NO}

It works fine in my local. But I deployed it in a server. It did not work and the error is like below.

javax.servlet.ServletException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files value = ((java.lang.String)field_SASI_NO.getValue()).contains("-E")?((java.lang.String)field_SASI_NO.getValue()).split("-")[0]:((java.lang.String)field_SASI_NO.getValue()); //$JR_EXPR_ID=31$

anyone help?


Solution

  • I found a solution. My windows server's Java version was 1.8.0.121. I downgrade Java to 1.7 version.


    The issue described here: JRXML not compiling in Java 8.

    This bug of JasperReports library was fixed at 6.0 version