class def not found error [message #242976] |
Fri, 15 June 2007 17:45  |
Eclipse User |
|
|
|
Originally posted by: yavain01.hotmail.com
eclipse 3.3M7, I am trying to build a RCP using birt engine. I tried birt
2.1.2 and 2.2RC1.
How is birt RunAndRenderTask gets the classloader? I am getting wierd
class def not found exception on springframework/AopConfigException when I
am trying to initialize a class through spring in OPEN javascript . (I am
using scripted data source) I am doing this way because this class
depends on many other classes and I don't want to initialize them all by
myself.
I am thinking this is a classloader issue because the classloader I set
for the RunAndRenderTask is able to get AopConfigException class. This is
what i did:
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HashMap<String, ClassLoader> contextMap = new HashMap<String,
ClassLoader>();
contextMap.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
ReportView.class.getClassLoader());
Class foo =
ReportView.class.getClassLoader().loadClass("org.springframework.aop.framework.AopConfigException ");
System.out.println("FOO: " + foo);
task.setAppContext(contextMap);
and console prints out this:
FOO: class org.springframework.aop.framework.AopConfigException
however in open method javascript this exception comes out when I am
trying to get the class through spring, any help would be great!!
:
SEVERE: Error happened while running the report.
java.lang.NoClassDefFoundError:
org/springframework/aop/framework/AopConfigException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at org.mozilla.javascript.JavaMembers.reflect(JavaMembers.java: 305)
at org.mozilla.javascript.JavaMembers.<init>(JavaMembers.java:60)
at org.mozilla.javascript.JavaMembers.lookupClass(JavaMembers.j ava:592)
at
org.mozilla.javascript.NativeJavaObject.initMembers(NativeJa vaObject.java:79)
at
org.mozilla.javascript.NativeJavaObject.<init>(NativeJavaObject.java:69)
at
org.mozilla.javascript.WrapFactory.wrapAsJavaObject(WrapFact ory.java:148)
at org.mozilla.javascript.WrapFactory.wrap(WrapFactory.java:104 )
at
org.eclipse.birt.report.engine.executor.ExecutionContext$1.w rap(ExecutionContext.java:334)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMetho d.java:208)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime .java:63)
at
org.mozilla.javascript.gen.c4._c1(DataSet[LowStockDataSet]._ _bm_OPEN:10)
at org.mozilla.javascript.gen.c4.call(DataSet[LowStockDataSet]. __bm_OPEN)
at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at org.mozilla.javascript.gen.c5._c0(DataSet[LowStockDataSet]._ _bm_OPEN:1)
at org.mozilla.javascript.gen.c5.call(DataSet[LowStockDataSet]. __bm_OPEN)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c5.call(DataSet[LowStockDataSet]. __bm_OPEN)
at org.mozilla.javascript.gen.c5.exec(DataSet[LowStockDataSet]. __bm_OPEN)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:234)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :210)
at
org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:743)
at
org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:183)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:148)
at
org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:85)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:120)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:210)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1641)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:73)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutChildren(HTMLBlockStackingLM.java:63)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:94)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutChildren(HTMLInlineStackingLM.java:138)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
at
org.eclipse.birt.report.engine.layout.html.HTMLRowLM.layout( HTMLRowLM.java:30)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutChildren(HTMLBlockStackingLM.java:68)
at
org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:74)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:139)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:85)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:205)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:142)
at
com.elasticpath.cmclient.core.views.ReportView.previewReport (ReportView.java:268)
at
com.elasticpath.cmclient.core.views.ReportView.access$1(Repo rtView.java:207)
at
com.elasticpath.cmclient.core.views.ReportView$3.widgetSelec ted(ReportView.java:175)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3673)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3284)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2365)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 04)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.elasticpath.cmclient.core.Application.start(Application. java:56)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:153)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
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.equinox.launcher.Main.invokeFramework(Main.java: 497)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
at org.eclipse.equinox.launcher.Main.run(Main.java:1162)
at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
|
|
|
|
|
Re: class def not found error [message #243528 is a reply to message #243416] |
Wed, 20 June 2007 09:53  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Ian,
If the class is in the plugin registry you should be able to access it
from script like:
importPackage(Packages.org.eclipse.core.runtime);
mybundle = Platform.getBundle(“bundle-name”).
cl1 = bnd.newInstance();
xyz = cl1.getMyMethod();
Jason
Ian wrote:
> Jason Weathersby wrote:
>
>> Ian,
>
>> Is the spring class in a plugin?
>
>> Jason
>
>> Ian wrote:
>>> eclipse 3.3M7, I am trying to build a RCP using birt engine. I tried
>>> birt 2.1.2 and 2.2RC1.
>>>
>>> How is birt RunAndRenderTask gets the classloader? I am getting
>>> wierd class def not found exception on
>>> springframework/AopConfigException when I am trying to initialize a
>>> class through spring in OPEN javascript . (I am using scripted data
>>> source) I am doing this way because this class depends on many other
>>> classes and I don't want to initialize them all by myself.
>>>
>>> I am thinking this is a classloader issue because the classloader I
>>> set for the RunAndRenderTask is able to get AopConfigException
>>> class. This is what i did:
>>>
>>> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
>>> HashMap<String, ClassLoader> contextMap = new HashMap<String,
>>> ClassLoader>();
>>> contextMap.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
>>> ReportView.class.getClassLoader());
>>> Class foo =
> ReportView.class.getClassLoader().loadClass("org.springframework.aop.framework.AopConfigException ");
>
>>>
>>> System.out.println("FOO: " + foo);
>>>
>>> task.setAppContext(contextMap);
>>>
>>> and console prints out this:
>>>
>>> FOO: class org.springframework.aop.framework.AopConfigException
>>>
>>> however in open method javascript this exception comes out when I am
>>> trying to get the class through spring, any help would be great!!
>>>
>>> :
>>>
>>> SEVERE: Error happened while running the report.
>>> java.lang.NoClassDefFoundError:
>>> org/springframework/aop/framework/AopConfigException
>>> at java.lang.Class.getDeclaredMethods0(Native Method)
>>> at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>>> at java.lang.Class.privateGetPublicMethods(Unknown Source)
>>> at java.lang.Class.getMethods(Unknown Source)
>>> at org.mozilla.javascript.JavaMembers.reflect(JavaMembers.java: 305)
>>> at org.mozilla.javascript.JavaMembers.<init>(JavaMembers.java:60)
>>> at
>>> org.mozilla.javascript.JavaMembers.lookupClass(JavaMembers.j ava:592)
>>> at
> org.mozilla.javascript.NativeJavaObject.initMembers(NativeJa vaObject.java:79)
>
>>>
>>> at
>>> org.mozilla.javascript.NativeJavaObject.<init>(NativeJavaObject.java:69)
>>> at
>>> org.mozilla.javascript.WrapFactory.wrapAsJavaObject(WrapFact ory.java:148)
>>>
>>> at org.mozilla.javascript.WrapFactory.wrap(WrapFactory.java:104 )
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext$1.w rap(ExecutionContext.java:334)
>
>>>
>>> at
>>> org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMetho d.java:208)
>>> at
>>> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime .java:63)
>>> at
>>> org.mozilla.javascript.gen.c4._c1(DataSet[LowStockDataSet]._ _bm_OPEN:10)
>>> at
>>> org.mozilla.javascript.gen.c4.call(DataSet[LowStockDataSet]. __bm_OPEN)
>>> at
>>> org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
>>>
>>> at
>>> org.mozilla.javascript.gen.c5._c0(DataSet[LowStockDataSet]._ _bm_OPEN:1)
>>> at
>>> org.mozilla.javascript.gen.c5.call(DataSet[LowStockDataSet]. __bm_OPEN)
>>> at
>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>> at
>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>> at
>>> org.mozilla.javascript.gen.c5.call(DataSet[LowStockDataSet]. __bm_OPEN)
>>> at
>>> org.mozilla.javascript.gen.c5.exec(DataSet[LowStockDataSet]. __bm_OPEN)
>>> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawS cript(JavascriptEvalUtil.java:98)
>
>>>
>>> at
> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:137)
>
>>>
>>> at
> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:548)
>
>>>
>>> at
> org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
>
>>>
>>> at
> org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:234)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :210)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer yExecutor.java:743)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe cuteQuery(ServiceForQueryResults.java:183)
>
>>>
>>> at
> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:148)
>
>>>
>>> at
> org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:85)
>
>>>
>>> at
> org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:120)
>
>>>
>>> at
> org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:210)
>
>>>
>>> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1641)
>
>>>
>>> at
> org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:62)
>
>>>
>>> at
> org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:73)
>
>>>
>>> at
> org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:35)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutChildren(HTMLBlockStackingLM.java:63)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:94)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutChildren(HTMLInlineStackingLM.java:138)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLRowLM.layout( HTMLRowLM.java:30)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutChildren(HTMLBlockStackingLM.java:68)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:74)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:159)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout Children(HTMLPageLM.java:139)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:81)
>
>>>
>>> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:85)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:205)
>
>>>
>>> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:142)
>
>>>
>>> at
> com.elasticpath.cmclient.core.views.ReportView.previewReport (ReportView.java:268)
>
>>>
>>> at
> com.elasticpath.cmclient.core.views.ReportView.access$1(Repo rtView.java:207)
>
>>>
>>> at
> com.elasticpath.cmclient.core.views.ReportView$3.widgetSelec ted(ReportView.java:175)
>
>>>
>>> at
>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:227)
>>>
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>> at
>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3673)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3284)
>>> at
>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2365)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 04)
>>> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>>> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>
>>>
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
>>>
>>> at
>>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> com.elasticpath.cmclient.core.Application.start(Application. java:56)
>>> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:153)
>
>>>
>>> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>
>>>
>>> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>
>>>
>>> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>
>>>
>>> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>
>>>
>>> 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.equinox.launcher.Main.invokeFramework(Main.java: 497)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1162)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
>>>
>>>
> yes but not directly in the eclipse/plugin folder
>
> It's in another library folder and included as part of plug-in
> dependency of the project. However, it's not in the same folder where
> BIRT resides.yes but no in eclipse/plugin folder, and the files are not
> in the same folder where BIRT plugin resides.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03250 seconds