Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Running ATL Transformation in java application(Can not initiate UMLResourcesUtil)
Running ATL Transformation in java application [message #1053669] Tue, 07 May 2013 08:17 Go to next message
Yousr CHELLY is currently offline Yousr CHELLYFriend
Messages: 4
Registered: March 2013
Junior Member
Hi everybody,

I've developed a java application which lunch an ATL Transformation, I was using eclipse juno and all my models where conform to the metamodel "http://www.eclipse.org/uml2/4.0.0/UML"

Everything was perfectly working and then because of technical constraints, i changed the version of my eclipse to eclipse galileo and i migrate to "http://www.eclipse.org/uml2/3.0.0/UML" as metamodel.

I used this code to load necessary UML resources:


ResourceSet RESOURCE_SET = new ResourceSetImpl();
UMLResourcesUtil.init(RESOURCE_SET);

URI baseUri = URI.createURI("jar:file:lib/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/");
URIConverter.URI_MAP.put(URI.createURI( UMLResource.LIBRARIES_PATHMAP ),
baseUri.appendSegment( "libraries" ).appendSegment( "" ));
URIConverter.URI_MAP.put(URI.createURI( UMLResource.METAMODELS_PATHMAP),
baseUri.appendSegment( "metamodels" ).appendSegment( "" ));
URIConverter.URI_MAP.put(URI.createURI( UMLResource.PROFILES_PATHMAP ),
baseUri.appendSegment( "profiles" ).appendSegment( "" ));

the "UMLResourcesUtil.init(RESOURCE_SET);" is causing a strange Exception Confused

this is the Exception I hope You can help me :

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.eclipse.uml2.uml.profile.l2.internal.impl.L2PackageImpl.createEOperation(Lorg/eclipse/emf/ecore/EClass;I)V
at org.eclipse.uml2.uml.profile.l2.internal.impl.L2PackageImpl.createPackageContents(L2PackageImpl.java:995)
at org.eclipse.uml2.uml.profile.l2.internal.impl.L2PackageImpl.init(L2PackageImpl.java:334)
at org.eclipse.uml2.uml.profile.l2.L2Package.<clinit>(L2Package.java:69)
at org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(UMLResourcesUtil.java:155)
at securityPatternPlugin.handlers.FramePatternChoice$5.actionPerformed(FramePatternChoice.java:320)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: Running ATL Transformation in java application [message #1053682 is a reply to message #1053669] Tue, 07 May 2013 08:40 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

I'm not sure your problem actually relates to ATL, but more likely to variations between the two different UML2 implementations.

For the single purpose of model transformation, the way you are loading the UML2 metamodel seems to be very complex.
ATL provides a simple API that allows to deal more easily with such metamodel/model loading actions.
Also, you can find a sample full Java launch (including metamodels/models loading and saving) from there.

I hope this helps.

Hugo


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: Running ATL Transformation in java application [message #1058077 is a reply to message #1053682] Fri, 10 May 2013 20:00 Go to previous message
ransou RMG is currently offline ransou RMGFriend
Messages: 15
Registered: February 2013
Junior Member
Hi,
I would like to run the transformation of models in a Java application.I found this link:
http://www.eclipse.org/forums/index.php/m/632793/?srch=launch+transformation+from+java+file#msg_632793
which demonstrates the same example in ATL tutorial:Families2Persons.I don't know how to run it:is it in an ATL project or in a Java project?Is it enough to copy the code in the previous link and it runs successfully?And if it is in a java project how to solve the problem of the import of libraries related to org.eclipse.m2m.atl.
Please I really need to run the example in the link because if it runs with the example of Families2Persons it will run with any couple of metamodels(afder doing some modifications of course).

I will be grateful if you answer me as soon as possible.
Previous Topic:EMFTVM/ATL How to assign the result of a rule matching several elements
Next Topic:Using Coreservice to run ATL transformatin in java
Goto Forum:
  


Current Time: Thu Apr 25 12:54:39 GMT 2024

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

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

Back to the top