Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Java Model Exception when executing Xtend functions(Whenever an Xtend function is invoked - whether for M2M Xtend transformations or M2T Xpand templates, a Java Model Exception is thrown)
Java Model Exception when executing Xtend functions [message #757252] Thu, 17 November 2011 10:57 Go to next message
Vitali Gontsharuk is currently offline Vitali GontsharukFriend
Messages: 2
Registered: November 2011
Junior Member
Dear forum members,

I'm experiencing a rather frustrating Eclipse Console and log flooding with Java Model Exceptions, which I sadly have been unable to find a solution for.

I'm running a series of M2M and M2T transformations using Xtend and Xpand through Ant (same JRE as Eclipse). I'm starting Eclipse from another Eclipse instance, if that plays any role. It seems that whenever the Xtend engine is accessing an Ecore model, a Java Model Exception is thrown. But this does not hinder the corresponding Xtend function / Xpand define from executing correctly.

Do you have any idea why this could be happening?

Here is a typical stack trace I'm getting for each model access:

!ENTRY org.eclipse.xtend.ui 4 0 2011-11-17 11:39:15.481
!MESSAGE .org.eclipse.jdt.core.external.folders does not exist
!STACK 1
Java Model Exception: Java Model Status [.org.eclipse.jdt.core.external.folders does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
	at org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo(JavaProject.java:1603)
	at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2282)
	at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2292)
	at org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1321)
	at org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1228)
	at org.eclipse.xtend.ui.core.internal.builder.PluginJavaExtensionStatement.analyzeInternal(PluginJavaExtensionStatement.java:48)
	at org.eclipse.internal.xtend.xtend.ast.AbstractExtension.analyze(AbstractExtension.java:126)
	at org.eclipse.internal.xtend.xtend.ast.ExtensionFile.analyze(ExtensionFile.java:116)
	at org.eclipse.xtend.ui.core.internal.XtendResourceImpl.analyze(XtendResourceImpl.java:49)
	at org.eclipse.internal.xpand2.ast.ExtensionImportDeclaration.analyze(ExtensionImportDeclaration.java:42)
	at org.eclipse.internal.xpand2.ast.Template.analyze(Template.java:126)
	at org.eclipse.xpand.ui.core.internal.XpandResourceImpl.analyze(XpandResourceImpl.java:45)
	at org.eclipse.xtend.shared.ui.core.AbstractResource.analyze(AbstractResource.java:90)
	at org.eclipse.xtend.shared.ui.core.internal.XtendXpandProject.analyze(XtendXpandProject.java:338)
	at org.eclipse.xtend.shared.ui.core.builder.XtendXpandBuilder.build(XtendXpandBuilder.java:201)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2011-11-17 11:39:15.482
!MESSAGE .org.eclipse.jdt.core.external.folders does not exist



Here is a short spec of my installation:
Eclipse Version: 3.6.2
eclipse.buildId=M20110210-1200
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.platform.ide
Command-line arguments:  -product org.eclipse.platform.ide -data X:\eclipse_workspaces2\workspace_tools/../workspace_apps -dev file:X:/eclipse_workspaces2/workspace_tools/.metadata/.plugins/org.eclipse.pde.core/m2m/dev.properties -os win32 -ws win32 -arch x86 -consoleLog


Any help is kindly appreciated!
Vitali

[Updated on: Thu, 17 November 2011 11:10]

Report message to a moderator

Re: Java Model Exception when executing Xtend functions [message #757261 is a reply to message #757252] Thu, 17 November 2011 11:57 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 359
Registered: July 2009
Location: Dortmund
Senior Member

Hi Vitali!

Yes, the runtime Eclipse instance may play a role. Do you execute the transformation from within a plugin?

This may be something related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=338695

It seems that you have linked folders, from which elements are tried to access. Usually you will have linked folders for plugins that are in your development workspace and used in the runtime workspace.

Is this the case?

Kind regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Java Model Exception when executing Xtend functions [message #757280 is a reply to message #757261] Thu, 17 November 2011 13:18 Go to previous message
Vitali Gontsharuk is currently offline Vitali GontsharukFriend
Messages: 2
Registered: November 2011
Junior Member
Hi Karsten,

thanks for your quick answer!

Yes, I'm starting a runtime workbench from a workspace containing a couple of OSGi plugins, which are accessed by an Xtend workflow executed from an Ant script.

I have not explicitly configured any linked resources, but AFAIK Eclipse is implicitly creating linked folders for those plugins to be available in the runtime workbench. And the corresponding configuration is put to the <workspace>/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project file. Thus I guess, I can confirm that Smile

Best regards,
Vitali
Previous Topic:[Acceleo] Profile, Stereotype and getValue
Next Topic:[Acceleo] .mtl or .emtl?
Goto Forum:
  


Current Time: Sun Nov 23 03:36:49 GMT 2014

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

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