Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Flock] error while executing migration strategy distributed via plugin
[Flock] error while executing migration strategy distributed via plugin [message #674287] Thu, 26 May 2011 12:35 Go to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Hi all,

I am trying to execute Epsilon Flock migration strategy distributed via plugin using the extension points. Everything is just following the Petrinet example on the Epsilon site: http://www.eclipse.org/gmt/epsilon/cinema/FlockPetrinets.htm.

The problem is that in one case, I have got the following error:
!ENTRY org.eclipse.epsilon.common.dt 1 0 2011-05-26 14:21:28.810
!MESSAGE Error while finding migration strategy for M100v100.design: java.lang.NullPointerException

!ENTRY org.eclipse.epsilon.common.dt 1 0 2011-05-26 14:21:33.466
!MESSAGE No appropriate migration strategy could be found for M100v100.design


In order to see if I am doing something wrong, I also made a small example and followed the same steps and it works there... So, I am really surprised why it does not work in my primary case! Also, when I execute the primary case strategy via Run Configuration, it just works fine! The only big difference I can see is that in my primary case the metamodel is extending another one and in the small case is only one metamodel to be migrated.

Any suggestions?!

Greetings,
Hristina
Re: [Flock] error while executing migration strategy distributed via plugin [message #674384 is a reply to message #674287] Thu, 26 May 2011 18:01 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Hristina,

I'm sorry to read that you're having a problem with the Flock extension point. It's suspicious that your migration works when executed with an Eclipse launch configuration but not via the extension point: this might be a bug.

Could you produce a minimal example that I can use to reproduce the problem on my machine? We've started to put together an article with some hints and tips for producing minimal examples, which you might find useful: http://www.eclipse.org/gmt/epsilon/doc/articles/requesting-help-and-reporting-bugs/

Many thanks,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #674386 is a reply to message #674384] Thu, 26 May 2011 18:02 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
PS: Please send your minimal example to: epsilon DOT devs AT gmail DOT com
Re: [Flock] error while executing migration strategy distributed via plugin [message #675100 is a reply to message #674386] Mon, 30 May 2011 10:03 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Dear Louis,

Thanks for your reply and suggestion to send an example to your mail, but...

As I already mentioned in my previous mail, I cannot reproduce the same error in other simple example. I also made the simple example using two ecores, where one extends the other and it works fine.

Any ideas?

Greetings,
Hristina

PS: I cannot send you my primary metamodels, because they are confidential. And by the way, last week I already send another question with an example to your e-mail and I am still waiting for a reply. The question there was about how to create new element and set its attributes within migration strategy... In my case, the element gets created, but the attributes are empty!

[Updated on: Mon, 30 May 2011 15:07]

Report message to a moderator

Re: [Flock] error while executing migration strategy distributed via plugin [message #675337 is a reply to message #675100] Tue, 31 May 2011 08:24 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Hi Louis,

I checked out the Epsilon SVN projects and decided to debug... What I found is as follows:

The exception I see is from ExecuteMigrationStrategy:
	@Override
	public void selectionChanged(IAction action, ISelection selection) {
		super.selectionChanged(action, selection);
		
		try {
			if (getFirstElementInSelection() instanceof IFile) {
				modelFile    = (IFile)getFirstElementInSelection();
				
				migrationStrategyExtension = locator.findMigrationStrategyExtensionFor(modelFile);
				
				action.setEnabled(migrationStrategyExtension != null);
			}
		
		} catch (MigrationStrategyExtensionLocatorException ex) {
			printError("Error while finding migration strategy for " + modelFile.getName() + ": " + ex.getLocalizedMessage());		
		}


It breaks on the "locator.findMigrationStrategyExtensionFor(modelFile)"!
When I followed, it called the constructor of MigrationStrategyExtension:
public MigrationStrategyExtension(IConfigurationElement extPoint) throws InvalidRegistryObjectException, URISyntaxException {
		final Bundle bundle = Platform.getBundle(extPoint.getDeclaringExtension().getNamespaceIdentifier());
		
		this.pluginId              = extPoint.getDeclaringExtension().getNamespaceIdentifier();
		this.strategyFile          = bundle.getResource(extPoint.getAttribute("strategyFile")).toURI();
		this.originalMetamodelFile = extPoint.getAttribute("originalMetamodelFile");
		this.evolvedMetamodelFile  = extPoint.getAttribute("migratedMetamodelFile");

	}


Here the problem comes from "bundle.getResource(extPoint.getAttribute("strategyFile")).toURI()". The "extPoint.getAttribute("strategyFile")" returns properly the *.mig file, but the bundle.getResource(...) returns null!

Any idea?

Greetings,
Hristina
Re: [Flock] error while executing migration strategy distributed via plugin [message #675463 is a reply to message #675337] Tue, 31 May 2011 15:37 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Hristina,

Thanks for debugging the problem on your end. Without access to your metamodels, that would have been extremely difficult for me!

If I recall correctly, bundle.getResource(...) will only return null if the requested path cannot be resolved to a bundled resource. Are you sure that the plugin.xml (in the project that causes the error) correctly specifies the path to the migration strategy?

If possible, would you paste the contents of the plugin.xml file for the project that works (your simple example) and the plugin.xml file for the project that does not work? It might be helpful to compare them side-by-side.

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #675465 is a reply to message #675100] Tue, 31 May 2011 15:50 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Xmoneva.gmail.com wrote on Mon, 30 May 2011 06:03
And by the way, last week I already send another question with an example to your e-mail and I am still waiting for a reply. The question there was about how to create new element and set its attributes within migration strategy... In my case, the element gets created, but the attributes are empty!


I'm sorry about this. We don't check the epsilon.devs account unless we are expecting to receive a file from someone. We prefer to use the forum to discuss problems, as this provides a public record of any problems, which other users can search in the future.

To answer the question you sent by email, (in general) the values of new properties are set via the migrated variable in the body of a migrate rule. So for a metamodel that evolves from:

class Block {
  attr String name;
  val Property[*] hasProperty
}


to

class Block {
  attr String name;
  attr int multiplicity = 1;
  val Property[*] hasProperty
}


The following Flock migration strategy can be used to set the value of the multiplicity attribute to the number of properties contained in each original Block:

migrate Block {
  migrated.multiplicity = original.hasProperty.size();
}


A chapter on Flock for the Epsilon Book is high on my priority list, and should be completed within the next month. In the body of each migrate rule, any valid EOL statements can be used.

This paper at ICMT 2010 might also be helpful: http://dx.doi.org/10.1007/978-3-642-13688-7_13

I hope that helps!

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #684916 is a reply to message #675465] Thu, 16 June 2011 13:22 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Dear Louis,

Thanks for the answer! But... I still cannot manage. The example you gave in your reply was exactly the opposite of what I need - just switching the from and to metamodels. It should be:
FROM:
class Block {
  attr String name;
  attr int multiplicity = 1;
  val Property[*] hasProperty
}

TO:
class Block {
  attr String name;
  val Property[*] hasProperty
}


The goal of the migration is to create new property with name "multiplicity" and value as it was in the original model.
The MIGRATION STRATEGY I use is as follows:
migrate Block {
	for (multi in original.multiplicity) {
		var par = new Property();
		par.key = "multiplicity";
		par.value = multi.toString();
		par.println();
		migrated.hasProperty.add(par);
	}
}


The result is that a new Property element is created ("par.print()" supports my statement that the attributes are created correctly), but no attributes are set (based on the resulting migrated model).
What is the correct way of setting the attributes?!

Thanks in advance,
Hristina

[Updated on: Thu, 16 June 2011 14:46]

Report message to a moderator

Re: [Flock] error while executing migration strategy distributed via plugin [message #684935 is a reply to message #675463] Thu, 16 June 2011 13:49 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Dear Louis,

And now about the bundle.getResource(...) problem.

The current situation is as follows: I have two examples - small and big. In the small everything works fine - with "Epsilon Flock Migration Strategy" Run Configuration and via Flock extension point. In the big example - the "Epsilon Flock Migration Strategy" Run Configuration works fine, but the Flock extension point ends with the bundle.getResource(...) error.

The plugin.xml files...
SMALL EXAMPLE:
<plugin>
   <extension point="org.eclipse.emf.ecore.generated_package">
      <package
            uri="http://www.whatever.nl/MyA.ecore"
            class="MyA.MyAPackage"/>
   </extension>
   <extension
         point="org.eclipse.epsilon.flock.dt.strategy">
      <migrationStrategy
            migratedMetamodelFile="model-migration/new/My.ecore"
            modelExtensions="my"
            originalMetamodelFile="model-migration/old/My.ecore"
            strategyFile="model-migration/old2new-abstr.mig">
      </migrationStrategy>
   </extension>
</plugin>

BIG NOT_WORKING EXAMPLE:
<plugin>
   <extension point="org.eclipse.emf.ecore.generated_package">
      <package
            uri="http://www.esi.nl/2.0.0/design.ecore"
            class="nl.esi.design.DesignPackage"/>
   </extension>
   <extension
         point="org.eclipse.epsilon.flock.dt.strategy">
      <migrationStrategy
            migratedMetamodelFile="model-migration/m110v200/design.ecore"
            modelExtensions="design"
            originalMetamodelFile="model-migration/m100v100/design.ecore"
            strategyFile="model-migration/M100toM110.mig">
      </migrationStrategy>
   </extension>
</plugin>


The build.properties files...
SMALL EXAMPLE:
bin.includes = .,\
               model-migration/,\
               META-INF/,\
               plugin.xml,\
               plugin.properties
jars.compile.order = .
source.. = src/
output.. = bin/

BIG NOT_WORKING EXAMPLE:
bin.includes = nl.esi.design.model.jar,\
               META-INF/,\
               plugin.xml,\
               plugin.properties,\
               model-migration/
jars.compile.order = nl.esi.design.model.jar
source.nl.esi.design.model.jar = src/
output.nl.esi.design.model.jar = bin/


The migration strategy files...
SMALL EXAMPLE:
migrate Block {
	for (multi in original.multiplicity) {
		var par = new Property();
		par.key = "multiplicity";
		par.value = multi.toString();
		migrated.hasProperty.add(par);
	}
}

BIG NOT_WORKING EXAMPLE:
migrate SystemBlock {
	for (multi in original.multiplicity) {
		var par = new Parameter();
		par.key = "multiplicity";
		par.value = multi.toString();
		migrated.hasParameter.add(par);
	}
}


I am going to prepare an archive of the small example and send to you and hope to hear on both topics from you!

Greetings,
Hristina

[Updated on: Thu, 16 June 2011 14:44]

Report message to a moderator

Re: [Flock] error while executing migration strategy distributed via plugin [message #686101 is a reply to message #684916] Tue, 21 June 2011 17:52 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hristina Moneva wrote on Thu, 16 June 2011 09:22
Dear Louis,

Thanks for the answer! But... I still cannot manage. The example you gave in your reply was exactly the opposite of what I need - just switching the from and to metamodels. It should be:
FROM:
class Block {
  attr String name;
  attr int multiplicity = 1;
  val Property[*] hasProperty
}

TO:
class Block {
  attr String name;
  val Property[*] hasProperty
}


The goal of the migration is to create new property with name "multiplicity" and value as it was in the original model.
The MIGRATION STRATEGY I use is as follows:
migrate Block {
	for (multi in original.multiplicity) {
		var par = new Property();
		par.key = "multiplicity";
		par.value = multi.toString();
		par.println();
		migrated.hasProperty.add(par);
	}
}


The result is that a new Property element is created ("par.print()" supports my statement that the attributes are created correctly), but no attributes are set (based on the resulting migrated model).
What is the correct way of setting the attributes?!


Hi Hristina,

Thanks for the very clear descriptions of what you'd like to achieve.

The problem is that the type Property is ambiguous: this could refer to the Property in the original model or in the migrated model. We need to be more specific, and indicate that we wish to refer to Property in the metamodel of the migrated model:

Migrated!Property


Admittedly, EOL and hence Flock should probably issue a warning here, as the ambiguity can cause much confusion (as in this case). I'll open a bug to fix this.

Finally, it's worth noting that the for loop is not necessary here: original.multiplicity is always an integer, and iterating over an integer is the same as executing the loop once. So, the final code looks like this:

migrate Block {
	var par = new Migrated!Property();
	par.key = "multiplicity";
	par.value = original.multiplicity.toString();
	par.println();
	migrated.hasProperty.add(par);
}


I'll take a look at the extension point problem now too.

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #686103 is a reply to message #686101] Tue, 21 June 2011 18:07 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
PS: I've opened #349972 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=349972) to cover the ambiguity problem that I discussed above.
Re: [Flock] error while executing migration strategy distributed via plugin [message #686112 is a reply to message #684935] Tue, 21 June 2011 18:39 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Hristina,

With regard to the extension configuration. Is the problem still as you described previously:

Quote:

public MigrationStrategyExtension(IConfigurationElement extPoint) throws InvalidRegistryObjectException, URISyntaxException {
		final Bundle bundle = Platform.getBundle(extPoint.getDeclaringExtension().getNamespaceIdentifier());
		
		this.pluginId              = extPoint.getDeclaringExtension().getNamespaceIdentifier();
		this.strategyFile          = bundle.getResource(extPoint.getAttribute("strategyFile")).toURI();
		this.originalMetamodelFile = extPoint.getAttribute("originalMetamodelFile");
		this.evolvedMetamodelFile  = extPoint.getAttribute("migratedMetamodelFile");

	}


Here the problem comes from "bundle.getResource(extPoint.getAttribute("strategyFile")).toURI()". The "extPoint.getAttribute("strategyFile")" returns properly the *.mig file, but the bundle.getResource(...) returns null!


If so, are you certain that the path to the Flock migration strategy file in the plugin.xml below is correct? Maybe it should be "model-migration/M100toM200.mig"?

I ask because the examples that you emailed work on my machine! Do these examples fail on your machine?

Quote:

BIG NOT_WORKING EXAMPLE:

<plugin>
   <extension point="org.eclipse.emf.ecore.generated_package">
      <package
            uri="http://www.esi.nl/2.0.0/design.ecore"
            class="nl.esi.design.DesignPackage"/>
   </extension>
   <extension
         point="org.eclipse.epsilon.flock.dt.strategy">
      <migrationStrategy
            migratedMetamodelFile="model-migration/m110v200/design.ecore"
            modelExtensions="design"
            originalMetamodelFile="model-migration/m100v100/design.ecore"
            strategyFile="model-migration/M100toM110.mig">
      </migrationStrategy>
   </extension>
</plugin>




Cheers,
Louis.

Re: [Flock] error while executing migration strategy distributed via plugin [message #691404 is a reply to message #686101] Fri, 01 July 2011 11:48 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Hi Louis,

Thanks a lot for your explanation! I definitely makes sense...

I just tried your suggestion of using "Migrated!Property()", but I get the following error:
Type 'Migrated!Property' not found (D:\...\model-migration\M100toM110.mig@3:22)


I tried (just in case) other ways of writing it, like "migrated!", "Migrated.", and "migrated.", but it did not help...

What am I missing?!

Greetings,
Hristina

[Updated on: Wed, 06 July 2011 10:51]

Report message to a moderator

Re: [Flock] error while executing migration strategy distributed via plugin [message #691453 is a reply to message #686112] Fri, 01 July 2011 13:43 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Hi Louis,

About the extension strategy...

Quote:
If so, are you certain that the path to the Flock migration strategy file in the plugin.xml below is correct?

Yes, I am, because I use the Browse button to select the file (not just manually typing it in the plugin.xml), as you can see in the screenshot (the attached file).

Quote:
Maybe it should be "model-migration/M100toM200.mig"?

No, because such file does not exist. The previous argument holds here as well...

In the screenshot you can see the file hierarchy I use (in the Package Explorer), as well as the selection of the only strategy I have...

About the fact that the simple example I sent you works at your computer - it is the same here. The problem is that identical, but more complex case - does not!

I have no idea how to solve it... I will try with a clean Eclipse installation and importing there anew all the projects. I have no other idea for now... If nothing helps, I have still two options: to use other migration technology or sending you my complete project set (which I hesitate). I will inform you if I have some progress. I would appreciate if you have any other ideas...

Greetings,
Hristina

PS: in the screenshot you can also see the error message for the migration strategy itself on "Migrated!Parameter" (in the simple example should be "Migrated!Property")
index.php/fa/3211/0/
Re: [Flock] error while executing migration strategy distributed via plugin [message #696685 is a reply to message #691453] Thu, 14 July 2011 15:20 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
I just installed the latest Eclipse - 3.7 and all required projects...
I rerun my projects and tried the run the migration strategy --> again NullPointerException for the migration strategy... Sad

Hristina
Re: [Flock] error while executing migration strategy distributed via plugin [message #697649 is a reply to message #696685] Sun, 17 July 2011 15:39 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hristina,

Firstly, I'm sorry for the late reply. I've been travelling, and generally very busy for the past couple of weeks.

So it seems that two problems remain. With respect to the "Type Migrated!Property not found" error, could this be because of the way that the migration strategy is being launched? If it's being launched from an Eclipse launch configuration, the "Migrated" part of the name should match exactly the name of the model that has been selected in the launch configuration. For example, in the attached screenshot, I've selected "B" as the migrated model and hence the type would be "B!Property" (and not "Migrated!Property").

For the second problem (the NullPointerException), I'm afraid that I'm out of ideas. It would really help if you could send me a copy of the project that is causing the problem. I'd be happy to sign a non-disclosure or confidentiality agreement if that would be helpful.

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #709742 is a reply to message #674287] Thu, 04 August 2011 08:53 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Dear Louis,

First of all, thanks for the last reply - it worked! Now I can migrate all properties I wanted... Smile

Second, I am going to send you part of my projects (just the model and tree editors along with the migration strategy) in a mail to the developers mail. I hope that would help to allocate the problem with the NPE. Looking forward to your answer..

Greetings,
Hristina
Re: [Flock] error while executing migration strategy distributed via plugin [message #714708 is a reply to message #709742] Thu, 11 August 2011 10:25 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hristina,

Sorry for the late reply: I've been on vacation for the past 10 days. However, I think that I've finally got to the bottom of this problem...

It seems that the method (Bundle#getResource()) that I use to locate the Flock migration strategy from a user's extensions does not work when the user's plugin builds a JAR file that has a name other than the Eclipse default (which is "."). I've changed Flock to use a different method (Bundle#getEntry()), which seems more tolerant: it can load resources from a bundle that does not have the default name. I've committed this change, and the fix will be available in the next interim release of Epsilon.

As a workaround for now, you can restore the default JAR file name for the plugin that defines your Flock extension:

1) Open "your.plugin/plugin.xml" and select the Build tab.
a) Under the runtime information group (at the top), right-click "your.plugin.jar".
b) Select Rename.
c) Enter a single full stop character as the name. In other words, the name should be: .

2) Now open the MANIFEST.MF tab of the same file ("your.plugin/plugin.xml").
a) Find the line that reads: Bundle-ClassPath: nl.esi.design.model.jar
b) Replace it with a line that reads: Bundle-ClassPath: .

3) Save the changes to the "your.plugin/plugin.xml" file.

4) Relaunch Eclipse.


The above should prevent the NullPointerException for now. When the next interim version of Epsilon is released, you can go back to the previous settings that cause your plugin to build a JAR named "your.plugin.jar"

Finally, you'll need to use Original and Migrated as the model names when launching a Flock migration strategy via the extension point. Specifically, you'll need to change "xxx!Parameter" to "Migrated!Parameter" on line 2 of the migration strategy that you emailed to us.

I hope this helps to finally solve this very mysterious problem! Thanks a lot for all of your patience. I'm sorry that it's taken so long to get to diagnose. As you can see, the issue seems to occur in very specific circumstances that I was previously unable to recreate.

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #716718 is a reply to message #714708] Thu, 18 August 2011 08:22 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Dear Louis,

Thank you very much! No NPE anymore... Smile

I did apply both changes you suggested and I am step further, but there is still some problem left...

Now, when I execute the migration strategy via extension point there is no NPE. A backup file is created (which can be restored). The problem is that no migrated file is created and error is thrown (see below)!

I use:
Eclipse SDK Version: 3.6.2
EMF SDK 2.6.1
GMF SDK 2.3.0
GMF Notation SDK 1.4.1
GMF Runtime 1.4.2
Epsilon Core && Epsilon EMF/GMF Live Validation 0.9.0


What can I do? Or what did I do wrong?!

Looking forward your reply! I feel I am very close to the success Wink

Greetings,
Hristina
---------------
The following error trace appears:
Called feature name on undefined object (13:48)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:56)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:42)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:130)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.OperatorExecutor.execute(OperatorExecutor.java:62)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.IfStatementExecutor.execute(IfStatementExecutor.java:36)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.ForStatementExecutor.execute(ForStatementExecutor.java:112)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.IfStatementExecutor.execute(IfStatementExecutor.java:43)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.flock.FlockContext.executeBlock(FlockContext.java:93)
	at org.eclipse.epsilon.flock.model.Body.applyTo(Body.java:31)
	at org.eclipse.epsilon.flock.execution.MigrateRuleBasedEquivalence.applyStrategyToPopulateEquivalent(MigrateRuleBasedEquivalence.java:33)
	at org.eclipse.epsilon.flock.execution.Equivalences.populateEachEquivalent(Equivalences.java:61)
	at org.eclipse.epsilon.flock.MigrationStrategyRunner.populateEachEquivalent(MigrationStrategyRunner.java:49)
	at org.eclipse.epsilon.flock.MigrationStrategyRunner.run(MigrationStrategyRunner.java:37)
	at org.eclipse.epsilon.flock.FlockContext.run(FlockContext.java:164)
	at org.eclipse.epsilon.flock.FlockModule.execute(FlockModule.java:80)
	at org.eclipse.epsilon.flock.FlockModule.execute(FlockModule.java:75)
	at org.eclipse.epsilon.flock.dt.util.MigrationStrategyExecutor.migrate(MigrationStrategyExecutor.java:87)
	at org.eclipse.epsilon.flock.dt.util.MigrationStrategyExecutor.run(MigrationStrategyExecutor.java:64)
	at org.eclipse.epsilon.flock.dt.actions.ExecuteMigrationStrategy.migrateSelectionUsing(ExecuteMigrationStrategy.java:64)
	at org.eclipse.epsilon.flock.dt.actions.ExecuteMigrationStrategy.run(ExecuteMigrationStrategy.java:54)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)

!ENTRY org.eclipse.epsilon.common.dt 4 0 2011-08-18 10:03:54.164
!MESSAGE Error encountered whilst executing Flock migration strategy for: ...
!STACK 0
Exception encountered while executing EOL block.
	at org.eclipse.epsilon.flock.FlockContext.executeBlock(FlockContext.java:101)
	at org.eclipse.epsilon.flock.model.Body.applyTo(Body.java:31)
	at org.eclipse.epsilon.flock.execution.MigrateRuleBasedEquivalence.applyStrategyToPopulateEquivalent(MigrateRuleBasedEquivalence.java:33)
	at org.eclipse.epsilon.flock.execution.Equivalences.populateEachEquivalent(Equivalences.java:61)
	at org.eclipse.epsilon.flock.MigrationStrategyRunner.populateEachEquivalent(MigrationStrategyRunner.java:49)
	at org.eclipse.epsilon.flock.MigrationStrategyRunner.run(MigrationStrategyRunner.java:37)
	at org.eclipse.epsilon.flock.FlockContext.run(FlockContext.java:164)
	at org.eclipse.epsilon.flock.FlockModule.execute(FlockModule.java:80)
	at org.eclipse.epsilon.flock.FlockModule.execute(FlockModule.java:75)
	at org.eclipse.epsilon.flock.dt.util.MigrationStrategyExecutor.migrate(MigrationStrategyExecutor.java:87)
	at org.eclipse.epsilon.flock.dt.util.MigrationStrategyExecutor.run(MigrationStrategyExecutor.java:64)
	at org.eclipse.epsilon.flock.dt.actions.ExecuteMigrationStrategy.migrateSelectionUsing(ExecuteMigrationStrategy.java:64)
	at org.eclipse.epsilon.flock.dt.actions.ExecuteMigrationStrategy.run(ExecuteMigrationStrategy.java:54)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: Called feature name on undefined object (13:48)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:56)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:42)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:130)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.OperatorExecutor.execute(OperatorExecutor.java:62)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.IfStatementExecutor.execute(IfStatementExecutor.java:36)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.ForStatementExecutor.execute(ForStatementExecutor.java:112)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.IfStatementExecutor.execute(IfStatementExecutor.java:43)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:33)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:179)
	at org.eclipse.epsilon.flock.FlockContext.executeBlock(FlockContext.java:93)
	... 41 more

[Updated on: Thu, 18 August 2011 08:24]

Report message to a moderator

Re: [Flock] error while executing migration strategy distributed via plugin [message #716873 is a reply to message #674287] Thu, 18 August 2011 16:13 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Dear Hristina,

Great -- I'm glad that the NullPointerException is fixed for you now.

The error that you're seeing (Called feature name on undefined object) indicates that some part of your migration strategy is attempting to access the feature "name" on a null value.

For example, consider the following program. When x is assigned null (perhaps because there are no instances of SomeMetamodelType in the model, and hence the call to first returns null), then attempting to execute line 2 will result in the runtime error: Called feature name on undefined object

var x = SomeMetamodelType.all.first;
x.name;


To fix this error, take a look at the part of the migration strategy that accesses the name feature and try to determine why the value could be null. I would start by looking at line 13, column 48 as the error message seems to indicate this is the location of the error (though I would have expected the error message to contain the path of a Flock migration strategy too...)

I'm afraid that I can't offer any more concrete advice without looking that the migration strategy and input model. Please feel free to put together a minimal example if you'd like me to take a look at this in more detail:
http://www.eclipse.org/gmt/epsilon/doc/articles/minimal-examples/

Cheers,
Louis.
Re: [Flock] error while executing migration strategy distributed via plugin [message #717787 is a reply to message #716873] Mon, 22 August 2011 11:21 Go to previous messageGo to next message
Hristina Moneva is currently offline Hristina MonevaFriend
Messages: 31
Registered: October 2009
Member
Thanks Louis!!!

Now everything works just perfect... Smile
Thanks for all the help!

Greetings,
Hristina
Re: [Flock] error while executing migration strategy distributed via plugin [message #717879 is a reply to message #717787] Mon, 22 August 2011 15:51 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hristina,

You're welcome. I'm glad that everything's working now.

Thanks again for your help in uncovering the Flock bug. The fix will make it into the next interim and stable releases.

Cheers,
Louis.
Previous Topic:using the trim() on Strings
Next Topic:Using two models in a single project
Goto Forum:
  


Current Time: Tue Apr 16 11:56:32 GMT 2024

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

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

Back to the top