Tuesday, November 12, 2013

Fix: Jasper Reports logs spurious “The ‘isSplitAllowed’ attribute is deprecated” warning

My team at work was having an issue where whenever we’d use Jasper Reports in our Java-based web application to generate a PDF version of a particular report, Jasper Reports would log several warnings like the following to our application log:

2013-11-08 09:39:26,778 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' requestURI=/PdfExport/PDF%20Export%20Test.pdf jsessionid=ccqLS8rP7ph8MTcYjgX6GGycbhpYjyYyk7GNHhgNfGKZG8KyMkyJ!1166636095!1383918575495 remoteAddr= userid=130000] WARN net.sf.jasperreports.engine.xml.JRBandFactory - The 'isSplitAllowed' attribute is deprecated. Use the 'splitType' attribute instead.

I was initially puzzled by this, since our .jrxml file doesn’t actually include either the “isSplitAllowed” or “splitType” attributes anywhere.

The problem turned out to be an obsolete !DOCTYPE element that we had at the top of our .jrxml report template file.  We are running Jasper Reports 5.2.0, but the top of .jrxml file looked like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> 
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" ... >

(Emphasis on the !DOCTYPE element above added.)  Simply removing the entire !DOCTYPE element, and leaving the remainder of the file as-is, resolved the issue.