Running report using json data source throws Error "An error occurred while creating the connection. Try again"

0

Hi Team,

Have create JSON data source using the blob file url (where json file is stored in blob storage) and query is data and uploaded an jrxml report and connected the json data source.

Now running the report throws error "An error occurred while creating the connection. Try again"

Could you please help me on this issue. 

Thanks in advance,

Maduraipandian Manivel.

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.2.final using JasperReports Library version 6.3.2  -->
<!-- 2019-05-01T18:25:54 -->
<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="MainReportPoC2" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cb680906-7050-4fae-8e60-e81b7c5e8184">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="ireport.jasperserver.url" value="http://10.171.23.7:8080/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="superuser"/>
    <property name="ireport.jasperserver.reportUnit" value="/organizations/organization_1/reports/MainReportPoC2"/>
    <queryString language="SQL">
        <![CDATA[data]]>
    </queryString>
    <summary>
        <band height="25">
            <subreport>
                <reportElement x="0" y="0" width="28" height="25" uuid="a84dd20f-b176-410a-9120-7f328bd2a7bd"/>
                <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JsonDataSource("https://morspoc.blob.core.windows.net/asset-and-accruals/asset-and-accruals-taxlots.json","data")]]></dataSourceExpression>
                <subreportExpression><![CDATA["sub_report_pdf.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </summary>
</jasperReport>

======================== Error Log =========================================================

2019-05-02 02:24:43,987 ERROR AsyncJasperPrintAccessor,pool-6-thread-16:321 - Error during report execution
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: new net.sf.jasperreports.engine.data.JsonDataSource(new URL("https://morspoc.blob.core.windows.net/xxxxx/xxxxxxxx.json").openStream(),"data")
        at net.sf.jasperreports.engine.fill.JREvaluator.handleEvaluationException(JREvaluator.java:287)
        at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:319)
        at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:616)
        at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:584)
        at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1164)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:463)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:354)
        at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)
        at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:506)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillNoData(JRVerticalFiller.java:2604)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:178)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:607)
        at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:961)
        at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:169)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:912)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1840)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1159)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1088)
        at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:983)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)

maduraipandian.manivel's picture
Joined: Mar 22 2019 - 12:02am
Last seen: 2 months 4 days ago

1 Answer:

0

JSON needs to be a String. You're probably fetching it as a binary stream.

hozawa's picture
47007
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 months 1 week ago
Feedback