Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem in opening a new file in the editor.
Problem in opening a new file in the editor. [message #199411] Fri, 14 October 2005 16:27 Go to next message
Brahmanandam Somanchi is currently offline Brahmanandam SomanchiFriend
Messages: 11
Registered: July 2009
Junior Member
HI,

I have implemented an action that creates a new file under a project and
tries to open it in an UMLEditor. This action is throwing a "Wrapped
exception"

What I have done is -

1) In the action, I am creating a new file under a project
IFile file = project.getFile( fileName );
file.create( null, false, null );
2) Open the new file in an UMLEditor
IEditorPart editorPart = IDE.openEditor( page, file, true );
3) The control comes back to MyEditor.setInput(). In this method I am
getting ResourceSet of the project and then trying to get the resource
for the file

IFile file = ( (IFileEditorInput) input ).getFile();
URI uri = URI.createPlatformResourceURI( file.getFullPath().toString() );
resourceSet.getResource( uri, true );

4) The getResource() method throws Wrapped Exception complaining that the
file that I created is not local. See the error trace below.
Is there anything that I am missing? How do I get rid of this problem?

Brahma



Wrapped exception
org.eclipse.core.internal.resources.ResourceException: Resource
/Ford/Appearance.uml is not local.
at
org.eclipse.core.internal.resources.Resource.checkLocal(Reso urce.java:316)
at org.eclipse.core.internal.resources.File.getContents(File.ja va:293)
at org.eclipse.core.internal.resources.File.getContents(File.ja va:283)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl$Workben chHelper.createPlatformResourceInputStream(URIConverterImpl. java:195)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceInputStream(URIConverterImpl.java:533)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(URIConverterImpl.java:442)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:829)
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
com.bmide.model.util.TcResourceSetImpl.getResource(TcResourc eSetImpl.java:66)
at com.bmide.uml.ui.editor.UMLEditor.testLoad(UMLEditor.java:41 3)
at com.bmide.uml.ui.editor.UMLEditor.setInput(UMLEditor.java:34 5)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:292)
at
org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:773)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:572)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:365)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:552)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:258)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1216)
at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.ja va:944)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at
org.eclipse.ui.internal.EditorManager.restoreState(EditorMan ager.java:939)
at
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2535)
at
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1819)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2566)
at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2 515)
at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1514 )
at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:1263 )
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:346)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:291)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:447)
at
org.eclipse.ui.internal.Workbench.runStartupWithProgress(Wor kbench.java:1258)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1512)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 491)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1374 )
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1318)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer.java:183)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:700)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
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:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Re: Problem in opening a new file in the editor. [message #199418 is a reply to message #199411] Fri, 14 October 2005 16:35 Go to previous message
Eclipse UserFriend
Originally posted by: christian.sell.netcologne.de

that problem seems to have nothing to do with GEF (the subject of this
newsgroup). Your chances will be much better under emf or platform.

chris

Brahma Somanchi wrote:
> HI,
>
> I have implemented an action that creates a new file under a project and
> tries to open it in an UMLEditor. This action is throwing a "Wrapped
> exception"
>
> What I have done is -
>
> 1) In the action, I am creating a new file under a project
> IFile file = project.getFile( fileName );
> file.create( null, false, null );
> 2) Open the new file in an UMLEditor
> IEditorPart editorPart = IDE.openEditor( page, file, true );
> 3) The control comes back to MyEditor.setInput(). In this method I am
> getting ResourceSet of the project and then trying to get the resource
> for the file
>
> IFile file = ( (IFileEditorInput) input ).getFile();
> URI uri = URI.createPlatformResourceURI( file.getFullPath().toString() );
> resourceSet.getResource( uri, true );
>
> 4) The getResource() method throws Wrapped Exception complaining that
> the file that I created is not local. See the error trace below.
> Is there anything that I am missing? How do I get rid of this problem?
>
> Brahma
>
>
>
> Wrapped exception
> org.eclipse.core.internal.resources.ResourceException: Resource
> /Ford/Appearance.uml is not local.
> at
> org.eclipse.core.internal.resources.Resource.checkLocal(Reso urce.java:316)
> at org.eclipse.core.internal.resources.File.getContents(File.ja va:293)
> at org.eclipse.core.internal.resources.File.getContents(File.ja va:283)
> at
> org.eclipse.emf.ecore.resource.impl.URIConverterImpl$Workben chHelper.createPlatformResourceInputStream(URIConverterImpl. java:195)
>
> at
> org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createP latformResourceInputStream(URIConverterImpl.java:533)
>
> at
> org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createI nputStream(URIConverterImpl.java:442)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:829)
>
> 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
> com.bmide.model.util.TcResourceSetImpl.getResource(TcResourc eSetImpl.java:66)
>
> at com.bmide.uml.ui.editor.UMLEditor.testLoad(UMLEditor.java:41 3)
> at com.bmide.uml.ui.editor.UMLEditor.setInput(UMLEditor.java:34 5)
> at
> org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEdito r.java:292)
> at
> org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:773)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:572)
>
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:365)
>
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:552)
>
> at
> org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:258)
>
> at
> org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1216)
>
> at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.ja va:944)
> at
> org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
>
> at org.eclipse.core.runtime.Platform.run(Platform.java:783)
> at
> org.eclipse.ui.internal.EditorManager.restoreState(EditorMan ager.java:939)
> at
> org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2535)
> at
> org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1819)
>
> at
> org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2566)
> at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2 515)
> at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1514 )
> at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:1263 )
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:346)
>
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:291)
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:447)
>
> at
> org.eclipse.ui.internal.Workbench.runStartupWithProgress(Wor kbench.java:1258)
>
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1512)
> at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 491)
> at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1374 )
> at
> org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
>
> at org.eclipse.core.runtime.Platform.run(Platform.java:783)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1318)
> at
> org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer.java:183)
>
> at
> org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:700)
>
> at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> 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:226)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
>
>
>
Previous Topic:Display error (in BIRT also)
Next Topic:laying out child figures in 2 columns
Goto Forum:
  


Current Time: Tue Apr 23 07:53:18 GMT 2024

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

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

Back to the top