Java Eclipse和jasper报告:如何定位log4j.properties? [英] Java Eclipse and jasper report: how to locate log4j.properties?

查看:103
本文介绍了Java Eclipse和jasper报告:如何定位log4j.properties?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是收到有关此错误的错误

I always get an error about this

log4j:警告找不到记录器的附加程序(net.sf.jasperreports.engine。 xml.JRXmlDigesterFactory)。
log4j:WARN请正确初始化log4j系统。

我不知道log4j.properties在哪里。可以下载吗?因为我目前有拉链包名为
jasperreports-4.7.0,那里有那么多的库,但是哪一个呢?请帮我。
我没有在谷歌找到它的运气。
i有方法显示我的数据库表

i dont know where is that log4j.properties is. is it downloadable? becouse i currently have zip pack named jasperreports-4.7.0,there are so many library there,but which one of it? please help me. i have no luck finding it in google. i have method that shows the table of my database

pubic void btnIreport(){

try{
    JasperDesign jd = JRXmlLoader.load("C:\\Users\\Nickz08\\Desktop\\test.jrpxml");
    String sql = "select * from tblStudentAccount order by name";
    JRDesignQuery newQuery = new JRDesignQuery();
    newQuery.setText(sql);
    jd.setQuery(newQuery);
    JasperReport jr = JasperCompileManager.compileReport(jd);
    JasperPrint jp = JasperFillManager.fillReport(jr, null,conn);
    JasperViewer.viewReport(jp);

}catch(Exception e){
    e.printStackTrace();

}}


推荐答案

阅读以下链接如何创建log4j.properties文件(找不到任何appender logger(log4j)?

Read the following link how to create a log4j.properties file (No appenders could be found for logger(log4j)?)

您可以在任何需要的地方添加它,在运行项目时,配置类路径并添加log4j的位置单击.properties文件:运行 - >运行配置 - > [类路径选项卡] - >单击用户条目 - >高级 - >选择添加文件夹 - >选择log4j.properties文件的位置

you can add it any where you want, when you run your project, configure the classpath and add the location of the log4j.properties files by clicking on: Run->Run Configuration -> [classpath tab] -> click on user Entries -> Advanced -> Select Add Folder -> select the location of your log4j.properties file

然后 - >确定 - >运行

and then -> OK -> run

它应该加载

这篇关于Java Eclipse和jasper报告:如何定位log4j.properties?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆