急!报表组通过 API 生成 word 文件时报 NLS 错误
在报表组通过 API 将报表组文件生成 word 文件时报错。
同时有两个奇怪的现象:
1、在调用 API 之前,对该报表组进行预览和 word 报告下载都是正常的,但是一旦调用了 API,再对该报表组进行预览,也报下面同样的错误。
2、我们将润乾的 lib 包更换到之前的版本,API 调用就正常了。
基于上面的两点,我初步感觉:虽然报的 oracle 错误,但是应该跟 oracle 关系不是特别大,估计是升级的问题。
- 具体的报错位置为报表组监听类中重新计算子报表的 IReport iReport 对象时报错。
- 错误信息如下:
-
Making DataFactory:com.raqsoft.report.dataset.SQLDataSetFactory failure (数据集名称): 一览表检测项目
Caused:ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:179)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:145)
at com.raqsoft.report.usermodel.Engine.calc(Engine.java:95)
at jichu.RaqPageListener.afterCalc(RaqPageListener.java:53)
at com.raqsoft.report.ide.GroupEngine.(GroupEngine.java:127)
at com.raqsoft.report.ide.GroupEngine.(GroupEngine.java:172)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1143)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1100)
at ExportGroupFilePDFToServer.doPost(ExportGroupFilePDFToServer.java:270)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.raqsoft.report.webutil.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at filter.XssFilter.doFilter(XssFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: com.scudata.common.RQException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:467)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:161)
… 38 more
Caused by: java.sql.SQLException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:785)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.raqsoft.report.ide.base.DataSource.connectDB(DataSource.java:244)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:289)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:301)
at com.raqsoft.report.ide.base.DataSource.getConnection(DataSource.java:282)
at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:95)
… 39 more
[2024-05-30 14:40:10]
INFO: Calculation start,first get data from source……
com.scudata.common.RQException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效
at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:467)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:161)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:145)
at com.raqsoft.report.usermodel.Engine.calc(Engine.java:95)
at jichu.RaqPageListener.afterCalc(RaqPageListener.java:53)
at com.raqsoft.report.ide.GroupEngine.<init>(GroupEngine.java:127)
at com.raqsoft.report.ide.GroupEngine.<init>(GroupEngine.java:172)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1143)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1100)
at ExportGroupFilePDFToServer.doPost(ExportGroupFilePDFToServer.java:270)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.raqsoft.report.webutil.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at filter.XssFilter.doFilter(XssFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:785)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.raqsoft.report.ide.base.DataSource.connectDB(DataSource.java:244)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:289)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:301)
at com.raqsoft.report.ide.base.DataSource.getConnection(DataSource.java:282)
at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:95)
... 39 more
[2024-05-30 14:40:10]
SEVERE: Making DataFactory:com.raqsoft.report.dataset.SQLDataSetFactory failure
com.scudata.common.RQException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效
at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:467)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:161)
at com.raqsoft.report.usermodel.Engine.calcDataSet(Engine.java:145)
at com.raqsoft.report.usermodel.Engine.calc(Engine.java:95)
at jichu.RaqPageListener.afterCalc(RaqPageListener.java:53)
at com.raqsoft.report.ide.GroupEngine.<init>(GroupEngine.java:127)
at com.raqsoft.report.ide.GroupEngine.<init>(GroupEngine.java:172)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1143)
at com.raqsoft.report.util.ReportUtils.exportReportGroup(ReportUtils.java:1100)
at ExportGroupFilePDFToServer.doPost(ExportGroupFilePDFToServer.java:270)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.raqsoft.report.webutil.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at filter.XssFilter.doFilter(XssFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-12705: 无法访问 NLS 数据文件, 或者指定的环境无效
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:785)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.raqsoft.report.ide.base.DataSource.connectDB(DataSource.java:244)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:289)
at com.raqsoft.report.ide.base.DataSource.getARQConnect(DataSource.java:301)
at com.raqsoft.report.ide.base.DataSource.getConnection(DataSource.java:282)
at com.raqsoft.report.dataset.SQLDataSetFactory.createDataSetM(Unknown Source:95)
... 39 more
监听类中的代码如下:
该错误发生本来可以正常调用 api 生成 pdf 文件的接口也会报此错误。
所有报表通过 api 导出都有这个错还是个别?
个别报表的话,删除这个监听类看看。
看报错是 oracle 的 ORA-12705 这个错误,这个和字符集环境啥的相关,按理说报表只是通过 jdbc 取数,并不会去影响他的环境,可以检查下 jdbc 驱动的 jar 和数据库是否匹配,或者也可以百度下那个 12705 的错误,看看有啥地方可能出错。
另外,看报错里边有个 ide.GroupEngine,这个是 import 的还是程序自动找的?如果 import 的改成 com.raqsoft.report.view.GroupEngine 这个看看
1、所有的报告文件都报错。
2、JDBC 的 jar 包也更换为润乾产品内自带的版本,使用的数据库为 oracle11g.
3、监听类程序中没有直接使用 com.raqsoft.report.ide.GroupEngine 对象。应该是润乾内部 jar 内程序使用的,没有办法看出 import 的还是程序自己找的。
我们发现一个很奇怪的现象,调用润乾的同一个方法,参数完全一样(已经反复确认传入的参数是一样的),一个成功,一个报错!麻烦润乾的工程师帮解决一下,非常感谢。