Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Problem finalizing Model with stereotypes on association ends applied
Problem finalizing Model with stereotypes on association ends applied [message #896102] Tue, 17 July 2012 09:30 Go to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
According to my question in the UML2 forum: http://www.eclipse.org/forums/index.php/t/367608/, I have done further debugging.

To give a briefly description of my problem. I use a profile with several stereotypes. The stereotypes should be applied to an OUT model which is UML2 (http://www.eclipse.org/uml2/3.0.0/UML). I apply a stereotype which is applicable to UML!Property to several properties. Most of them are association ends and some of them are attributes of classes.

I dispense with posting the code here, because it's in the mentioned UML2-forum-topic.

The application on attributes work fine. But if I add the properties to an association as navigableOwnedEnds when finalizing the model an IllegalArgumentException is thrown.

It appears only, if I apply my Property-stereotype to an UML!Property which is part of an association.

The full stack trace is the following.

org.eclipse.m2m.atl.engine.emfvm.VMException
	at org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(UML2ModelAdapter.java:51)
	at org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv.terminated(ExecEnv.java:2557)
	at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:210)
	at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:170)
	at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(EMFVMUILauncher.java:46)
	at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:136)
	at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
	at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:237)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.applyDelayedInvocations(UML2ModelAdapter.java:136)
	at org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(UML2ModelAdapter.java:49)
	... 12 more
Caused by: java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@a73925 (name: xsdElement, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
	at org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype(ElementOperations.java:1413)
	at org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(ElementImpl.java:510)
	... 17 more


I've done some debugging. With the ATL debugger the applyStereotype-method is successfully called, but if it seems the atl script had run successful the IllegalArgumentException is thrown.

Does anyone have an idea? Is this an ATL-bug? I would be delighted if somebody has an idea what I could do.
Is there a way to directly debug the ATL engine?
Re: Problem finalizing Model with stereotypes on association ends applied [message #896117 is a reply to message #896102] Tue, 17 July 2012 10:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Use the Java debugger; if necessary starting a nested Eclipse in debug
mode, but more easily by starting your main Eclipse with

-Xrunjdwp:server=y,transport=dt_socket,address=14143,suspend=n

so that you can then attach a second Eclipse as a debugger on the first.

Regards

Ed Willink


On 17/07/2012 10:30, Martin Benedict wrote:
> According to my question in the UML2 forum:
> http://www.eclipse.org/forums/index.php/t/367608/, I have done further
> debugging.
> To give a briefly description of my problem. I use a profile with
> several stereotypes. The stereotypes should be applied to an OUT model
> which is UML2 (http://www.eclipse.org/uml2/3.0.0/UML). I apply a
> stereotype which is applicable to UML!Property to several properties.
> Most of them are association ends and some of them are attributes of
> classes.
>
> I dispense with posting the code here, because it's in the mentioned
> UML2-forum-topic.
>
> The application on attributes work fine. But if I add the properties
> to an association as navigableOwnedEnds when finalizing the model an
> IllegalArgumentException is thrown.
>
> It appears only, if I apply my Property-stereotype to an UML!Property
> which is part of an association.
>
> The full stack trace is the following.
>
>
> org.eclipse.m2m.atl.engine.emfvm.VMException
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(UML2ModelAdapter.java:51)
> at
> org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv.terminated(ExecEnv.java:2557)
> at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:210)
> at
> org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:170)
> at
> org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(EMFVMUILauncher.java:46)
> at
> org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:136)
> at
> org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
> at
> org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:237)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.applyDelayedInvocations(UML2ModelAdapter.java:136)
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(UML2ModelAdapter.java:49)
> ... 12 more
> Caused by: java.lang.IllegalArgumentException:
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@a73925 (name:
> xsdElement, visibility: <unset>) (isLeaf: false, isAbstract: false)
> (isActive: false)
> at
> org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype(ElementOperations.java:1413)
> at
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(ElementImpl.java:510)
> ... 17 more
>
>
> I've done some debugging. With the ATL debugger the
> applyStereotype-method is successfully called, but if it seems the atl
> script had run successful the IllegalArgumentException is thrown.
>
> Does anyone have an idea? Is this an ATL-bug? I would be delighted if
> somebody has an idea what I could do.
> Is there a way to directly debug the ATL engine?
Re: Problem finalizing Model with stereotypes on association ends applied [message #896145 is a reply to message #896117] Tue, 17 July 2012 12:08 Go to previous messageGo to next message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
Thanks for your suggestion to debug the eclipse session. I've decided to check out ATL sources and use the plugin-debugging-facilities in eclipse. With your help I could solve my problem. Thank you very much.
(The resolution for the problem is mentioned in the link in my previous thread-)
Re: Problem finalizing Model with stereotypes on association ends applied [message #896282 is a reply to message #896102] Tue, 17 July 2012 20:50 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Op 17-07-12 11:30, Martin Benedict schreef:
> *snip*
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.applyDelayedInvocations(UML2ModelAdapter.java:136)
>
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(UML2ModelAdapter.java:49)
>
> ... 12 more
> Caused by: java.lang.IllegalArgumentException:
> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@a73925 (name: xsdElement,
> visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
> at
> org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype(ElementOperations.java:1413)
>
> at
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(ElementImpl.java:510)
>
> ... 17 more
>
>
> I've done some debugging. With the ATL debugger the applyStereotype-method is
> successfully called, but if it seems the atl script had run successful the
> IllegalArgumentException is thrown.
>
> Does anyone have an idea? Is this an ATL-bug? I would be delighted if somebody
> has an idea what I could do.
> Is there a way to directly debug the ATL engine?

Not sure what goes wrong with your stereotype application, but I can shed some
light on the ATL debugging portion. As you can see in the stack trace, ATL
does something called "applyDelayedInvocations". This means stereotypes are
only applied after the execution of the ATL transformation is finished. This
is done to guarantee the following stereotype preconditions:

- The profile that contains the stereotype must be applied to the target UML
Model element (your transformation does this, right?)
- The element to which the stereotype is to be applied must be contained in
the target Model element

Cheers,
Dennis
Re: Problem finalizing Model with stereotypes on association ends applied [message #896345 is a reply to message #896282] Wed, 18 July 2012 07:01 Go to previous message
Martin Benedict is currently offline Martin BenedictFriend
Messages: 22
Registered: June 2012
Junior Member
The delayed application I also have identified, but not considered as very significant for the application.

Is it really necessary to apply the profile to every model element that should have a stereotype applied? Or have I understand your suggestion wrong? I thought the on the topmost model element containing all others the profile should be applied. Currently it works in this way.

One problem I have is that due to the delayed application of profile and stereotypes I could not read tagged values from the target model that I set in other rules.
Previous Topic:[ATL] Unresolved cross-reference... Again
Next Topic:lazy rule doesn't return class
Goto Forum:
  


Current Time: Tue Mar 19 10:08:33 GMT 2024

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

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

Back to the top