我正在学习Eclipse中的插件开发,并决定按照Vogella上的教程(http://www.vogella.com/tutorials/EclipsePlugIn/article.html#top)但是,一旦我右键单击项目并选择',我的控制台就会出现错误作为eclipse应用程序运行'(教程中的4.2)。
这是错误:
!SESSION 2014-11-19 10:58:22.636 -----------------------------------------------
eclipse.buildId=4.4.0.I20140606-1215
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_NZ
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data \\engad.foe.auckland.ac.nz\engdfs\Home\dgop507\workspace/../runtime-EclipseApplication -dev file://engad.foe.auckland.ac.nz/engdfs/Home/dgop507/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog
!ENTRY org.eclipse.jface 4 0 2014-11-19 10:58:36.043
!MESSAGE /icons/sample.gif
!STACK 0
java.io.FileNotFoundException: /icons/sample.gif
at org.eclipse.osgi.storage.url.bundleentry.Handler.findBundleEntry(Handler.java:37)
at org.eclipse.osgi.storage.url.BundleResourceHandler.openConnection(BundleResourceHandler.java:169)
at java.net.URL.openConnection(URL.java:971)
at org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:110)
at org.eclipse.core.internal.boot.PlatformURLConnection.getURLAsLocal(PlatformURLConnection.java:238)
at org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:36)
at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206)
at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:141)
at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:162)
at org.eclipse.jface.resource.ImageDescriptor.createResource(ImageDescriptor.java:167)
at org.eclipse.jface.resource.DeviceResourceManager.allocate(DeviceResourceManager.java:58)
at org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:89)
at org.eclipse.jface.resource.LocalResourceManager.allocate(LocalResourceManager.java:85)
at org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:89)
at org.eclipse.jface.resource.ResourceManager.createImage(ResourceManager.java:172)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.getImage(HandledContributionItem.java:580)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateIcons(HandledContributionItem.java:553)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:440)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.fill(HandledContributionItem.java:376)
at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java:365)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$3.handleEvent(ToolBarManagerRenderer.java:205)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at
当我从build.properties中删除icon =“icons / sample.gif”时,出现以下错误:
java.io.IOException: Unable to resolve plug-in "platform:/plugin/org.eclipse.mylyn.tasks.ui/icons/eview16/task-list.gif".
at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:64)
at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.resolve(PlatformURLPluginConnection.java:75)
at org.eclipse.core.internal.boot.PlatformURLHandler.openConnection(PlatformURLHandler.java:67)
at org.eclipse.osgi.internal.url.URLStreamHandlerProxy.openConnection(URLStreamHandlerProxy.java:114)
at java.net.URL.openConnection(URL.java:971)
at org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:33)
at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:206)
at org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:141)
at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:162)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:230)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:208)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImageFromURI(SWTPartRenderer.java:221)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.getImage(SWTPartRenderer.java:233)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:829)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.processContents(LazyStackRenderer.java:134)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:68)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:185)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:674)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
I'm not sure if this is to do with my configuration/workspace settings. Any help would be much appreciated.
答案 0 :(得分:1)
从您的错误开始:
java.io.FileNotFoundException: /icons/sample.gif
您的插件无法找到图标目录或sample.gif文件。
确保您的图标目录位于插件类路径中。
答案 1 :(得分:0)
该异常的问题在于您的插件已部署,并且正在查找无法找到的引用路径中的资源。 尝试创建一个图像,并根据该类的路径设置图标的路径......
这样的事情:new Image(yourDisplay, getClass().getClassLoader().getResourceAsStream("icons/your-icon.png"))
这应该可以正常工作!