Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » error when creating Resource
error when creating Resource [message #180525] Fri, 06 May 2005 21:22 Go to next message
Eclipse UserFriend
Originally posted by: flsobral.yahoo.com.br

I'm making a new editor based on the EDiagram example but there is
something wrong and I can't figrue out what is it.
When I create a new file the editor opens and everything runs fine, I can
open and close the editor as many times I want. But when I close the
runtime workbench and run it again I get an error from method setInput in
this line:

protected void setInput(IEditorInput input) {
super.setInput(input);

IFile file = ((IFileEditorInput)input).getFile();
URI uri = URI.createURI(file.getFullPath().toString());
-------> Resource resource = RESOURCE_SET.getResource(uri, true);
classDiagram = (ClassDiagram)resource.getContents().get(0);

setPartName(file.getName());
setContentDescription(file.getFullPath().toString());
}

As you can see, my method is exactly the same as the one in the example,
except that I'm using my own diagram. I can't understand why this is
happening.

This is the error I get:

java.lang.IllegalArgumentException: protocol = http host = null
at sun.net.spi.DefaultProxySelector.select(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unk nown
Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(U nknown
Source)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createU RLInputStream(URIConverterImpl.java:557)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(URIConverterImpl.java:446)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:1653)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:1547)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:715)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:763)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:460)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:65)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:447)
at
org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr apper.java:73)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. emptyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDispatcher.scanRootElementHook(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:129)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:168)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:977)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:832)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:249)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:264)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:349)
at editor.ClassDiagramEditor.setInput(ClassDiagramEditor.java:5 2)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:292)
at
org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:857)
at
org.eclipse.ui.internal.EditorManager.busyRestoreEditorHelpe r(EditorManager.java:1223)
at
org.eclipse.ui.internal.EditorManager.busyRestoreEditor(Edit orManager.java:1102)
at org.eclipse.ui.internal.EditorManager$7.run(EditorManager.ja va:1064)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.EditorManager.restoreEditor(EditorMa nager.java:1062)
at
org.eclipse.ui.internal.EditorManager$Editor.getEditor(Edito rManager.java:1648)
at
org.eclipse.ui.internal.EditorManager$Editor.getPart(EditorM anager.java:1639)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:26 0)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:126)
at
org.eclipse.ui.internal.presentations.newapi.PresentablePart Folder.select(PresentablePartFolder.java:268)
at
org.eclipse.ui.internal.presentations.newapi.LeftToRightTabO rder.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.newapi.TabbedStackPres entation.selectPart(TabbedStackPresentation.java:391)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1070)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1019)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:12 23)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:406)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:109 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:267)
at org.eclipse.ui.internal.EditorManager$4.run(EditorManager.ja va:829)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:809)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:697)
at
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:660)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2236)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2165)
at org.eclipse.ui.internal.WorkbenchPage.access$7(WorkbenchPage .java:2157)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:2143)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2138)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:371)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:334)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:231)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:124)
at
org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(Open ActionUtil.java:49)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:16 4)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:15 0)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:212)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:188)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:304)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 4.open(PackageExplorerPart.java:805)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:658)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1021)
at org.eclipse.core.runtime.Platform.run(Platform.java:757)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:40)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:14 8)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:656)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:875)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:974)
at
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:243)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:238)
at
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:277)
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.ja va:2894)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2527)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1570)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:306)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:228)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:156)
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:315 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:268)
at org.eclipse.core.launcher.Main.run(Main.java:942)
at org.eclipse.core.launcher.Main.main(Main.java:926)


Thanks,
Fábio Sobral.
Re: error when creating Resource [message #180612 is a reply to message #180525] Mon, 09 May 2005 14:54 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
You might want to ask this on the EMF newsgroup.

"F
Re: error when creating Resource [message #180705 is a reply to message #180612] Mon, 09 May 2005 18:26 Go to previous message
Eclipse UserFriend
Originally posted by: flsobral.yahoo.com.br

I asked here because it worked when I did the same change with the
previous ediagram example, but I'll ask there now. Thanks.
Previous Topic:Making GEF's EDiagram extensible
Next Topic:A form editor - drawing controls
Goto Forum:
  


Current Time: Sat Feb 04 03:16:58 GMT 2023

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

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

Back to the top