Jump to content
We've recently updated our Privacy Statement, available here ×

5.1.0: java.lang.ArrayIndexOutOfBoundsException: 0


mfournier_1

Recommended Posts

We're trying to figure out why the following error happens when we try and run our report on a 5.1.0 JasperServer running on a FreeBSD box ... its not related to the SQL query, as we've tested it both on iReports on a Mac OS X desktop, and from the database server itself ...

The fact that it is reporting in sun.font.*, the only thought I have is that the Mac OS X side, where we are building the report, is using a font that isn't on the FreeBSD side ... but is there something else I should be looking at?

Thanks ...

=== Error Track ===

java.lang.ArrayIndexOutOfBoundsException: 0 at sun.font.ExtendedTextSourceLabel.createCharinfo(ExtendedTextSourceLabel.java:608) at sun.font.ExtendedTextSourceLabel.getCharinfo(ExtendedTextSourceLabel.java:508) at sun.font.ExtendedTextSourceLabel.getLineBreakIndex(ExtendedTextSourceLabel.java:454) at java.awt.font.TextMeasurer.calcLineBreak(TextMeasurer.java:325) at java.awt.font.TextMeasurer.getLineBreakIndex(TextMeasurer.java:561) at java.awt.font.LineBreakMeasurer.nextOffset(LineBreakMeasurer.java:358) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.measureExactLineBreakIndex(SimpleTextLineWrapper.java:561) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.measureExactLine(SimpleTextLineWrapper.java:535) at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.nextLine(SimpleTextLineWrapper.java:517) at net.sf.jasperreports.engine.fill.TextMeasurer.renderNextLine(TextMeasurer.java:654) at net.sf.jasperreports.engine.fill.TextMeasurer.renderParagraph(TextMeasurer.java:459) at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:400) at net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurer.measure(JdkGlyphFixTextMeasurer.java:142) at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:541) at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:184) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:384) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:346) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:280) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFiller.run(BaseFillHandle.java:120) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:875) at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:165) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:831) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1658) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679)

The offending code in the jrxml file appears to be:

 

====

..insert your code here..[/code]

        <band height="28" splitType="Stretch">
            <staticText>
                <reportElement uuid="849400f9-420e-4e51-854b-616f3361af26" x="0" y="0" width="350" height="20"/>
                <textElement>
                    <font fontName="DejaVu Sans" size="14" isBold="true"/>
                </textElement>
                <text><![CDATA[school District 63: Enrollment Report]]></text>
            </staticText>
        </band>

 

If I change it to Arial, then I get a 'Missing font' error instead, so it doesn't look like its that the font isn't available, which was my first thought ...

 

Anyone?

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Could you enable debug logging for net.sf.jasperreports.engine.fill.SimpleTextLineWrapper (that is add log4j.logger.net.sf.jasperreports.engine.fill.SimpleTextLineWrapper=trace in WEB-INF/log4j.properties), restart JRS, run the report and post the log file?

That might give some hints on what is going on..

PS:  Please also mention the Java version that you are using.

Regards,

Lucian

Link to comment
Share on other sites

First, assume this is the part the log file that is of interest? The rest is just the trace previously posted:

 

===

2013-06-19 17:12:23,274 DEBUG SimpleTextLineWrapper,pool-4-thread-1:300 - creating element font infos cache of size 2000

2013-06-19 17:12:23,294 DEBUG SimpleTextLineWrapper,pool-4-thread-1:343 - font java.awt.Font[family=DejaVu Sans,name=DejaVu Sans,style=plain,size=14] has complex layout false, leading 0.0

2013-06-19 17:12:23,296 DEBUG SimpleTextLineWrapper,pool-4-thread-1:280 - creating element font info for {family: DejaVu Sans, size: 14, style: 0} and element 849400f9-420e-4e51-854b-616f3361af26

2013-06-19 17:12:23,299 DEBUG SimpleTextLineWrapper,pool-4-thread-1:418 - paragraph start at 0, truncate at char false, LTR true, exact measure false

2013-06-19 17:12:23,305 DEBUG SimpleTextLineWrapper,pool-4-thread-1:507 - simple line measurement at 0 to 37 in width 350.0 with font java.awt.Font[family=DejaVu Sans,name=DejaVu Sans,style=plain,size=14]

===

 

If you actually want the *whole* log file, let me know, just didn't want to spam the forum ...

 

As for the 'missing details' ...

 

I'm running this on:

 

FreeBSD 9-STABLE

 

Installed using the port, which installs:

 

OpenJDK6

Tomcat7

 

And have it setup with a PostgreSQL 9.2 backend.

 

As this is running on a headless server, it is started with the following in /etc/rc.conf:

 

tomcat7_enable="YES"

tomcat7_java_opts="-Xms1024m -Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"

 

Thanks ...

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...