Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EOL] Adapter Error The value of type(issues loading model programmatically)
[EOL] Adapter Error The value of type [message #870519] Tue, 08 May 2012 14:12 Go to next message
Vasco Sousa is currently offline Vasco SousaFriend
Messages: 23
Registered: September 2009
Junior Member
Hello,

The issue is the following:
Having done an EOL file, and running it without incident from the eclipse run configuration, I am trying to run it from Java. Following the available documentation, I have trouble with other EOL file, and in this, it breaks in one of the models with the following error:

Adapter Error The value of type 'class org.eclipse.emf.ecore.impl.DynamicEObjectImpl' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@13cfd6e (name: AbsPCElem) (instanceClassName: null) (abstract: true, interface: false)'


all other models loaded, have no problems, and the model presenting the problems, was created by a previous EOL file.

the class AbsPCElem is abstract and the model contains references to classes that inherit from it.

it breaks on the last line of the createEmfModel function of the EpsilonStandalone class of the EpsilonStandalone example files, when loading the defined properties in the EmfModel instance, never reaching the EOL file execution.


I was originally running these files on eclipse Helios, but I also tested them in Indigo with the same results, with the latest stable version of the Epsilon tools.


best regards,

Vasco Sousa
Re: [EOL] Adapter Error The value of type [message #870549 is a reply to message #870519] Tue, 08 May 2012 16:08 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Hello Vasco,

Could you provide us a minimal example that reproduces the issue? It would be very useful for debugging Smile.

Cheers,
Antonio

Re: [EOL] Adapter Error The value of type [message #870654 is a reply to message #870549] Wed, 09 May 2012 08:58 Go to previous messageGo to next message
Vasco Sousa is currently offline Vasco SousaFriend
Messages: 23
Registered: September 2009
Junior Member
Shure,

here are the models involved in the issue.
it should only require the JoinPoint.ecore and the Test08_ElementRelation.aspectmodeltemp02.jp model, but as he points to the other models, I'll just send them any way.

the bpmn model, uses the eclipse bpmn editor metamodel.

the Java calls involved are:
	public List<IModel> getModels() throws Exception {
		List<IModel> models = new ArrayList<IModel>();
		models.add(createEmfModel("BaseModel", model, metaModel, true, false));
		String MetaModel02 = FileLocator.toFileURL(Platform.getBundle("lu.uni.lassy.split.common").getEntry("/model/aspectModel.ecore")).toURI().toString();
		models.add(createEmfModel("AspectModel", model02, MetaModel02, true, false));
		String MetaModel03 = FileLocator.toFileURL(Platform.getBundle("lu.uni.lassy.split.common").getEntry("/model/JoinPoint.ecore")).toURI().toString();
		models.add(createEmfModel("JoinPointModel", model02+"temp02.jp", MetaModel03, true, false));
		models.add(createEmfModel("bpmnOutModel", model+"result."+model.substring(model.lastIndexOf(".")+1, model.length()), metaModel, false, true));
		return models;
	}


and from EpsilonStandalone

	protected EmfModel createEmfModel(String name, String model, String metamodel, boolean readOnLoad, boolean storeOnDisposal) throws EolModelLoadingException, URISyntaxException {
		EmfModel emfModel = new EmfModel();
		StringProperties properties = new StringProperties();
		properties.put(EmfModel.PROPERTY_NAME, name);
		properties.put(EmfModel.PROPERTY_METAMODEL_FILE, metamodel);
		properties.put(EmfModel.PROPERTY_MODEL_FILE, model);
		properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
		properties.put(EmfModel.PROPERTY_READONLOAD, readOnLoad + "");
		properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, storeOnDisposal + "");
		emfModel.load(properties, null);
		return emfModel;
	}


hope this helps to replicate the issue,
anything else let me know, at worse I can send you the whole project.

Cheers,
Vasco

Re: [EOL] Adapter Error The value of type [message #871321 is a reply to message #870654] Fri, 11 May 2012 23:05 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
I'm sorry, but could you package your affected plugins so I could import them into my Eclipse workspace?

I'm afraid I'm missing some code. What are those "model", "metaModel", "model02" and "metaModel02" variables from? I think I would need the "lu.uni.lassy.split.common" project as well.
Re: [EOL] Adapter Error The value of type [message #871340 is a reply to message #871321] Sat, 12 May 2012 08:06 Go to previous messageGo to next message
Vasco Sousa is currently offline Vasco SousaFriend
Messages: 23
Registered: September 2009
Junior Member
Sorry, I'm so used to the project I forgot to explain the variables in the functions I presented, and to lazy to create a proper reproduction of the error.

So, the attached project is the minimum, I fond that reproduces the error, you just need to run it, and in the popup menu there should be a run command, with a red icon to be easy to spot.

it runs the WeaverStandalone.main() function. In there I define the values to the variable you where asking me about:

model : is the location of the main model I work with, and in the models I sent is testBase.bpmn

metaModel : the location of the meta-model of the previous model in this case bpmn.ecore (I added this in the attached project)

model02 : is the aspect model location and refers to Test08_ElementRelation.aspectmodel

metaModel02 : is constant and within the project, it refers to the location of aspectModel.ecore

I removed the dependencies to the common plugin, by moving the constant meta-models to this test plugin.

to run this, just place the files Test08_ElementRelation.aspectmodel, Test08_ElementRelation.aspectmodeltemp02.jp, testBase.bpmn and bpmn.ecore in a folder with wright permision, such as a test workspace and replace their location path in the main function.

feel free to call on me anything else I forgot to properly explain.
cheer,

Vasco

[Updated on: Sat, 12 May 2012 08:12]

Report message to a moderator

Re: [EOL] Adapter Error The value of type [message #877372 is a reply to message #871340] Sat, 26 May 2012 15:27 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Hi Vasco,

Sorry for the wait. I've imported your project and got it working after some tweaking. I've reproduced your issue, but the same thing happens whether I use a launch configuration or your popup menu entry :-/.

The error is produced while loading the .aspectmodeltemp02.jp join point model. It appears that there's something strange going on with the "pc" field in your Pair instances.

In fact, if I try to open the .aspectmodeltemp02.jp file with the Exeed editor, the "Pc" field in the Properties view is always shown empty. That means that EMF wasn't able to resolve the reference to the other model, for some reason.

After some poking around, I've found something interesting in your JoinPoint.ecore metamodel. It appears you're using a relative path to your aspectModel.ecore metamodel to define the type of the "pc" field of the Pair type, instead of the URI of its main package. Changing it to your EPackage's URI fixes it.

Could you try again with the fixed metamodel?

Cheers,
Antonio
Re: [EOL] Adapter Error The value of type [message #892396 is a reply to message #877372] Thu, 28 June 2012 06:16 Go to previous messageGo to next message
Vasco Sousa is currently offline Vasco SousaFriend
Messages: 23
Registered: September 2009
Junior Member
Hey,

sorry for the late reply,

it took me a wile to get around to it, but I managed to fix the loading error
so I did as you suggested and used the fixed ecore with the URI reference instead of relative, and it gave the same error.

I tried registering the ecores both as dynamic packages and generated packages
to no avail.

finally I changed the loading method of the models from createEmfModel that loads with a metamodel location to createEmfModelByURI, and that hit the spot.

I'm guessing this is also one of the tweaking you did to have the project running,
and my preliminary conclusion is that both alterations where needed.


Cheers,
Vasco

[Updated on: Thu, 28 June 2012 06:31]

Report message to a moderator

Re: [EOL] Adapter Error The value of type [message #893043 is a reply to message #892396] Mon, 02 July 2012 12:18 Go to previous message
Vasco Sousa is currently offline Vasco SousaFriend
Messages: 23
Registered: September 2009
Junior Member
Hello!

I'm back.

So the previous solution helps in the regard that the models now load,
my current issue is that they don't load correctly.

the project is the same, the EOL code runs fine from the run configuration,
but from the plug-in it now loads the same model multiple times.
Changing the order the models creation order in Java changes witch model is loaded,
but in debug mode, the created variables seem to refer the correct models,
and then in EOL if I check the content of each of the models they are ether all the same
except the write model or the original read model appears empty, depending if one of the
other models is the first loaded or not.

should I create a new thread, because it seems to be a new issue or do we keep it here
because it is the same example and it is a followup on the previous error and it still
is a model loading problem ?

Cheers,
Vasco
Previous Topic:Problem with namespaces
Next Topic:Error in generated refreshSemantic()
Goto Forum:
  


Current Time: Mon Dec 22 14:28:29 GMT 2014

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

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