Jump to content
Changes to the Jaspersoft community edition download ×

net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: net.sf.jasperreports.engine.data.JsonDataSource cannot be cast to java.sql.Connection


1766680358

Recommended Posts

I had a problem when I used the JSON data source to generate a report

 

    net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: net.sf.jasperreports.engine.data.JsonDataSource cannot be cast to java.sql.Connection

    at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:551)

    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:526)

    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:444)

    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Caused by: java.lang.ClassCastException: net.sf.jasperreports.engine.data.JsonDataSource cannot be cast to java.sql.Connection

    at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:509)

    at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:350)

    at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)

    at net.sf.jasperreports.engine.fill.JRFillFrame.evaluate(JRFillFrame.java:159)

    at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)

    at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2583)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264)

    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)

    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)

    at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:433)

    at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:818)

    at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:61)

    at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)

    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)

 

This is my JSON data

{

    "supplierName": "aa",

    "supplierCity": "supplierCity",

    "supplierNo": "",

    "dnNo": "",

    "customerName": "",

    "customerCity": "",

    "customerNo": "",

    "dataList": [

      {

        "matailDetail": [

          {

            "b1": "10",

            "b2": "20",

            "b3": "30",

            "b4": "40",

            "b5": "50"

          },

          {

            "b1": "60",

            "b2": "70",

            "b3": "80",

            "b4": "90",

            "b5": "100"

          }

        ],

        "pList": [

          {

            "s1": "5002528310",

            "s2": "03L 130 216 A",

            "s3": "750000 PC",

            "s4": "123456789 Series",

            "s5": "S000111222",

            "s6": "1040H AB-Z4-3",

            "containers": [

              {

                "lineDetails": [

                  {

                    "trayNo": "1",

                    "a1": "1",

                    "a2": "Single",

                    "a3": "KISTE A",

                    "a4": "SNR 1",

                    "a5": "15 ST"

                  }

                ]

              },

              {

                "lineDetails": [

                  {

                    "trayNo": "2",

                    "a1": "1",

                    "a2": "Master",

                    "a3": "PALETTE A"

                  },

                  {

                    "trayNo": "2",

                    "a1": "1",

                    "a2": "",

                    "a3": "DECKEL A"

                  },

                  {

                    "trayNo": "2",

                    "a1": "4",

                    "a2": "Single",

                    "a3": "KISTE B",

                    "a4": "SNR 1",

                    "a5": "20 ST"

                  }

                ]

              }

            ]

          }

        ]

      }

    ]

  }

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

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...