Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext index and referenced JARs
Xtext index and referenced JARs [message #689406] Mon, 27 June 2011 15:30 Go to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 112
Registered: June 2010
Senior Member
Hi,

I created a DSL using xtext, let say for files named *.mydsl.
In particular, I exploit references in my dsl, so that if I have two ressources a.mydsl and b.mydsl, I can refer in b to elements declared in a.

If I put these two resources in two eclipse project, and one refers to the other, everything is fine.

But if I export one in jar and add it as a dependency of the second, it does not work. It is as if the resource is not taken into account.
I suspect it is linked to the index, but I don't know at all where to watch or what to change to make it works!
Re: Xtext index and referenced JARs [message #689434 is a reply to message #689406] Mon, 27 June 2011 16:32 Go to previous messageGo to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 112
Registered: June 2010
Senior Member
As a complement, the problem appeared in conjunction with maven: there was some dependencies in maven that were resolved as workspace projects, and the fact I closed these projects broke the xtext index or something like that.

In particular, I got this error when closing such a project:
java.lang.NullPointerException
	at org.eclipse.xtext.util.Strings.pack(Strings.java:307)
	at org.eclipse.xtext.ui.editor.validation.MarkerCreator.createMarker(MarkerCreator.java:38)
	at org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.addMarkers(MarkerUpdaterImpl.java:111)
	at org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.updateMarker(MarkerUpdaterImpl.java:69)
	at org.eclipse.xtext.builder.builderState.AbstractBuilderState.updateMarkers(AbstractBuilderState.java:76)
	at org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doValidate(PersistableResourceDescriptionsImpl.java:77)
	at org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doUpdate(PersistableResourceDescriptionsImpl.java:71)
	at org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doUpdate(PersistableResourceDescriptionsImpl.java:1)
	at org.eclipse.xtext.builder.builderState.AbstractBuilderState.update(AbstractBuilderState.java:111)
	at org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener$2$1.execute(ProjectOpenedOrClosedListener.java:134)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
	at org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener$2.run(ProjectOpenedOrClosedListener.java:146)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Re: Xtext index and referenced JARs [message #689439 is a reply to message #689434] Mon, 27 June 2011 16:35 Go to previous messageGo to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 112
Registered: June 2010
Senior Member
And it seems that the problem disappear when I clean the project that makes the references... !

I'm using the StrictJavaProjectsState by the way.
Re: Xtext index and referenced JARs [message #689539 is a reply to message #689439] Mon, 27 June 2011 19:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

which Xtext Version do you use? How do you export one in jar and add it as a dependency of the second?
I tried this with Xtext 1.0.2 and 2.0.0 and it works nicely.

Here is the classpath file of my test project

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
	<classpathentry kind="lib" path="test.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>


~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext index and referenced JARs [message #692614 is a reply to message #689434] Mon, 04 July 2011 20:51 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Victor,

could you please file a ticket with steps to reproduce the issue. Which
maven plugin do you use?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


On 27.06.11 18:32, Victor wrote:
> As a complement, the problem appeared in conjunction with maven: there
> was some dependencies in maven that were resolved as workspace projects,
> and the fact I closed these projects broke the xtext index or something
> like that.
>
> In particular, I got this error when closing such a project:
>
> java.lang.NullPointerException
> at org.eclipse.xtext.util.Strings.pack(Strings.java:307)
> at
> org.eclipse.xtext.ui.editor.validation.MarkerCreator.createMarker(MarkerCreator.java:38)
>
> at
> org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.addMarkers(MarkerUpdaterImpl.java:111)
>
> at
> org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.updateMarker(MarkerUpdaterImpl.java:69)
>
> at
> org.eclipse.xtext.builder.builderState.AbstractBuilderState.updateMarkers(AbstractBuilderState.java:76)
>
> at
> org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doValidate(PersistableResourceDescriptionsImpl.java:77)
>
> at
> org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doUpdate(PersistableResourceDescriptionsImpl.java:71)
>
> at
> org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl.doUpdate(PersistableResourceDescriptionsImpl.java:1)
>
> at
> org.eclipse.xtext.builder.builderState.AbstractBuilderState.update(AbstractBuilderState.java:111)
>
> at
> org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener$2$1.execute(ProjectOpenedOrClosedListener.java:134)
>
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
>
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
>
> at
> org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener$2.run(ProjectOpenedOrClosedListener.java:146)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>
Previous Topic:[Xtext] Problems with imported grammars and ecore models
Next Topic:Error ruleMemo while creating new Xtext project
Goto Forum:
  


Current Time: Fri Apr 19 20:42:25 GMT 2024

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

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

Back to the top