Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Unhandled event loop exception
Unhandled event loop exception [message #329456] Wed, 25 June 2008 02:49 Go to next message
Eclipse UserFriend
Originally posted by: maxipower_q.yahoo.com

i'm designing a plugin. yesterday i changed somethings(!) in the code and
eclipse started giving me this exception.

i tried to take the changes back but i couldn't figure it.

as you can see in the log file, createImageIcon must the problem.

could someone tell me how to solve the problem ?
Thanks...

createImageIcon function*******************************
protected ImageIcon createImageIcon(String path,String description) {
java.net.URL imgURL = getClass().getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL, description);
}
else {
textarea.setText("Couldn't find file: " + path);
return null;
}
*******************************************************


code where i call the function*************************
ImageIcon icon = createImageIcon("/icons/Banner.gif","Banner");
label3 = new JLabel(icon);
label3.setBackground(Color.WHITE);
bannerPanel.setBackground(Color.WHITE);
bannerPanel.add(label3);
*******************************************************


ERROR.LOG**********************************************
java.lang.NullPointerException
at argela.plugins.rename13.actions.Rename.createImageIcon(Renam e.java:572)
at argela.plugins.rename13.actions.Rename.<init>(Rename.java:105)
at
argela.plugins.rename13.actions.Application.getInstance(Appl ication.java:24)
at argela.plugins.rename13.actions.Application.run(Application. java:18)
at
org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
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:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
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
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
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: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Re: Unhandled event loop exception [message #329457 is a reply to message #329456] Wed, 25 June 2008 03:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fraserofthenight.gmail.com

Cumhur Kilic wrote:
> i'm designing a plugin. yesterday i changed somethings(!) in the code
> and eclipse started giving me this exception.
> i tried to take the changes back but i couldn't figure it.
>
> as you can see in the log file, createImageIcon must the problem.
> could someone tell me how to solve the problem ?
> Thanks...
>
> createImageIcon function*******************************
> protected ImageIcon createImageIcon(String path,String description) {
> java.net.URL imgURL = getClass().getResource(path);
> if (imgURL != null) {
> return new ImageIcon(imgURL, description);
> }
> else {
> textarea.setText("Couldn't find file: " + path);
> return null;
> }
> *******************************************************
>
>
> code where i call the function*************************
> ImageIcon icon = createImageIcon("/icons/Banner.gif","Banner"); label3 =
> new JLabel(icon);
> label3.setBackground(Color.WHITE);
> bannerPanel.setBackground(Color.WHITE);
> bannerPanel.add(label3);
> *******************************************************
>
>
> ERROR.LOG**********************************************
> java.lang.NullPointerException
> at
> argela.plugins.rename13.actions.Rename.createImageIcon(Renam e.java:572)
> at argela.plugins.rename13.actions.Rename.<init>(Rename.java:105)
> at
> argela.plugins.rename13.actions.Application.getInstance(Appl ication.java:24)
>
> at argela.plugins.rename13.actions.Application.run(Application. java:18)
> at
> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
> at
> org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:229)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
>
> 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:3682)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
> 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
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>
> 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: 508)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
>

Are you sure textarea is not null?
Re: Unhandled event loop exception [message #329458 is a reply to message #329457] Wed, 25 June 2008 04:07 Go to previous message
Eclipse UserFriend
Originally posted by: maxipower_q.yahoo.com

Robert Fraser wrote:
> Are you sure textarea is not null?

no (: thanks ,it solved my problem.

program was trying to write an error to nowhere..

i took the icon creation code after the textarea's initializiation.

Thanks again.
Previous Topic:Vista Bug using Nebula CDatetime
Next Topic:Delete a project from project explorer
Goto Forum:
  


Current Time: Sat May 10 03:23:14 EDT 2025

Powered by FUDForum. Page generated in 0.02539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top