|
From: Jules W. <jul...@gm...> - 2006-11-27 14:22:18
|
Hi Krzysztof,
Glad you fixed the problem.
It doesn't sound like you need to do this, but just in case you ever do:
Eclipse can get tricky if you need to use Class.forName() to instantiate new
objects from different plug-ins. If you ever run into a situation where you
need to do this, the best way to do it is:
Classloader orig = Thread.currentThread().getContextClassloader();
try{
Classloader c = //..get a reference to the classloader of a class
//from the plug-in you want to dynamically load
classes from
Thread.currentThread().setContextClassloader(c);
Class c = Class.forName("foo");
...
}
finally {
Thread.currentThread().setContextClassloader(orig);
}
Thanks,
Jules
On 11/27/06, Krzysztof Kostienko <kko...@in...> wrote:
>
> I have solved this problem J. I have added velocity.jar files, in Runtime
> tab of my gems plugin.xml file, as required runtime library
>
>
> ------------------------------
>
> *From:* Krzysztof Kostienko [mailto:kko...@in...]
> *Sent:* Monday, November 27, 2006 1:44 PM
> *To:* gem...@li...; kkostienko
> *Subject:* how to add external libraries to gems.
>
>
>
> Hello,
>
>
>
> I have small problem and I am not sure how can I solve it. I have created
> Interpreter Plug-in which uses Velocity Code Generator Engine. When I lunch
> my application and than invoke Interpreter eclipse can not find required
> libraries(velocities'). I do not know how I can add to gems external
> libraries. I have tried different configuration(import external jar
> archives, link compiled classes etc.), but nothing is working. Please see
> error which I am getting bellow.
>
>
>
> Krzysztof
>
>
>
> !SESSION 2006-11-27 13:29:00.962-----------------------------------------------
>
> eclipse.buildId=unknown
>
> java.version=1.5.0_09
>
> java.vendor=Sun Microsystems Inc.
>
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=pl_PL
>
> Framework arguments: -product org.eclipse.sdk.ide -pdelaunch
>
> Command-line arguments: -product org.eclipse.sdk.ide -data C:\Documents
> and Settings\Krzysiek\eclipse/../runtime-New_configuration3 -dev
> file:C:/Documents and
> Settings/Krzysiek/eclipse/.metadata/.plugins/org.eclipse.pde.core/New_configuration3/dev.properties
> -pdelaunch -os win32 -ws win32 -arch x86
>
>
>
> !ENTRY org.eclipse.ui 4 4 2006-11-27 13:30:27.337
>
> !MESSAGE Unhandled event loop exception
>
>
>
> !ENTRY org.eclipse.ui 4 0 2006-11-27 13:30:27.347
>
> !MESSAGE org/apache/velocity/exception/ParseErrorException
>
> !STACK 0
>
> java.lang.NoClassDefFoundError:
> org/apache/velocity/exception/ParseErrorException
>
> at
> pl.kkostienko.j2memetamodel.interpreter.J2meInterpreter.visitStartPoint(
> J2meInterpreter.java:147)
>
> at pl.kkostienko.j2memetamodel.StartPoint.accept(StartPoint.java
> :457)
>
> at pl.kkostienko.j2memetamodel.interpreter.J2meInterpreter.interpret
> (J2meInterpreter.java:1214)
>
> at org.gems.designer.model.actions.AbstractInterpreter$1.execute(
> AbstractInterpreter.java:20)
>
> at
> org.gems.designer.model.actions.BasicModelEventInterest.dispatchEvent(
> BasicModelEventInterest.java:99)
>
> at org.gems.designer.model.actions.ModelActionRegistry.modelChanged(
> ModelActionRegistry.java:75)
>
> at
> org.gems.designer.model.actions.ModelActionRegistry.instanceChanged(
> ModelActionRegistry.java:70)
>
> at org.gems.designer.ModelInstanceImpl.modelChanged(
> ModelInstanceImpl.java:142)
>
> at org.gems.designer.model.event.ModelEventDispatcher.dispatch(
> ModelEventDispatcher.java:68)
>
> at org.gems.designer.actions.ExtensionMenuAction.run(
> ExtensionMenuAction.java:102)
>
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(
> ActionContributionItem.java:539)
>
> at org.eclipse.jface.action.ActionContributionItem.access$2(
> ActionContributionItem.java:488)
>
> at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(
> ActionContributionItem.java:400)
>
> 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)
> ----------------------------------------------------------------------
> PS. >>> http://link.interia.pl/f19a6
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Gems-users mailing list
> Gem...@li...
> https://lists.sourceforge.net/lists/listinfo/gems-users
>
>
>
|