贾斯珀报道。准备执行报告查询的语句时出错

时间:2015-08-10 09:38:27

标签: java mysql jasper-reports

我无法通过jasper报告进行打印。它会产生以下错误消息。

Error preparing statement for executing the report query : 

select *,concat(address1,", ",address2," ",address3) as address from emp_salary_info,shop_information where emp_code=? order by sal_id desc limit 1

但是这个代码在MySQL查询浏览器中执行得很好。以下是jasperprint的错误报告。

        at com.vanuston.medeil.dao.EmployeeSalaryDAO.empSalaryPrint(EmployeeSalaryDAO.java:229)
        at com.vanuston.medeil.controller.EmployeeSalaryController.empSalaryPrint(EmployeeSalaryController.java:53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
        at sun.rmi.transport.Transport$1.run(Transport.java:159)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NoSuchFieldException: AXIS_TICK_LABEL_FONT_SIZE
        at java.lang.Class.getField(Class.java:1520)
        at org.springframework.beans.factory.config.FieldRetrievingFactoryBean.afterPropertiesSet(FieldRetrievingFactoryBean.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
        ... 41 more
    DEBUG net.sf.jasperreports.extensions.SpringExtensionsRegistry  - Found 0 beans for extension type interface net.sf.jasperreports.engine.query.QueryExecuterFactoryBundle
    DEBUG net.sf.jasperreports.engine.query.JRJdbcQueryExecuter  - SQL query string: select *,concat(address1,", ",address2," ",address3) as address from emp_salary_info,shop_information where emp_code=? order by sal_id desc limit 1
    DEBUG net.sf.jasperreports.engine.fill.JRFillDataset  - Fill 14340419: closing query executer

e.printStackTrace显示以下错误。

net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query : 

select *,concat(address1,", ",address2," ",address3) as address from emp_salary_info,shop_information where emp_code=?;


    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:240)
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:131)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:686)
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:606)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1273)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:892)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
    at com.vanuston.medeil.dao.EmployeeSalaryDAO.empSalaryPrint(EmployeeSalaryDAO.java:232)
    at com.vanuston.medeil.controller.EmployeeSalaryController.empSalaryPrint(EmployeeSalaryController.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.Util.getInstance(Util.java:381)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
    at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1098)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4076)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4042)
    at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:170)
    ... 24 more

0 个答案:

没有答案