|
|
|
|
Re: UnsupportedOperationException: getEObjectURI [message #707646 is a reply to message #707523] |
Mon, 01 August 2011 22:32 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Rafael,
please make sure that the file extension of the resource(delta) that you
process is matching your language. The NameBasedEObjectDescription will
most likely point to something with an URI similar to
"java:/Objects/com.foo.bar.Something". I'd assume you are more
interested in "platform:/resource/yourproject/somet/path/file.yourdsl"
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 01.08.11 21:10, Rafael Angarita wrote:
> Hello,
>
> I'm having problems doing code generation. I implemented the
> IXtextBuilderParticipant interface. A new java project containing the
> generated code is created.
>
> If I do a full clean without generating the code, everything goes well.
> If I do a full clean with the code generation activated, the first time
> everything seems to go well, but if I do a second full clean, I get the
> exception:
>
>
> java.lang.UnsupportedOperationException: getEObjectURI
> at
> org.eclipse.xtext.common.types.ui.notification.NameBasedEObjectDescription.getEObjectURI(NameBasedEObjectDescription.java:45)
>
> at
> altagracia.builder.XtextAltagraciaBuilderParticipant.build(XtextAltagraciaBuilderParticipant.java:106)
>
> at
> org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60)
>
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:160)
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:182)
>
> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:85)
> at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
>
> at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
>
> at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
> at
> org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
>
> at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:422)
> at
> org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:180)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>
>
> and the building process crash, leaving the xtetx project full of errors
> and unresolved references.
>
> This is the fragment of code where the exception occurs:
>
>
> for (IResourceDescription.Delta delta : context.getDeltas()) {
> if (delta.getNew() != null){
> //URI uri = getObjectUrl(delta.getNew());
> Iterable<IEObjectDescription> descNew =
> delta.getNew().getExportedObjects();
> for (IEObjectDescription desc : descNew) {
> //the next line causes the exception
> newFile(context.getResourceSet().getEObject( desc.getEObjectURI(),
> true)); }
> }
> monitor.worked(1);
> }
>
>
>
> Do you have any idea of what is going wrong here or how to debug this
> problem?
>
> Thank you very much for your help.
|
|
|
Powered by
FUDForum. Page generated in 0.04845 seconds