Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL Plugin with 2 source metamodels
ATL Plugin with 2 source metamodels [message #917017] Wed, 19 September 2012 14:36 Go to next message
Fernanda R.F. is currently offline Fernanda R.F.
Messages: 64
Registered: May 2012
Member
Hi,

I'm getting "NullPointException" when I'm trying to run a java code created by ATL Plugin to an ATL code that has two source metamodels.

The error is happening in main.

Is there something specific that need to do to use ATL plugin with ATL code that has more than one source metamodel?

Someone knows what could be happening to be getting this error?
Re: ATL Plugin with 2 source metamodels [message #917632 is a reply to message #917017] Thu, 20 September 2012 05:13 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 600
Registered: July 2009
Senior Member
Hello,

The ATL Plugin creation wizard normally reflects the source/target metamodels that are detected when selecting the concerned transformation.
Maybe your problem comes from the loading/saving of the models (via calls to the generated "loadModels"/"saveModels" methods) before actually executing the transformation.
Checking the full detail of the stack trace could also help to identify the location of the error.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: ATL Plugin with 2 source metamodels [message #921828 is a reply to message #917632] Mon, 24 September 2012 09:15 Go to previous messageGo to next message
Fernanda R.F. is currently offline Fernanda R.F.
Messages: 64
Registered: May 2012
Member
I'm still getting this error, I changed the files name (metamodels), however the error is the same.

The error is where you said, in LoadModels but I don't have any idea how to solve it.

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector.java:58)
	at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector.java:84)
	at org.eclipse.m2m.atl.Myclassplugin.files.MyClassPlugin.loadModels(MyClassPlugin.java:122)
	at org.eclipse.m2m.atl.Myclassplugin.files.MyClassPlugin.main(MyClassPlugin.java:80)


Is there another idea about what could be done to solve it?

Thanks a lot!
Re: ATL Plugin with 2 source metamodels [message #922033 is a reply to message #921828] Mon, 24 September 2012 13:13 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 600
Registered: July 2009
Senior Member
Hello,

Are you sure the URI (String) you are passing to the load method is actually correct?
If it is a file path, you have to check that your project class path or base directory is configured accordingly.
For instance in this example, the indicated base directory is a given project in the workspace.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: ATL Plugin with 2 source metamodels [message #922056 is a reply to message #922033] Mon, 24 September 2012 13:43 Go to previous message
Fernanda R.F. is currently offline Fernanda R.F.
Messages: 64
Registered: May 2012
Member
Thanks Hugo, but I used this code and I got the same error. I really don't know what I'm doing wrong, I used the correct names.
I don't know if the problem could be because as I'm using 2 source metamodels in ATL and then I need to put a "name" to the second source metamodel, like:
IN: metamodel1, metamodel2: metamodelNew;

I'll try again using this code to solve the problem.
Thanks!
Previous Topic:One to many transformation
Next Topic:ADT in RCP application
Goto Forum:
  


Current Time: Thu Jul 24 19:02:46 EDT 2014

Powered by FUDForum. Page generated in 0.03043 seconds