用ireport生成条码时,老是报这样的错 it.businesslogic.ireport.barcode.BcImage.getBarcodeImage(26,$P{AirWayBillBarCode},false,false,null,2,140)
我通过传参数来让ireport自己生成条码 ,可是老是报这样的错误,提示少包,可是我又不知道要导入哪个包,求大神解决
以下是错误信息:
log4j:WARN No appenders could be found for logger (net.sf.jasperreports.extensions.ExtensionsEnvironment).
log4j:WARN Please initialize the log4j system properly.
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : it.businesslogic.ireport.barcode.BcImage.getBarcodeImage(26,$P{AirWayBillBarCode},false,false,null,2,140)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)
at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:966)
at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:483)
at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:463)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:459)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2044)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:88)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:969)
at com.dhl.sop.label.LabelReportController.generateSOPLabel(LabelReportController.java:417)
at com.dhl.sop.label.LabelReportHandler.generateByContent(LabelReportHandler.java:62)
at com.dhl.sop.label.LabelReportHandler.run(LabelReportHandler.java:38)
at com.baiqian.web.dax.CompinePDF.process(CompinePDF.java:38)
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 org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NoClassDefFoundError: it/businesslogic/ireport/barcode/BcImage
at SOPLabel_1432100220589_480341.evaluate(SOPLabel_1432100220589_480341:405)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190)
... 40 more
Caused by: java.lang.ClassNotFoundException: it.businesslogic.ireport.barcode.BcImage
at java.lang.ClassLoader.findClass(ClassLoader.java:359)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 42 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请问 这个类是写在项目中 还是ireport里面!
看来只能自问自答了,要解决这个问题,只要自己创建一个it.businesslogic.ireport.barcode.BcImage这样的类就可以了,该类中要有这个方法 getBarcodeImage(26,$P{AirWayBillBarCode},false,false,null,2)
该类创建方式可以查看 http://www.cnblogs.com/suding1188/archive/2012/03/27/2418947.html