Java 桌面应用程序:错误代码:-2147467259 错误代码名称:失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3171041/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java desktop application: Error code:-2147467259 Error code name:failed
提问by raf
When I try to show my .rpt report (Crystal Report XI file)in my Java desktop application I've the following errors.
当我尝试在 Java 桌面应用程序中显示我的 .rpt 报告(Crystal Report XI 文件)时,出现以下错误。
When I call this method:
当我调用这个方法时:
try {
.... //some code that works correctly
reportClientDoc.getDatabaseController().logon(USERNAME, PASSWORD);
}
catch(ReportSDKException ex) {
System.out.println(ex.getMessage());
System.out.println(ex.getCause());
System.out.println(ex);
}
It throws this Warning and Exception:
它抛出这个警告和异常:
log4j:WARN No appenders could be found for logger (com.crystaldecisions.reports.reportdefinition.ReportDocument).
log4j:WARN Please initialize the log4j system properly.
Errore nella ricerca del nome JNDI (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)
com.crystaldecisions.reports.common.JndiNotFoundException: Errore nella ricerca del nome JNDI (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Errore nella ricerca del nome JNDI (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)---- Error code:-2147467259 Error code name:failed
log4j:WARN 找不到记录器的附加程序 (com.crystaldecisions.reports.reportdefinition.ReportDocument)。
log4j:WARN 请正确初始化 log4j 系统。
JNDI 错误 (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)
com.crystaldecisions.reports.common.JndiNotFoundException: Errore nella ricerca del nome JNDI (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Errore nella Ricerca del nome JNDI (D:\Documenti\NetBeansProjects\italpolVigilanza\dbData\italpol.mdb)---- 错误代码:-2147467259 错误代码名称:失败
I've only imported log4j.jar in my application. Are there some specific preliminary steps that I must do?
我只在我的应用程序中导入了 log4j.jar。是否有一些我必须执行的具体初步步骤?
回答by Stephen C
I suspect that the clue is in the earlier error messages, which (according to Google) says "Error in JNDI name search" in Italian.
我怀疑线索在较早的错误消息中,它(根据 Google 的说法)用意大利语说“JNDI 名称搜索中的错误”。
In short, it would appear that your application is expecting to find the reference to database controller via JNDI, but that it is not there.
简而言之,您的应用程序似乎希望通过 JNDI 找到对数据库控制器的引用,但它并不存在。
By the way, the "error code: -2147467259" is probably just due to the application calling System.exit(-1).
顺便说一句,“错误代码:-2147467259”可能只是由于应用程序调用System.exit(-1).
回答by Romain Hippeau
See this, Java Reporting Component Deployment Guide, especially the section on setting up log4j.
Once you have read the doc you should be able to see error messages in more detail and then report them.
请参阅 Java Reporting Component Deployment Guide,尤其是有关设置 log4j 的部分。
阅读文档后,您应该能够更详细地查看错误消息,然后报告它们。

