Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EEF] Errors in the generated code.
[EEF] Errors in the generated code. [message #905939] Fri, 31 August 2012 10:43 Go to next message
aurelien didier is currently offline aurelien didierFriend
Messages: 11
Registered: June 2012
Junior Member
Hi everybody,

I have some errors in the eef generated code, and I don't know how to solve them.

In a package called: ClassPropertiesEditionComponent, I have:

public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Class class_ = (Class)elt;

The problem highlighted by eclipse is that: I Cannot cast from EObject to Class
So I try to do that: final EObject class_=(EObject)elt;
But then I have many other mistake that appears (they can be corrected easily). So I was wondering if it is the right thing to do.


Plus, I have an other error in the EEF generated code,

In the package RealTimeProperties.RtpMeasurementUnits.providers, I have:

import RealTimeProperties.RtpMeasurementUnits.util.RtpMeasurementUnitsAdapterFactory;

public class RtpMeasurementUnitsEEFAdapterFactory extends RtpMeasurementUnitsAdapterFactory {
}

Here the code generation of EMF doesn't create the RealTimeProperties.RtpMeasurementUnits.util and EEF is trying to use it so the class RtpMeasurementUnitsAdapterFactory doesn't exist. (In my ecore model, the RtpMeasurementUnits are composed of enumeration types only).


And when I try to launch with correcting the first error and with deleting my RealTimleProperties.RtpMeasurementUnits.providers and the .parts also. I can create my global model and his child (with obeo designer), but when I use one of his child,I have an error like:
"An error has occurred. See error log for more details.
The string resource '_UI_EPackage_eSubpackages_feature' could not be located"

Any help would be great.

Thanks,

Aurélien.
Re: [EEF] Errors in the generated code. [message #907166 is a reply to message #905939] Mon, 03 September 2012 12:40 Go to previous messageGo to next message
Goulwen Le Fur is currently offline Goulwen Le FurFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Aurélien,

Many problems in your mail :)

Le 31/08/2012 12:43, aurelien didier a écrit :
> Hi everybody,
> I have some errors in the eef generated code, and I don't know how to
> solve them.
>
> In a package called: ClassPropertiesEditionComponent, I have:
>
> public void initPart(Object key, int kind, EObject elt, ResourceSet
> allResource) {
> setInitializing(true);
> if (editingPart != null && key == partKey) {
> editingPart.setContext(elt, allResource);
> final Class class_ = (Class)elt;
>
> The problem highlighted by eclipse is that: I Cannot cast from EObject
> to Class
> So I try to do that: final EObject class_=(EObject)elt;
> But then I have many other mistake that appears (they can be corrected
> easily). So I was wondering if it is the right thing to do.
>
>

First, I think that this issue is due to a bad import organized. I think
your metamodel has a concept named "Class" and during imports
organization, you java.lang.Class has been added to the imports list
instead of your.metamodel.Class.


> Plus, I have an other error in the EEF generated code,
> In the package RealTimeProperties.RtpMeasurementUnits.providers, I have:
>
> import
> RealTimeProperties.RtpMeasurementUnits.util.RtpMeasurementUnitsAdapterFactory;
>
>
> public class RtpMeasurementUnitsEEFAdapterFactory extends
> RtpMeasurementUnitsAdapterFactory {
> }
>
> Here the code generation of EMF doesn't create the
> RealTimeProperties.RtpMeasurementUnits.util and EEF is trying to use it
> so the class RtpMeasurementUnitsAdapterFactory doesn't exist. (In my
> ecore model, the RtpMeasurementUnits are composed of enumeration types
> only).
>

I think there is a good reason why EMF doesn't generate an
AdapterFactory for the RtpMeasurementUnits package of your model but I
can't figure why? Can you give more information about this package ?

>
> And when I try to launch with correcting the first error and with
> deleting my RealTimleProperties.RtpMeasurementUnits.providers and the
> .parts also. I can create my global model and his child (with obeo
> designer), but when I use one of his child,I have an error like:
> "An error has occurred. See error log for more details.
> The string resource '_UI_EPackage_eSubpackages_feature' could not be
> located"
>

This issue is due to an ResourceLocator error ... Once again I haven't
got enough clue to fix it. What about your MetamodelEditPlugin class ?
Do you have a link to the Ecore edit plugin ?

--
Goulwen

> Any help would be great.
>
> Thanks,
> Aurélien.
>
Re: [EEF] Errors in the generated code. [message #908044 is a reply to message #907166] Tue, 04 September 2012 15:41 Go to previous messageGo to next message
aurelien didier is currently offline aurelien didierFriend
Messages: 11
Registered: June 2012
Junior Member
Hi Goulwen,

Thank you for your answer, at the first question, I'll try to correct that.

For the second one, EMF doesn't generate the ***.util because in the ecore model, this package is only composed of enumeration types, as you can see in my attachment.

index.php/fa/11379/0/

If I want to use EEF, do I have to change my model, by defining my enumeration type apart, and to define attributes which are instance of one of my enumeration type. Or is it posible to keep my ecore model as it is now.

And for the third error, I think that it was link to one of the other error, but in fact, I'm not working alone on that project, and this error is not due to my work, but to something uncomplete. Sorry.

Thanks,

Aurélien.


Re: [EEF] Errors in the generated code. [message #908543 is a reply to message #908044] Wed, 05 September 2012 14:49 Go to previous messageGo to next message
aurelien didier is currently offline aurelien didierFriend
Messages: 11
Registered: June 2012
Junior Member
Hi Goulwen,

I have done a simple example in order to show you the problem.
I hope it will help you to understand why EEF doesn't work well in that case .

Thanks,

Aurélien

  • Attachment: persons.zip
    (Size: 270.38KB, Downloaded 264 times)
Re: [EEF] Errors in the generated code. [message #908959 is a reply to message #908543] Thu, 06 September 2012 09:55 Go to previous messageGo to next message
aurelien didier is currently offline aurelien didierFriend
Messages: 11
Registered: June 2012
Junior Member
index.php/fa/11402/0/Hi everybody,

While I was working with this example, I have seen that I just have to modify the ***.eefgen file, which concern the package which contain enumeration. For example in the previous model:

index.php/fa/11402/0/

Thanks for your answer Goulwen.
Re: [EEF] Errors in the generated code. [message #909020 is a reply to message #908959] Thu, 06 September 2012 12:33 Go to previous message
aurelien didier is currently offline aurelien didierFriend
Messages: 11
Registered: June 2012
Junior Member
Sorry for the last unclear message,

In fact, I have deleted the two highlighted file on the previous picture, so the problematic code is'nt generated anymore and everything is fine with it.

Thanks,

Aurélien
Previous Topic:Generating model source with maven and emf.ecore2java
Next Topic:[Texo] Programmatically generate POJOs in a standalone project
Goto Forum:
  


Current Time: Thu Apr 18 11:58:18 GMT 2024

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

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

Back to the top