0

Does anybody know what this null pointer is?

This error is encountered when i try to run a simple TIBCO Maps report in Jaspersoft Studio 6.2.0. I have just dragged one Map element on the palette and then running the report.

java.lang.NullPointerException at net.sf.jasperreports.engine.JRAbstractExporter.ensureInput(JRAbstractExporter.java:692) 
at net.sf.jasperreports.engine.export.HtmlExporter.exportReport(HtmlExporter.java:218) 
at net.sf.jasperreports.web.servlets.ReportOutputServlet.render(ReportOutputServlet.java:235) 
at net.sf.jasperreports.web.servlets.ReportOutputServlet.service(ReportOutputServlet.java:94) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643) 

Below is the code JARXML report file code:

<?xml version="1.0" encoding="UTF-8"?>
<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" name="PushpTIBCOMapsDemo" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a63271b1-90fc-4646-aba8-015cd4f4ea17">
    <queryString>
        <![CDATA[select * from GeoData]]>
    </queryString>
    <field name="data_id" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="longi" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="latti" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="CityName" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <detail>
        <band height="340" splitType="Stretch">
            <componentElement>
                <reportElement x="-20" y="-20" width="595" height="360" uuid="dfc858af-d33f-4d56-a8db-fa687d606dd5"/>
                <c:tibcoMap xmlns:c="http://jaspersoft.com/tibcomaps" xsi:schemaLocation="http://jaspersoft.com/tibcomaps http://jaspersoft.com/schema/tibcomaps.xsd">
                    <c:mapData>
                        <c:item>
                            <c:itemProperty name="latitude">
                                <valueExpression><![CDATA[$F{longi}.floatValue()]]></valueExpression>
                            </c:itemProperty>
                            <c:itemProperty name="longitude">
                                <valueExpression><![CDATA[$F{latti}.floatValue()]]></valueExpression>
                            </c:itemProperty>
                            <c:itemProperty name="zoom" value="11"/>
                            <c:itemProperty name="country" value="India"/>
                            <c:itemProperty name="state" value="Haryana"/>
                            <c:itemProperty name="zip" value="122001"/>
                            <c:itemProperty name="city" value="Gurgaon"/>
                            <c:itemProperty name="street">
                                <valueExpression><![CDATA[$F{CityName}]]></valueExpression>
                            </c:itemProperty>
                            <c:itemProperty name="useCanvas" value="false"/>
                        </c:item>
                    </c:mapData>
                </c:tibcoMap>
            </componentElement>
        </band>
    </detail>
</jasperReport>

Also i am attaching the screenshot of included JAR's and libraries:

enter image description here

Alex K
  • 22,315
  • 19
  • 108
  • 236

2 Answers2

0

This was caused by a variable $V{options} being null because the scriptlet code that should set its value throws a Unsupported major minor 51.0 error when I try to access it in the expression editor window. To recap what I have done, I have created a simple .jar with a class to process a parameter in my Jasper report via scriptlets. I have added the .jar to the build path of the reports project.

The .jar has been compiled with JDK 1.7, and the execution enviroment of the Jasper project is set to JRE 1.7, and also the Java Compiler compliance level is 1.7. JAVA_HOME points to jdk 1.7.

Still JasperStudio complains of Unsupported major.minor version 51.0 when trying to access the .jar throught the scriptlet parameter.

Is JasperStudio using jdk 1.6 ? Yes, it seems. In fact, I ran another report and tried to print on it and tried to print System.getProperty("java.version") in a text field: it printed 1.6.0_65.

There is sth about JasperStudio evidently that still is overriding my jre/jdk choices of the jasper project,but I do not know where/how. Please send me your suggestions on where to look. Thanks a million

0

THe solution was to ensure that the Jasper Studio .ini file pointed to the correct local Java installation. For example: -vm /Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home/bin