Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF generated projects don't compile
EMF generated projects don't compile [message #660333] Thu, 17 March 2011 23:35 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I have a, say, "example" project that contains a .genmodel file that validates without errors nor warnings.
When I select the topmost element and select "Generate All" I get an "example.edit" project that compiles fine plus a
"example.editor" project that has >200 errors and doesn't compile, apparently mostly due to one or more missing imports of
org.eclipse.swt.X (where X is "SWT", "event", "layout" and "widgets"). How do I convince EMF to generate projects that *do* compile?

This is on Helios v3.6.2 (Build id: M20110210-1200) on top of Windows 7.

Michael
Re: EMF generated projects don't compile [message #660344 is a reply to message #660333] Fri, 18 March 2011 02:56 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Michael,

EMF didn't change in 3.6.2. I've not heard of anyone else having this
problem. It seems like a glaring issue, not a subtle one, so I'd expect
all to notice it immediately. Unless of course it's specific to your
setup...

Are you saying the imports are absent from the .java files? Or they're
there, but they don't resolve because the dependency on org.eclipse.swt
is not properly resolved?


Michael Moser wrote:
> I have a, say, "example" project that contains a .genmodel file that validates without errors nor warnings.
> When I select the topmost element and select "Generate All" I get an "example.edit" project that compiles fine plus a
> "example.editor" project that has >200 errors and doesn't compile, apparently mostly due to one or more missing imports of
> org.eclipse.swt.X (where X is "SWT", "event", "layout" and "widgets"). How do I convince EMF to generate projects that *do* compile?
>
> This is on Helios v3.6.2 (Build id: M20110210-1200) on top of Windows 7.
>
> Michael
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF generated projects don't compile [message #660365 is a reply to message #660344] Fri, 18 March 2011 06:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Michael

EMF has incremental merged generation for Java files but leaves a
pre-existing MANIFEST.MF unchanged.

Is it possible that an early generation attempt or manual intervention
created an inadequate MANIFEST.MF?

I suggest that you delete your editor project so that EMF can generate
afresh.

Regards

Ed Willink

On 18/03/2011 02:56, Ed Merks wrote:
> Michael,
>
> EMF didn't change in 3.6.2. I've not heard of anyone else having
> this problem. It seems like a glaring issue, not a subtle one, so I'd
> expect all to notice it immediately. Unless of course it's specific
> to your setup...
>
> Are you saying the imports are absent from the .java files? Or
> they're there, but they don't resolve because the dependency on
> org.eclipse.swt is not properly resolved?
>
>
> Michael Moser wrote:
>> I have a, say, "example" project that contains a .genmodel file that
>> validates without errors nor warnings.
>> When I select the topmost element and select "Generate All" I get an
>> "example.edit" project that compiles fine plus a
>> "example.editor" project that has >200 errors and doesn't compile,
>> apparently mostly due to one or more missing imports of
>> org.eclipse.swt.X (where X is "SWT", "event", "layout" and
>> "widgets"). How do I convince EMF to generate projects that *do*
>> compile?
>>
>> This is on Helios v3.6.2 (Build id: M20110210-1200) on top of Windows 7.
>>
>> Michael
>>
Re: Re: EMF generated projects don't compile [message #660433 is a reply to message #660344] Fri, 18 March 2011 12:09 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
On Thu, 17 Mar 2011 19:56:44 -0700, Ed Merks <Ed.Merks@gmail.com> wrote:

>Michael,
>
>EMF didn't change in 3.6.2. I've not heard of anyone else having this
>problem. It seems like a glaring issue, not a subtle one, so I'd expect
>all to notice it immediately. Unless of course it's specific to your
>setup...
>
>Are you saying the imports are absent from the .java files? Or they're
>there, but they don't resolve because the dependency on org.eclipse.swt
>is not properly resolved?
>

The latter, i.e. already those imports don't resolve.

Michael
Re: Re: EMF generated projects don't compile [message #660434 is a reply to message #660344] Fri, 18 March 2011 12:30 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
eOn Thu, 17 Mar 2011 19:56:44 -0700, Ed Merks <Ed.Merks@gmail.com> wrote:

>Michael,
>
>EMF didn't change in 3.6.2. I've not heard of anyone else having this
>problem. It seems like a glaring issue, not a subtle one, so I'd expect
>all to notice it immediately. Unless of course it's specific to your
>setup...
>
>Are you saying the imports are absent from the .java files? Or they're
>there, but they don't resolve because the dependency on org.eclipse.swt

I deleted the MANIFEST as well as the generated model code, i.e. I restarted from a clean slate and empty project just keeping the
..ecore and the .genmodel file and then issued a "Generate All".

The result is
the src tree in the example project - compiles
example.edit project - compiles
example.editor project - does not compile - see below
example.test project - compiles

The example.editor project contains four files

package example.presentation:
ExampeModelActionBarContributor
ExampleModelEditor
WebPullModelEditorPlugin
WebPullModelModelWizard

Except for the ...Plugin file all other files show compile errors and have issue with their import statements
import org.eclipse.swt.<X>;

and of course there are errors in all lines that reference any SWT class or item.

The top line of those files also has a marker that reads e.g.:

Multiple markers at this line
- The type org.eclipse.swt.widgets.Tree cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.events.ControlAdapter cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.widgets.Table cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.widgets.Menu cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.dnd.DragSourceListener cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.widgets.List cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.dnd.DropTargetAdapter cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.custom.TreeEditor cannot be resolved. It is indirectly referenced from required .class
files
- The type org.eclipse.swt.dnd.DropTargetListener cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.dnd.ByteArrayTransfer cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.dnd.Transfer cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.graphics.Point cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.custom.CTabFolder cannot be resolved. It is indirectly referenced from required .class
files

What the heck am I missing?

Michael
Re: EMF generated projects don't compile [message #660450 is a reply to message #660434] Fri, 18 March 2011 13:30 Go to previous message
Ed Merks is currently online Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000206050509060609090807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Michael,

Perhaps SWT isn't in your target platform? It is possible to add SWT as
a direct dependency in your manifest? You shouldn't need it because the
EMF's bundles re-export it, but it will be a good test to try.


Michael Moser wrote:
> eOn Thu, 17 Mar 2011 19:56:44 -0700, Ed Merks <Ed.Merks@gmail.com> wrote:
>
>
>> Michael,
>>
>> EMF didn't change in 3.6.2. I've not heard of anyone else having this
>> problem. It seems like a glaring issue, not a subtle one, so I'd expect
>> all to notice it immediately. Unless of course it's specific to your
>> setup...
>>
>> Are you saying the imports are absent from the .java files? Or they're
>> there, but they don't resolve because the dependency on org.eclipse.swt
>>
>
> I deleted the MANIFEST as well as the generated model code, i.e. I restarted from a clean slate and empty project just keeping the
> .ecore and the .genmodel file and then issued a "Generate All".
>
> The result is
> the src tree in the example project - compiles
> example.edit project - compiles
> example.editor project - does not compile - see below
> example.test project - compiles
>
> The example.editor project contains four files
>
> package example.presentation:
> ExampeModelActionBarContributor
> ExampleModelEditor
> WebPullModelEditorPlugin
> WebPullModelModelWizard
>
> Except for the ...Plugin file all other files show compile errors and have issue with their import statements
> import org.eclipse.swt.<X>;
>
> and of course there are errors in all lines that reference any SWT class or item.
>
> The top line of those files also has a marker that reads e.g.:
>
> Multiple markers at this line
> - The type org.eclipse.swt.widgets.Tree cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.events.ControlAdapter cannot be resolved. It is indirectly referenced from
> required .class files
> - The type org.eclipse.swt.widgets.Table cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.widgets.Menu cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.dnd.DragSourceListener cannot be resolved. It is indirectly referenced from
> required .class files
> - The type org.eclipse.swt.widgets.List cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.dnd.DropTargetAdapter cannot be resolved. It is indirectly referenced from
> required .class files
> - The type org.eclipse.swt.custom.TreeEditor cannot be resolved. It is indirectly referenced from required .class
> files
> - The type org.eclipse.swt.dnd.DropTargetListener cannot be resolved. It is indirectly referenced from
> required .class files
> - The type org.eclipse.swt.dnd.ByteArrayTransfer cannot be resolved. It is indirectly referenced from
> required .class files
> - The type org.eclipse.swt.dnd.Transfer cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.graphics.Point cannot be resolved. It is indirectly referenced from required .class files
> - The type org.eclipse.swt.custom.CTabFolder cannot be resolved. It is indirectly referenced from required .class
> files
>
> What the heck am I missing?
>
> Michael
>

--------------000206050509060609090807
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Michael,<br>
<br>
Perhaps SWT isn't in your target platform?&nbsp; It is possible to add SWT
as a direct dependency in your manifest? You shouldn't need it because
the EMF's bundles re-export it, but it will be a good test to try.<br>
<br>
<br>
Michael Moser wrote:
<blockquote cite="mid:lri6o6t9u0ecsdb4vs04d9mqni3qvsq8pt@4ax.com"
type="cite">
<pre wrap="">eOn Thu, 17 Mar 2011 19:56:44 -0700, Ed Merks <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Michael,

EMF didn't change in 3.6.2. I've not heard of anyone else having this
problem. It seems like a glaring issue, not a subtle one, so I'd expect
all to notice it immediately. Unless of course it's specific to your
setup...

Are you saying the imports are absent from the .java files? Or they're
there, but they don't resolve because the dependency on org.eclipse.swt
</pre>
</blockquote>
<pre wrap=""><!---->
I deleted the MANIFEST as well as the generated model code, i.e. I restarted from a clean slate and empty project just keeping the
..ecore and the .genmodel file and then issued a "Generate All".

The result is
the src tree in the example project - compiles
example.edit project - compiles
example.editor project - does not compile - see below
example.test project - compiles

The example.editor project contains four files

package example.presentation:
ExampeModelActionBarContributor
ExampleModelEditor
WebPullModelEditorPlugin
WebPullModelModelWizard

Except for the ...Plugin file all other files show compile errors and have issue with their import statements
import org.eclipse.swt.&lt;X&gt;;

and of course there are errors in all lines that reference any SWT class or item.

The top line of those files also has a marker that reads e.g.:

Multiple markers at this line
- The type org.eclipse.swt.widgets.Tree cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.events.ControlAdapter cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.widgets.Table cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.widgets.Menu cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.dnd.DragSourceListener cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.widgets.List cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.dnd.DropTargetAdapter cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.custom.TreeEditor cannot be resolved. It is indirectly referenced from required .class
files
- The type org.eclipse.swt.dnd.DropTargetListener cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.dnd.ByteArrayTransfer cannot be resolved. It is indirectly referenced from
required .class files
- The type org.eclipse.swt.dnd.Transfer cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.graphics.Point cannot be resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.custom.CTabFolder cannot be resolved. It is indirectly referenced from required .class
files

What the heck am I missing?

Michael
</pre>
</blockquote>
</body>
</html>

--------------000206050509060609090807--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Is it safe to call copyReferences() more than once on the same instance of EcoreUtil.Copier?
Next Topic:Standalone EMF validation not registering constraints
Goto Forum:
  


Current Time: Tue Apr 23 08:26:25 GMT 2024

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

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

Back to the top