[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] JasperReports Classloader... :(

Hi,

I know my request is a FAQ but I do not understant and I really need help for this... :(

I simply created a plugin to wrap JasperReports and SWT JasperViewer libraries.

I added the JARs, I exported every packages.

Now I want to access to JasperReports Libraries to compile and preview a report within my Core Plugin, using the classes of JasperReport Plugin.

this is what I do:

source.txt : the snippet that fails in Core Plugin
log.txt    : the err console stream
MANIFEST.MF: the Manifest of JasperReports' plugin

Please help me to understand :)
public void run(IAction action) {
	Thread cur = Thread.currentThread();
	ClassLoader save = cur.getContextClassLoader();
	cur.setContextClassLoader(JasperCompileManager.class.getClassLoader());
	JasperPrint print = null;
	try {
		JasperReport report = JasperCompileManager
				.compileReport(new FileInputStream(
						"c:\\temp\\DataSourceReport.jrxml"));
		print = JasperFillManager.fillReport(report, new HashMap(),
				new JREmptyDataSource());

		ReportViewerDialog dlg = new ReportViewerDialog(window.getShell(),
				print);
		dlg.open();
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		cur.setContextClassLoader(save);
	}
}
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:4: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:5: package net.sf.jasperreports.engine.fill does not exist
import net.sf.jasperreports.engine.fill.*;
^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:18: cannot find symbol
symbol: class JRCalculator
public class DataSourceReport extends JRCalculator
                                      ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:25: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:26: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_CONNECTION = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:27: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:28: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_DataFile = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:29: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_ReportTitle = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:30: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_LOCALE = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:31: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_DATA_SOURCE = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:32: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_SCRIPTLET = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:33: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
    private JRFillParameter parameter_REPORT_MAX_COUNT = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:35: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
    private JRFillField field_City = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:36: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
    private JRFillField field_Street = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:37: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
    private JRFillField field_Name = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:38: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
    private JRFillField field_Id = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:40: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_PAGE_NUMBER = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:41: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_COLUMN_NUMBER = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:42: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_REPORT_COUNT = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:43: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_PAGE_COUNT = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:44: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_COLUMN_COUNT = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:45: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_CityNumber = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:46: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
    private JRFillVariable variable_CityGroup_COUNT = null;
            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:69: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_RESOURCE_BUNDLE = (JRFillParameter)pm.get("REPORT_RESOURCE_BUNDLE");
                                            ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:70: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_CONNECTION = (JRFillParameter)pm.get("REPORT_CONNECTION");
                                       ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:71: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_PARAMETERS_MAP = (JRFillParameter)pm.get("REPORT_PARAMETERS_MAP");
                                           ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:72: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_DataFile = (JRFillParameter)pm.get("DataFile");
                              ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:73: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_ReportTitle = (JRFillParameter)pm.get("ReportTitle");
                                 ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:74: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_LOCALE = (JRFillParameter)pm.get("REPORT_LOCALE");
                                   ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:75: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_DATA_SOURCE = (JRFillParameter)pm.get("REPORT_DATA_SOURCE");
                                        ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:76: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_SCRIPTLET = (JRFillParameter)pm.get("REPORT_SCRIPTLET");
                                      ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:77: cannot find symbol
symbol  : class JRFillParameter
location: class DataSourceReport
        parameter_REPORT_MAX_COUNT = (JRFillParameter)pm.get("REPORT_MAX_COUNT");
                                      ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:86: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
        field_City = (JRFillField)fm.get("City");
                      ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:87: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
        field_Street = (JRFillField)fm.get("Street");
                        ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:88: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
        field_Name = (JRFillField)fm.get("Name");
                      ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:89: cannot find symbol
symbol  : class JRFillField
location: class DataSourceReport
        field_Id = (JRFillField)fm.get("Id");
                    ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:98: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_PAGE_NUMBER = (JRFillVariable)vm.get("PAGE_NUMBER");
                                ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:99: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_COLUMN_NUMBER = (JRFillVariable)vm.get("COLUMN_NUMBER");
                                  ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:100: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_REPORT_COUNT = (JRFillVariable)vm.get("REPORT_COUNT");
                                 ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:101: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_PAGE_COUNT = (JRFillVariable)vm.get("PAGE_COUNT");
                               ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:102: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_COLUMN_COUNT = (JRFillVariable)vm.get("COLUMN_COUNT");
                                 ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:103: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_CityNumber = (JRFillVariable)vm.get("CityNumber");
                               ^
C:\dev\eclipse\eclipse-31rc1\eclipse\DataSourceReport.java:104: cannot find symbol
symbol  : class JRFillVariable
location: class DataSourceReport
        variable_CityGroup_COUNT = (JRFillVariable)vm.get("CityGroup_COUNT");
                                    ^
43 errors

	at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileReport(JRAbstractClassCompiler.java:120)
	at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:197)
	at be.sysmedit.opis.ui.core.actions.ContractsReportPreviewAction.run(ContractsReportPreviewAction.java:52)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:223)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2921)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2554)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1694)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1658)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:366)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at be.sysmedit.opis.ui.core.Application.run(Application.java:20)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:162)
	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:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jasper Reports Plug-in
Bundle-SymbolicName: net.sf.jasperreports
Bundle-Version: 0.6.8
Bundle-ClassPath: commons-logging-api-1.0.2.jar,
 itext-1.01.jar,
 poi-2.0-final-20040126.jar,
 commons-beanutils-1.5.jar,
 commons-collections-2.1.jar,
 commons-digester-1.3.jar,
 commons-logging-1.0.2.jar,
 jasperreports-0.6.8.jar,
 swtjasperviewer-1.0.3.jar
Bundle-Vendor: JasperSoft
Bundle-Localization: plugin
Export-Package: .,
 com.jasperassistant.designer.viewer,
 com.jasperassistant.designer.viewer.actions,
 com.jasperassistant.designer.viewer.actions.images,
 com.jasperassistant.designer.viewer.util,
 com.lowagie.servlets,
 com.lowagie.text,
 com.lowagie.text.html,
 com.lowagie.text.markup,
 com.lowagie.text.pdf,
 com.lowagie.text.pdf.codec,
 com.lowagie.text.pdf.fonts,
 com.lowagie.text.pdf.hyphenation,
 com.lowagie.text.pdf.wmf,
 com.lowagie.text.rtf,
 com.lowagie.tools,
 net.sf.jasperreports.ant,
 net.sf.jasperreports.engine,
 net.sf.jasperreports.engine.base,
 net.sf.jasperreports.engine.data,
 net.sf.jasperreports.engine.design,
 net.sf.jasperreports.engine.dtds,
 net.sf.jasperreports.engine.export,
 net.sf.jasperreports.engine.fill,
 net.sf.jasperreports.engine.images,
 net.sf.jasperreports.engine.print,
 net.sf.jasperreports.engine.util,
 net.sf.jasperreports.engine.xml,
 net.sf.jasperreports.view,
 net.sf.jasperreports.view.images,
 net.sf.jasperreports.view.save,
 org.apache.commons.beanutils,
 org.apache.commons.beanutils.converters,
 org.apache.commons.beanutils.locale,
 org.apache.commons.beanutils.locale.converters,
 org.apache.commons.collections,
 org.apache.commons.collections.comparators,
 org.apache.commons.collections.iterators,
 org.apache.commons.digester,
 org.apache.commons.digester.rss,
 org.apache.commons.digester.xmlrules,
 org.apache.commons.logging,
 org.apache.commons.logging.impl,
 org.apache.poi.dev,
 org.apache.poi.hpsf,
 org.apache.poi.hpsf.wellknown,
 org.apache.poi.hssf.dev,
 org.apache.poi.hssf.eventmodel,
 org.apache.poi.hssf.eventusermodel,
 org.apache.poi.hssf.model,
 org.apache.poi.hssf.record,
 org.apache.poi.hssf.record.aggregates,
 org.apache.poi.hssf.record.formula,
 org.apache.poi.hssf.usermodel,
 org.apache.poi.hssf.util,
 org.apache.poi.poifs.common,
 org.apache.poi.poifs.dev,
 org.apache.poi.poifs.eventfilesystem,
 org.apache.poi.poifs.filesystem,
 org.apache.poi.poifs.property,
 org.apache.poi.poifs.storage,
 org.apache.poi.util,
 org.w3c.tools.codec
Require-Bundle: org.eclipse.swt,
 org.eclipse.jface,
 org.eclipse.core.runtime