Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two
[Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #639820] Wed, 17 November 2010 23:03 Go to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
I just refactored my meta-model by splitting it into two separate ecore files, one for application-specific components and one for platform-specific components.

I loaded the resources from the application-specific meta-model into the platform-specific meta-model, created a single genmodel that contains both meta-models, and successfully generated the model editor plugin and started the new Eclipse. In my existing mtl file templates, I added the module imports to the top line of the mtl files to successfully wire the new dependencies.

However, one last problem remains that is stumping me. I recreated a new clean main.mtl and Main.java files.

Inside Main.java, there is a method called registerPackages. In the method, there are a bunch of calls to:
resourceSet.getPackageRegistry().put(packagepath...)


They are all unresolved. Is there something obvious I'm missing?

Thanks for any help!

[Updated on: Wed, 17 November 2010 23:50]

Report message to a moderator

Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #639826 is a reply to message #639820] Wed, 17 November 2010 23:59 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
I realized my description was a little vague. Specifically, it's the "packagexyz" top-level package that's causing the "packagexyz cannot be resolved" error.

resourceSet.getPackageRegistry().put(packagexyz.path.eINSTANCE.getNsURI(), android.AndroidPackage.eINSTANCE);


Thanks for any help!
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #639868 is a reply to message #639826] Thu, 18 November 2010 08:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040005050906040707080200
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jeff,

I'd say you're missing the required dependencies for these packages to
be resolved. If these packages are necessary (and I believe they are),
you'll have to open the META-INF/MANIFEST.MF file of your plugin and, on
the "dependencies" tab (at the bottom of the editor), you'll have to
"Add" dependencies towards the required plugins.

Laurent Goubet
Obeo

On 18/11/2010 00:59, glenviewjeff wrote:
> I realized my description was a little vague. Specifically, it's the
> "packagexyz" top-level package that's causing the "packagexyz cannot be
> resolved" error.
>
> resourceSet.getPackageRegistry().put(packagexyz.path.eINSTAN CE.getNsURI(),
> android.AndroidPackage.eINSTANCE);
>
>
> Thanks for any help!


--------------040005050906040707080200
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040005050906040707080200--
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #640056 is a reply to message #639868] Thu, 18 November 2010 20:40 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Hi Laurent:

I'm not sure if there's really a problem with the manifest file dependencies. I made some new changes to the meta-models and the problem returned again.

Recall that I have two meta-models, where the application meta-model is dependent upon the platform-specific meta-model. I had created a genmodel file that contains both meta-models.

Some further information about the problem: I browsed through the plug-in dependencies in the project containing the main.mtl file. I found something strange in the bin folder which corresponds to the meta-model project from the parent Eclipse session.

Inside that bin folder, the packages are absent that correspond to the errored lines Main.java.

What could prevent those packages from not being generated?

One additional piece of information: I had created a new meta-model empty EMF project and copied the meta-models over to the fresh project, and this did fix a few of the missing packages, but not all of them.

Thanks as usual for any help!
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #640115 is a reply to message #640056] Fri, 19 November 2010 07:27 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030302050007060805040007
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jeff,

If the "bin" folder of one of your projects doesn't contain the "class"
files corresponding to your "java" sources, the most probable cause is
that you have disabled the automatic build of your Eclipse. "Project" >
"Automatic Build" must be ticked.

Laurent Goubet
Obeo

On 18/11/2010 21:40, glenviewjeff wrote:
> Hi Laurent:
>
> I'm not sure if there's really a problem with the manifest file
> dependencies. I made some new changes to the meta-models and the problem
> returned again.
> Recall that I have two meta-models, where the application meta-model is
> dependent upon the platform-specific meta-model. I had created a
> genmodel file that contains both meta-models.
> Some further information about the problem: I browsed through the
> plug-in dependencies in the project containing the main.mtl file. I
> found something strange in the bin folder which corresponds to the
> meta-model project from the parent Eclipse session.
> Inside that bin folder, the packages are absent that correspond to the
> errored lines Main.java.
>
> What could prevent those packages from not being generated?
> One additional piece of information: I had created a new meta-model
> empty EMF project and copied the meta-models over to the fresh project,
> and this did fix a few of the missing packages, but not all of them.
> Thanks as usual for any help!
>


--------------030302050007060805040007
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030302050007060805040007--
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #640230 is a reply to message #640115] Fri, 19 November 2010 17:09 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Hi Laurent:

Thanks for the quick response, but the auto build is already checked. I think part of the problem may have stemmed from not defining the base package in the EMF genmodel.

However, while all of the packages appear present in the bin folder, I'm still getting [name] cannot be resolved errors in Main.java (even when re-generating a new main.mtl file.)

I'm not sure if this is relevant, but the Main.java package registration method looks like this:
resourceSet.getPackageRegistry().put(com.default.package.xyz.abc.eINSTANCE.getNsURI(), com.zoomabug.flashcards.android.AndroidPackage.eINSTANCE);


but in the bin directory, the packages are arranged like this:

bin
   xyz
       abc


Thanks again for your help!
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #640255 is a reply to message #640230] Fri, 19 November 2010 18:44 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
I found something that will likely indicate the problem, I just don't know how to fix it. I bet it stems from my ignorance of Eclipse/plugin development.

In my project that contains the genmodel, I opened up the filesystem to look at the bin directory. I noticed that it contains a structure like this: bin\com\xyz\package123.

However, the project in the child Eclipse that contains the installed model editor shows in its bin directory a different structure as I said in my previously posted message. (bin\package123)

Also, I noticed that if I double click on one of the class files in the child Eclipse, Eclipse reports that it can't find the file.

This is probably the wrong forum to be asking this question, but how does the plug-in dependency get updated in the Child Eclipse?

Thanks for your help!
Jeff
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #640454 is a reply to message #640255] Mon, 22 November 2010 08:12 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030607070700010808010908
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jeff,

I must admit I'm quite confused right now.

Could you briefly describe which projects you have in which Eclipse
workspace? If you followed one of the EMF tutorials I can think of when
defining your metamodel (the project that contains your genmodel), you
should have something resembling this :

"main" Eclipse, the first you launch :
com.xyz
|- src
| |- com
| |- xyz
| |- XYZPackage
| |- ...
|- model
|- xyz.ecore
|- xyz.genmodel

com.xyz.edit
|- ...

com.xyz.editor
|- ...

Then, in the "runtime" Eclipse, the one you launch from the "main", you
should have all of the projects that depend on the "xyz" model,
including your Acceleo project.

You shouldn't have _twice_ your metamodel project (containing your
"XYZPackage"), it should only exist in the "main" Eclipse workspace.

Laurent Goubet
Obeo

On 19/11/2010 19:44, glenviewjeff wrote:
> I found something that will likely indicate the problem, I just don't
> know how to fix it. I bet it stems from my ignorance of Eclipse/plugin
> development.
> In my project that contains the genmodel, I opened up the filesystem to
> look at the bin directory. I noticed that it contains a structure like
> this: bin\com\xyz\package123.
> However, the project in the child Eclipse that contains the installed
> model editor shows in its bin directory a different structure as I said
> in my previously posted message. (bin\package123)
>
> Also, I noticed that if I double click on one of the class files in the
> child Eclipse, Eclipse reports that it can't find the file.
> This is probably the wrong forum to be asking this question, but how
> does the plug-in dependency get updated in the Child Eclipse?
> Thanks for your help!
> Jeff


--------------030607070700010808010908
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030607070700010808010908--
Re: [Acceleo/EMF] Problem in Main.java after refactoring one meta-model into two [message #641271 is a reply to message #640454] Wed, 24 November 2010 17:19 Go to previous message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
I was able eventually to fix this, but unfortunately I'm not sure how I fixed it. I am guessing that by messing with the manifest file in one or both projects (the original meta-model project, or the child eclipse model project,) I somehow broke the dependencies. If this happens again, I'll try to let you know.

Thanks,
Jeff
Previous Topic:import class java
Next Topic:Max / Min Operation?
Goto Forum:
  


Current Time: Fri Dec 27 00:47:14 GMT 2024

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

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

Back to the top