大师们救救我!报表编译报错。
Java code我设计好了报表放在sampleReportFile + ".jrxml",然后加载进来,再编译。如下代码JasperDesign design = JRXmlLoader.load(sampleReportFile + ".jrxml"); //编译JasperReport report = new JasperCompileManager().compileReport(design);//这句有异常这两行代码放的一个单独的类中的main里能正常运行。但是放到我的项目中就报异常,无法编译,抛出异常如下(myReport_1216356285140_165076.class这个文件是它自动创建的怎么找不到?但在单独类中的main中为什么行?)。java.io.FileNotFoundException: D:\other-workspace\TestReport\myReport_1216356285140_165076.class (系统找不到指定的文件。) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at net.sf.jasperreports.engine.util.JRLoader.loadBytes(Unknown Source) at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(Unknown Source) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(Unknown Source) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(Unknown Source) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(Unknown Source) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(Unknown Source) at com.dsrcom.ecq.client.report.view.ReportColumnSet.printReport(ReportColumnSet.java:638) at com.dsrcom.ecq.client.report.view.ReportColumnSet$5.mouseUp(ReportColumnSet.java:417) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)NESTED BY :net.sf.jasperreports.engine.JRException: Error loading byte data : D:\other-workspace\TestReport\myReport_1216356285140_165076.class at net.sf.jasperreports.engine.util.JRLoader.loadBytes(Unknown Source) at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(Unknown Source) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(Unknown Source) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(Unknown Source) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(Unknown Source) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(Unknown Source) at com.dsrcom.ecq.client.report.view.ReportColumnSet.printReport(ReportColumnSet.java:638) at com.dsrcom.ecq.client.report.view.ReportColumnSet$5.mouseUp(ReportColumnSet.java:417) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)Caused by: java.io.FileNotFoundException: D:\other-workspace\TestReport\myReport_1216356285140_165076.class (系统找不到指定的文件。) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) ... 31 more