Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » problems with the validation tutorial
problems with the validation tutorial [message #412671] Fri, 31 August 2007 18:23 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I started reading "Tutorial: EMF Validation General" from the eclipse
EMF Validation Framework.

I downloaded the extlibrary example from the CVS and then I did
new->example->EMF Validation FrameworkPlugin->General Validation Example
(since I assume this is the one referred to by the tutorial, even though
the constraint is slightly different).

Then I did "Run as Eclipse application" (by firstly specifying only the
plugins of the workspace and all the required plugins) and I created an
..extlibrary file, and added a Library with no name; Now in the context
menu I have the "Validation" menu with all the submenus added by the
plugin "General Validation Example" but the validation always succeeds
(while it should not); moreover, if I try "Enable Live Validation" I get
a message box "The chosen operation is not enabled".

What am I doing wrong?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412673 is a reply to message #412671] Fri, 31 August 2007 19:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Lorenzo,

Christian's on vacation, and I'm not sure how to answer your question. :-(

The final message sounds like some plugin is failing to load properly.
Have a look at the Error Log view for clues about that.


Lorenzo Bettini wrote:
> Hi
>
> I started reading "Tutorial: EMF Validation General" from the eclipse
> EMF Validation Framework.
>
> I downloaded the extlibrary example from the CVS and then I did
> new->example->EMF Validation FrameworkPlugin->General Validation
> Example (since I assume this is the one referred to by the tutorial,
> even though the constraint is slightly different).
>
> Then I did "Run as Eclipse application" (by firstly specifying only
> the plugins of the workspace and all the required plugins) and I
> created an ..extlibrary file, and added a Library with no name; Now in
> the context menu I have the "Validation" menu with all the submenus
> added by the plugin "General Validation Example" but the validation
> always succeeds (while it should not); moreover, if I try "Enable Live
> Validation" I get a message box "The chosen operation is not enabled".
>
> What am I doing wrong?
>
> thanks in advance
> Lorenzo
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problems with the validation tutorial [message #412676 is a reply to message #412673] Sat, 01 September 2007 08:01 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I will check the log; however, I noticed that if I remove the CVS
sources of the extlibrary example and rely on the extlibrary plugin
(that is already installed among my plugins) everything seems to work fine.

When I was trying the validation with the cvs sources of the extlibrary,
I was running the configuration where I had excluded the extlibrary
plugin (so that I was sure I was using the extlibrary from the sources),
but probably the validation example relies on the extlibrary plugin and
wasn't using the extlibrary sources?

thanks
Lorenzo

Ed Merks wrote:
> Lorenzo,
>
> Christian's on vacation, and I'm not sure how to answer your question. :-(
>
> The final message sounds like some plugin is failing to load properly.
> Have a look at the Error Log view for clues about that.
>
>
> Lorenzo Bettini wrote:
>> Hi
>>
>> I started reading "Tutorial: EMF Validation General" from the eclipse
>> EMF Validation Framework.
>>
>> I downloaded the extlibrary example from the CVS and then I did
>> new->example->EMF Validation FrameworkPlugin->General Validation
>> Example (since I assume this is the one referred to by the tutorial,
>> even though the constraint is slightly different).
>>
>> Then I did "Run as Eclipse application" (by firstly specifying only
>> the plugins of the workspace and all the required plugins) and I
>> created an ..extlibrary file, and added a Library with no name; Now in
>> the context menu I have the "Validation" menu with all the submenus
>> added by the plugin "General Validation Example" but the validation
>> always succeeds (while it should not); moreover, if I try "Enable Live
>> Validation" I get a message box "The chosen operation is not enabled".
>>
>> What am I doing wrong?
>>
>> thanks in advance
>> Lorenzo
>>


--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412677 is a reply to message #412676] Sat, 01 September 2007 09:46 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi again

I did some experiments; the problem appeared when I was using a minimal
workbench run configuration to test the validation example: I was
including only the extlibrary sources, the validatione example, and of
course the requested plugins by using the "Add Required Plugins" button.

This was not including the plugin
org.eclipse.emf.validation.examples.adapter

If I include also this plugin the validation actually works!

However, I don't understand why this is requested by the general
example... and if it's requested, why is it not added to the required
plugins?

Lorenzo

Lorenzo Bettini wrote:
> Hi
>
> I will check the log; however, I noticed that if I remove the CVS
> sources of the extlibrary example and rely on the extlibrary plugin
> (that is already installed among my plugins) everything seems to work fine.
>
> When I was trying the validation with the cvs sources of the extlibrary,
> I was running the configuration where I had excluded the extlibrary
> plugin (so that I was sure I was using the extlibrary from the sources),
> but probably the validation example relies on the extlibrary plugin and
> wasn't using the extlibrary sources?
>
> thanks
> Lorenzo
>
> Ed Merks wrote:
>> Lorenzo,
>>
>> Christian's on vacation, and I'm not sure how to answer your
>> question. :-(
>>
>> The final message sounds like some plugin is failing to load
>> properly. Have a look at the Error Log view for clues about that.
>>
>>
>> Lorenzo Bettini wrote:
>>> Hi
>>>
>>> I started reading "Tutorial: EMF Validation General" from the eclipse
>>> EMF Validation Framework.
>>>
>>> I downloaded the extlibrary example from the CVS and then I did
>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>> Example (since I assume this is the one referred to by the tutorial,
>>> even though the constraint is slightly different).
>>>
>>> Then I did "Run as Eclipse application" (by firstly specifying only
>>> the plugins of the workspace and all the required plugins) and I
>>> created an ..extlibrary file, and added a Library with no name; Now
>>> in the context menu I have the "Validation" menu with all the
>>> submenus added by the plugin "General Validation Example" but the
>>> validation always succeeds (while it should not); moreover, if I try
>>> "Enable Live Validation" I get a message box "The chosen operation is
>>> not enabled".
>>>
>>> What am I doing wrong?
>>>
>>> thanks in advance
>>> Lorenzo
>>>
>
>


--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412678 is a reply to message #412677] Sat, 01 September 2007 15:17 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
I tried to track down a problem a little bit and it looks like no client
context is present in ClientContextManager, and thus the
NotEmptyNamesConstraint is never bound to the library model...

Lorenzo Bettini wrote:
> Hi again
>
> I did some experiments; the problem appeared when I was using a minimal
> workbench run configuration to test the validation example: I was
> including only the extlibrary sources, the validatione example, and of
> course the requested plugins by using the "Add Required Plugins" button.
>
> This was not including the plugin
> org.eclipse.emf.validation.examples.adapter
>
> If I include also this plugin the validation actually works!
>
> However, I don't understand why this is requested by the general
> example... and if it's requested, why is it not added to the required
> plugins?
>
> Lorenzo
>
> Lorenzo Bettini wrote:
>> Hi
>>
>> I will check the log; however, I noticed that if I remove the CVS
>> sources of the extlibrary example and rely on the extlibrary plugin
>> (that is already installed among my plugins) everything seems to work
>> fine.
>>
>> When I was trying the validation with the cvs sources of the
>> extlibrary, I was running the configuration where I had excluded the
>> extlibrary plugin (so that I was sure I was using the extlibrary from
>> the sources), but probably the validation example relies on the
>> extlibrary plugin and wasn't using the extlibrary sources?
>>
>> thanks
>> Lorenzo
>>
>> Ed Merks wrote:
>>> Lorenzo,
>>>
>>> Christian's on vacation, and I'm not sure how to answer your
>>> question. :-(
>>>
>>> The final message sounds like some plugin is failing to load
>>> properly. Have a look at the Error Log view for clues about that.
>>>
>>>
>>> Lorenzo Bettini wrote:
>>>> Hi
>>>>
>>>> I started reading "Tutorial: EMF Validation General" from the
>>>> eclipse EMF Validation Framework.
>>>>
>>>> I downloaded the extlibrary example from the CVS and then I did
>>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>>> Example (since I assume this is the one referred to by the tutorial,
>>>> even though the constraint is slightly different).
>>>>
>>>> Then I did "Run as Eclipse application" (by firstly specifying only
>>>> the plugins of the workspace and all the required plugins) and I
>>>> created an ..extlibrary file, and added a Library with no name; Now
>>>> in the context menu I have the "Validation" menu with all the
>>>> submenus added by the plugin "General Validation Example" but the
>>>> validation always succeeds (while it should not); moreover, if I try
>>>> "Enable Live Validation" I get a message box "The chosen operation
>>>> is not enabled".
>>>>
>>>> What am I doing wrong?
>>>>
>>>> thanks in advance
>>>> Lorenzo
>>>>
>>
>>
>
>


--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412698 is a reply to message #412678] Mon, 03 September 2007 12:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Lorenzo,

I don't know the details of this particular issue, but it's often the
case that a plugin will contribute to an extension point and that the
base plugin defining and using that extension point will not function
unless there is at least one contribution to its extension point. The
platform's help systems is that way too. I.e., unless something
registers a way (an embedded web browser) to display help, the base help
engine won't actually be able to display help at all.


Lorenzo Bettini wrote:
> I tried to track down a problem a little bit and it looks like no
> client context is present in ClientContextManager, and thus the
> NotEmptyNamesConstraint is never bound to the library model...
>
> Lorenzo Bettini wrote:
>> Hi again
>>
>> I did some experiments; the problem appeared when I was using a
>> minimal workbench run configuration to test the validation example: I
>> was including only the extlibrary sources, the validatione example,
>> and of course the requested plugins by using the "Add Required
>> Plugins" button.
>>
>> This was not including the plugin
>> org.eclipse.emf.validation.examples.adapter
>>
>> If I include also this plugin the validation actually works!
>>
>> However, I don't understand why this is requested by the general
>> example... and if it's requested, why is it not added to the
>> required plugins?
>>
>> Lorenzo
>>
>> Lorenzo Bettini wrote:
>>> Hi
>>>
>>> I will check the log; however, I noticed that if I remove the CVS
>>> sources of the extlibrary example and rely on the extlibrary plugin
>>> (that is already installed among my plugins) everything seems to
>>> work fine.
>>>
>>> When I was trying the validation with the cvs sources of the
>>> extlibrary, I was running the configuration where I had excluded the
>>> extlibrary plugin (so that I was sure I was using the extlibrary
>>> from the sources), but probably the validation example relies on the
>>> extlibrary plugin and wasn't using the extlibrary sources?
>>>
>>> thanks
>>> Lorenzo
>>>
>>> Ed Merks wrote:
>>>> Lorenzo,
>>>>
>>>> Christian's on vacation, and I'm not sure how to answer your
>>>> question. :-(
>>>>
>>>> The final message sounds like some plugin is failing to load
>>>> properly. Have a look at the Error Log view for clues about that.
>>>>
>>>>
>>>> Lorenzo Bettini wrote:
>>>>> Hi
>>>>>
>>>>> I started reading "Tutorial: EMF Validation General" from the
>>>>> eclipse EMF Validation Framework.
>>>>>
>>>>> I downloaded the extlibrary example from the CVS and then I did
>>>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>>>> Example (since I assume this is the one referred to by the
>>>>> tutorial, even though the constraint is slightly different).
>>>>>
>>>>> Then I did "Run as Eclipse application" (by firstly specifying
>>>>> only the plugins of the workspace and all the required plugins)
>>>>> and I created an ..extlibrary file, and added a Library with no
>>>>> name; Now in the context menu I have the "Validation" menu with
>>>>> all the submenus added by the plugin "General Validation Example"
>>>>> but the validation always succeeds (while it should not);
>>>>> moreover, if I try "Enable Live Validation" I get a message box
>>>>> "The chosen operation is not enabled".
>>>>>
>>>>> What am I doing wrong?
>>>>>
>>>>> thanks in advance
>>>>> Lorenzo
>>>>>
>>>
>>>
>>
>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problems with the validation tutorial [message #412704 is a reply to message #412698] Mon, 03 September 2007 16:17 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi Ed

actually I've used the validation example plugin that comes with the
validation examples, so it should work I suppose (the plugin is loaded,
but the constraints are not, so I guess there's a bug there)

Lorenzo

Ed Merks wrote:
> Lorenzo,
>
> I don't know the details of this particular issue, but it's often the
> case that a plugin will contribute to an extension point and that the
> base plugin defining and using that extension point will not function
> unless there is at least one contribution to its extension point. The
> platform's help systems is that way too. I.e., unless something
> registers a way (an embedded web browser) to display help, the base help
> engine won't actually be able to display help at all.
>
>
> Lorenzo Bettini wrote:
>> I tried to track down a problem a little bit and it looks like no
>> client context is present in ClientContextManager, and thus the
>> NotEmptyNamesConstraint is never bound to the library model...
>>
>> Lorenzo Bettini wrote:
>>> Hi again
>>>
>>> I did some experiments; the problem appeared when I was using a
>>> minimal workbench run configuration to test the validation example: I
>>> was including only the extlibrary sources, the validatione example,
>>> and of course the requested plugins by using the "Add Required
>>> Plugins" button.
>>>
>>> This was not including the plugin
>>> org.eclipse.emf.validation.examples.adapter
>>>
>>> If I include also this plugin the validation actually works!
>>>
>>> However, I don't understand why this is requested by the general
>>> example... and if it's requested, why is it not added to the
>>> required plugins?
>>>
>>> Lorenzo
>>>
>>> Lorenzo Bettini wrote:
>>>> Hi
>>>>
>>>> I will check the log; however, I noticed that if I remove the CVS
>>>> sources of the extlibrary example and rely on the extlibrary plugin
>>>> (that is already installed among my plugins) everything seems to
>>>> work fine.
>>>>
>>>> When I was trying the validation with the cvs sources of the
>>>> extlibrary, I was running the configuration where I had excluded the
>>>> extlibrary plugin (so that I was sure I was using the extlibrary
>>>> from the sources), but probably the validation example relies on the
>>>> extlibrary plugin and wasn't using the extlibrary sources?
>>>>
>>>> thanks
>>>> Lorenzo
>>>>
>>>> Ed Merks wrote:
>>>>> Lorenzo,
>>>>>
>>>>> Christian's on vacation, and I'm not sure how to answer your
>>>>> question. :-(
>>>>>
>>>>> The final message sounds like some plugin is failing to load
>>>>> properly. Have a look at the Error Log view for clues about that.
>>>>>
>>>>>
>>>>> Lorenzo Bettini wrote:
>>>>>> Hi
>>>>>>
>>>>>> I started reading "Tutorial: EMF Validation General" from the
>>>>>> eclipse EMF Validation Framework.
>>>>>>
>>>>>> I downloaded the extlibrary example from the CVS and then I did
>>>>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>>>>> Example (since I assume this is the one referred to by the
>>>>>> tutorial, even though the constraint is slightly different).
>>>>>>
>>>>>> Then I did "Run as Eclipse application" (by firstly specifying
>>>>>> only the plugins of the workspace and all the required plugins)
>>>>>> and I created an ..extlibrary file, and added a Library with no
>>>>>> name; Now in the context menu I have the "Validation" menu with
>>>>>> all the submenus added by the plugin "General Validation Example"
>>>>>> but the validation always succeeds (while it should not);
>>>>>> moreover, if I try "Enable Live Validation" I get a message box
>>>>>> "The chosen operation is not enabled".
>>>>>>
>>>>>> What am I doing wrong?
>>>>>>
>>>>>> thanks in advance
>>>>>> Lorenzo
>>>>>>
>>>>
>>>>
>>>
>>>
>>
>>


--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412706 is a reply to message #412704] Mon, 03 September 2007 18:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Lorenzo,

I suppose there might be. Christian will know better when he's back
from vacation on the 10th.


Lorenzo Bettini wrote:
> Hi Ed
>
> actually I've used the validation example plugin that comes with the
> validation examples, so it should work I suppose (the plugin is
> loaded, but the constraints are not, so I guess there's a bug there)
>
> Lorenzo
>
> Ed Merks wrote:
>> Lorenzo,
>>
>> I don't know the details of this particular issue, but it's often the
>> case that a plugin will contribute to an extension point and that the
>> base plugin defining and using that extension point will not function
>> unless there is at least one contribution to its extension point.
>> The platform's help systems is that way too. I.e., unless something
>> registers a way (an embedded web browser) to display help, the base
>> help engine won't actually be able to display help at all.
>>
>>
>> Lorenzo Bettini wrote:
>>> I tried to track down a problem a little bit and it looks like no
>>> client context is present in ClientContextManager, and thus the
>>> NotEmptyNamesConstraint is never bound to the library model...
>>>
>>> Lorenzo Bettini wrote:
>>>> Hi again
>>>>
>>>> I did some experiments; the problem appeared when I was using a
>>>> minimal workbench run configuration to test the validation example:
>>>> I was including only the extlibrary sources, the validatione
>>>> example, and of course the requested plugins by using the "Add
>>>> Required Plugins" button.
>>>>
>>>> This was not including the plugin
>>>> org.eclipse.emf.validation.examples.adapter
>>>>
>>>> If I include also this plugin the validation actually works!
>>>>
>>>> However, I don't understand why this is requested by the general
>>>> example... and if it's requested, why is it not added to the
>>>> required plugins?
>>>>
>>>> Lorenzo
>>>>
>>>> Lorenzo Bettini wrote:
>>>>> Hi
>>>>>
>>>>> I will check the log; however, I noticed that if I remove the CVS
>>>>> sources of the extlibrary example and rely on the extlibrary
>>>>> plugin (that is already installed among my plugins) everything
>>>>> seems to work fine.
>>>>>
>>>>> When I was trying the validation with the cvs sources of the
>>>>> extlibrary, I was running the configuration where I had excluded
>>>>> the extlibrary plugin (so that I was sure I was using the
>>>>> extlibrary from the sources), but probably the validation example
>>>>> relies on the extlibrary plugin and wasn't using the extlibrary
>>>>> sources?
>>>>>
>>>>> thanks
>>>>> Lorenzo
>>>>>
>>>>> Ed Merks wrote:
>>>>>> Lorenzo,
>>>>>>
>>>>>> Christian's on vacation, and I'm not sure how to answer your
>>>>>> question. :-(
>>>>>>
>>>>>> The final message sounds like some plugin is failing to load
>>>>>> properly. Have a look at the Error Log view for clues about that.
>>>>>>
>>>>>>
>>>>>> Lorenzo Bettini wrote:
>>>>>>> Hi
>>>>>>>
>>>>>>> I started reading "Tutorial: EMF Validation General" from the
>>>>>>> eclipse EMF Validation Framework.
>>>>>>>
>>>>>>> I downloaded the extlibrary example from the CVS and then I did
>>>>>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>>>>>> Example (since I assume this is the one referred to by the
>>>>>>> tutorial, even though the constraint is slightly different).
>>>>>>>
>>>>>>> Then I did "Run as Eclipse application" (by firstly specifying
>>>>>>> only the plugins of the workspace and all the required plugins)
>>>>>>> and I created an ..extlibrary file, and added a Library with no
>>>>>>> name; Now in the context menu I have the "Validation" menu with
>>>>>>> all the submenus added by the plugin "General Validation
>>>>>>> Example" but the validation always succeeds (while it should
>>>>>>> not); moreover, if I try "Enable Live Validation" I get a
>>>>>>> message box "The chosen operation is not enabled".
>>>>>>>
>>>>>>> What am I doing wrong?
>>>>>>>
>>>>>>> thanks in advance
>>>>>>> Lorenzo
>>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problems with the validation tutorial [message #412933 is a reply to message #412678] Wed, 12 September 2007 14:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Lorenzo,

Yes, unfortunately the example plug-ins have some interdependencies, esp. on
client context definitions, that they shouldn't. Installing all three
examples will usually work, of course, but we have a couple of bugzillae
tracking the need to clean these up.

Cheers,

Christian

Lorenzo Bettini wrote:

> I tried to track down a problem a little bit and it looks like no client
> context is present in ClientContextManager, and thus the
> NotEmptyNamesConstraint is never bound to the library model...
>
> Lorenzo Bettini wrote:
>> Hi again
>>
>> I did some experiments; the problem appeared when I was using a minimal
>> workbench run configuration to test the validation example: I was
>> including only the extlibrary sources, the validatione example, and of
>> course the requested plugins by using the "Add Required Plugins" button.
>>
>> This was not including the plugin
>> org.eclipse.emf.validation.examples.adapter
>>
>> If I include also this plugin the validation actually works!
>>
>> However, I don't understand why this is requested by the general
>> example... and if it's requested, why is it not added to the required
>> plugins?
>>
>> Lorenzo
>>
>> Lorenzo Bettini wrote:
>>> Hi
>>>
>>> I will check the log; however, I noticed that if I remove the CVS
>>> sources of the extlibrary example and rely on the extlibrary plugin
>>> (that is already installed among my plugins) everything seems to work
>>> fine.
>>>
>>> When I was trying the validation with the cvs sources of the
>>> extlibrary, I was running the configuration where I had excluded the
>>> extlibrary plugin (so that I was sure I was using the extlibrary from
>>> the sources), but probably the validation example relies on the
>>> extlibrary plugin and wasn't using the extlibrary sources?
>>>
>>> thanks
>>> Lorenzo
>>>
>>> Ed Merks wrote:
>>>> Lorenzo,
>>>>
>>>> Christian's on vacation, and I'm not sure how to answer your
>>>> question. :-(
>>>>
>>>> The final message sounds like some plugin is failing to load
>>>> properly. Have a look at the Error Log view for clues about that.
>>>>
>>>>
>>>> Lorenzo Bettini wrote:
>>>>> Hi
>>>>>
>>>>> I started reading "Tutorial: EMF Validation General" from the
>>>>> eclipse EMF Validation Framework.
>>>>>
>>>>> I downloaded the extlibrary example from the CVS and then I did
>>>>> new->example->EMF Validation FrameworkPlugin->General Validation
>>>>> Example (since I assume this is the one referred to by the tutorial,
>>>>> even though the constraint is slightly different).
>>>>>
>>>>> Then I did "Run as Eclipse application" (by firstly specifying only
>>>>> the plugins of the workspace and all the required plugins) and I
>>>>> created an ..extlibrary file, and added a Library with no name; Now
>>>>> in the context menu I have the "Validation" menu with all the
>>>>> submenus added by the plugin "General Validation Example" but the
>>>>> validation always succeeds (while it should not); moreover, if I try
>>>>> "Enable Live Validation" I get a message box "The chosen operation
>>>>> is not enabled".
>>>>>
>>>>> What am I doing wrong?
>>>>>
>>>>> thanks in advance
>>>>> Lorenzo
>>>>>
>>>
>>>
>>
>>
>
>
Re: problems with the validation tutorial [message #412987 is a reply to message #412933] Fri, 14 September 2007 07:42 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Christian W. Damus wrote:
> Hi, Lorenzo,
>
> Yes, unfortunately the example plug-ins have some interdependencies, esp. on
> client context definitions, that they shouldn't. Installing all three
> examples will usually work, of course, but we have a couple of bugzillae
> tracking the need to clean these up.
>
> Cheers,
>
> Christian

Hi Christian

actually, I wasn't able to see where these dependences are in the
example... moreover, I can't see why the constraints are not bound to
the model if the adapter example is not loaded...

thanks
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #412995 is a reply to message #412987] Fri, 14 September 2007 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Lorenzo,

The problem is, that the dependencies between these plug-ins are implicit.
One plug-in binds constraints to a client-context defined by another, so
that it is in some degree dependent on that other plug-in for the execution
of its constraints.

OTOH, in a "real world" application, it might be normal for a plug-in to
define constraints in some context that, in a deployed instance of that
application, doesn't exist (because the plug-in defining the context
doesn't exist). That's OK, because who needs constraints if there will
never be data to evaluate them on?

However, the point of the examples is not to demonstrate this. They really
should each define their own client context that matches the same objects.

Cheers,

Christian

Lorenzo Bettini wrote:

> Christian W. Damus wrote:
>> Hi, Lorenzo,
>>
>> Yes, unfortunately the example plug-ins have some interdependencies, esp.
>> on
>> client context definitions, that they shouldn't. Installing all three
>> examples will usually work, of course, but we have a couple of bugzillae
>> tracking the need to clean these up.
>>
>> Cheers,
>>
>> Christian
>
> Hi Christian
>
> actually, I wasn't able to see where these dependences are in the
> example... moreover, I can't see why the constraints are not bound to
> the model if the adapter example is not loaded...
>
> thanks
> Lorenzo
>
Re: problems with the validation tutorial [message #413018 is a reply to message #412995] Mon, 17 September 2007 11:22 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
This is a multi-part message in MIME format.
--------------000303020409040600030602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Christian W. Damus wrote:
> Hi, Lorenzo,
>
> The problem is, that the dependencies between these plug-ins are implicit.
> One plug-in binds constraints to a client-context defined by another, so
> that it is in some degree dependent on that other plug-in for the execution
> of its constraints.
>

I was pretty sure the context and the constraint were both in the
general plugin... I should check it again...

However, I tried to start with a fresh new emf model (a real basic one:
one class and two fields, and a constraint that check that the second
field named "required" is not empty).

I put the constraint in another plugin, and made an editor menu action
(following the validation plugin example) that performs batch validation
(again adapting code from the validation general example).

See the attached plugin.xml... still the constraint is not used during
validation (it is not even created... I put some sysout prints to be sure).

Am I doing something wrong or is there a bug?

I put all the plugins (the model, the generated edit and editor and the
validation plugin) here:

http://rap.dsi.unifi.it/~bettini/myemf.zip

the model as I said is very basic, and also the validation plugin...

any clue please?
thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net

--------------000303020409040600030602
Content-Type: text/xml;
name="plugin.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="plugin.xml"

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.emf.validation.constraintProviders">
<category
id="myemf.validation.category1"
name="MyEmfConstraintCategory">
</category>
<constraintProvider>
<package
namespaceUri="http:///myemf">
</package>
<constraints
categories="myemf.validation.category1">
<constraint
class="myemf.validation.constraints.RequiredConstraint"
id="myemf.validation.constraint1"
lang="java"
name="MyEmfRequiredConstraint"
severity="ERROR"
statusCode="1">
<message>
Constraint on Required field failed
</message>
</constraint>
</constraints>
</constraintProvider>
</extension>
<extension
point="org.eclipse.ui.editorActions">
<editorContribution
id="myemf.validation.editorContribution1"
targetID="myemf.presentation.MyemfEditorID">
<menu
id="myemf.validation.menu1"
label="my validation"
path="myemfMenuID/additions">
<separator
name="additions">
</separator>
</menu>
<action
class="myemf.validation.actions.MyValidateActionDelegate"
id="myemf.validation.myvalidation"
label="my validation"
menubarPath="myemfMenuID/myemf.validation.menu1/additions">
</action>
</editorContribution>
</extension>
<extension
point="org.eclipse.emf.validation.constraintBindings">
<clientContext
id="myemf.validation.clientContext1">
<selector
class="myemf.validation.constraints.MySelector">
</selector>
</clientContext>
<binding
category="myemf.validation.category1"
context="myemf.validation.clientContext1">
</binding>
</extension>

</plugin>

--------------000303020409040600030602--


Re: problems with the validation tutorial [message #413020 is a reply to message #413018] Mon, 17 September 2007 14:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Lorenzo,

I didn't understand that the constraint that wasn't working is the one that
is defined in the same "general" example plug-in.

In looking at your test case, there are a few things to check up:

- your constraint language is "java". I'm not sure that these language
names are case-sensitive, but try "Java" instead
- no <target> element is defined. This should apply your constraint to
all EClasses in the myemf package, but maybe there's something wrong
with that? Try specifying a target EClass

Do you see any messages in the workspace .log file indicating problems in
parsing the extensions that you have defined?

Cheers,

Christian

Lorenzo Bettini wrote:

> Christian W. Damus wrote:
>> Hi, Lorenzo,
>>
>> The problem is, that the dependencies between these plug-ins are
>> implicit. One plug-in binds constraints to a client-context defined by
>> another, so that it is in some degree dependent on that other plug-in for
>> the execution of its constraints.
>>
>
> I was pretty sure the context and the constraint were both in the
> general plugin... I should check it again...
>
> However, I tried to start with a fresh new emf model (a real basic one:
> one class and two fields, and a constraint that check that the second
> field named "required" is not empty).
>
> I put the constraint in another plugin, and made an editor menu action
> (following the validation plugin example) that performs batch validation
> (again adapting code from the validation general example).
>
> See the attached plugin.xml... still the constraint is not used during
> validation (it is not even created... I put some sysout prints to be
> sure).
>
> Am I doing something wrong or is there a bug?
>
> I put all the plugins (the model, the generated edit and editor and the
> validation plugin) here:
>
> http://rap.dsi.unifi.it/~bettini/myemf.zip
>
> the model as I said is very basic, and also the validation plugin...
>
> any clue please?
> thanks in advance
> Lorenzo
>
Re: problems with the validation tutorial [message #413040 is a reply to message #413020] Tue, 18 September 2007 12:15 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
This is a multi-part message in MIME format.
--------------000505020400050106060900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Christian W. Damus wrote:
> Hi, Lorenzo,
>
> I didn't understand that the constraint that wasn't working is the one that
> is defined in the same "general" example plug-in.

If I use only the general example plugin, the constraints are not used...

taking a look at its plugin.xml it looks like the context and the
binding refer only to classes of the general plugin, and not to the
adapter plugin... that's why I can't see why it's not working...

>
> In looking at your test case, there are a few things to check up:
>
> - your constraint language is "java". I'm not sure that these language
> names are case-sensitive, but try "Java" instead
> - no <target> element is defined. This should apply your constraint to
> all EClasses in the myemf package, but maybe there's something wrong
> with that? Try specifying a target EClass
>

I've modified the plugin.xml (see the attached file) as you suggested
but nothing changes

> Do you see any messages in the workspace .log file indicating problems in
> parsing the extensions that you have defined?
>

I actually noticed these problems (but I actually can't see why...
everything seems to be defined, isn't it?):

eclipse.buildId=I20070625-1500
java.version=1.6.0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.sdk.ide
Command-line arguments: -product org.eclipse.sdk.ide -data
/home/bettini/workspaces/EMFLibrary/runtime-MyEmf -dev
file:/home/bettini/workspaces/EMFLibrary/.metadata/.plugins/ org.eclipse.pde.core/MyEmf/dev.properties
-os linux -ws gtk -arch x86

!ENTRY org.eclipse.equinox.registry 4 1 2007-09-18 14:06:59.980
!MESSAGE Plug-in myemf.validation was unable to load class
myemf.validation.constraints.MySelector.
!STACK 0
java.lang.ClassCircularityError: myemf/validation/constraints/MySelector
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
at
<...SNIP...>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)

!ENTRY org.eclipse.emf.validation 4 121 2007-09-18 14:06:59.997
!MESSAGE Client context myemf.validation.clientContext1 does not exist
in constraint binding defined by plug-in myemf.validation.

!ENTRY org.eclipse.emf.validation 2 70 2007-09-18 14:07:00.422
!MESSAGE Constraint "myemf.validation.constraint1" could not find target
EMF type "EClass."



--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net

--------------000505020400050106060900
Content-Type: text/xml;
name="plugin.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="plugin.xml"

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.emf.validation.constraintProviders">
<category
id="myemf.validation.category1"
name="MyEmfConstraintCategory">
</category>
<constraintProvider>
<package
namespaceUri="http:///myemf">
</package>
<constraints
categories="myemf.validation.category1">
<constraint
class="myemf.validation.constraints.RequiredConstraint"
id="myemf.validation.constraint1"
lang="Java"
name="MyEmfRequiredConstraint"
severity="ERROR"
statusCode="1">
<message>
Constraint on Required field failed
</message>
<description>
Check that the required field is specified
</description>
<target
class="EClass">
</target>
</constraint>
</constraints>
</constraintProvider>
</extension>
<extension
point="org.eclipse.ui.editorActions">
<editorContribution
id="myemf.validation.editorContribution1"
targetID="myemf.presentation.MyemfEditorID">
<menu
id="myemf.validation.menu1"
label="my validation"
path="myemfMenuID/additions">
<separator
name="additions">
</separator>
</menu>
<action
class="myemf.validation.actions.MyValidateActionDelegate"
id="myemf.validation.myvalidation"
label="my validation"
menubarPath="myemfMenuID/myemf.validation.menu1/additions">
</action>
</editorContribution>
</extension>
<extension
point="org.eclipse.emf.validation.constraintBindings">
<clientContext
id="myemf.validation.clientContext1">
<selector
class="myemf.validation.constraints.MySelector">
</selector>
</clientContext>
<binding
category="myemf.validation.category1"
context="myemf.validation.clientContext1">
</binding>
</extension>

</plugin>

--------------000505020400050106060900--


Re: problems with the validation tutorial [message #413235 is a reply to message #413040] Tue, 25 September 2007 07:44 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Christian Damus wrote:
> Hi, Lorenzo,
>
> See some comments in-line, below.
>
> HTH,
>
> Christian
>

HI Christian

>
> Lorenzo Bettini wrote:
>
>> Christian W. Damus wrote:
>>> Hi, Lorenzo,
>>>
>>> I didn't understand that the constraint that wasn't working is the one
>>> that is defined in the same "general" example plug-in.
>> If I use only the general example plugin, the constraints are not
used...
>
> If I exclude the other two example plug-ins (adapter and ocl) from my
> run-time workbench configuration, launch a workbench, and create a new
> extlibrary file with a Library at the root, then validate it I get a
> message saying that the library has no name. This is from the constraint
> defined in the example that requires libraries to have names and books to
> have titles.

then I begin to suspect that my eclipse installation is broken... by the
way, I'm not able to update EMFT because of the url which seems to be
broken... probably I should start with a fresh install...

>
> Are you sure that you are using the "Validation -> Validate Elements..."
> menu action as described in the Examples Guide in the help? Just
selecting
> "Validate" in the context menu will not do anything, as this is the
> EMF-generated action that invokes the Diagnostician. The Diagnostician
> knows nothing about this other validation framework ...

yes, I'm sure I'm using Validation -> Validate Elements...

<snip>
>> !ENTRY org.eclipse.equinox.registry 4 1 2007-09-18 14:06:59.980
>> !MESSAGE Plug-in myemf.validation was unable to load class
>> myemf.validation.constraints.MySelector.
>> !STACK 0
>> java.lang.ClassCircularityError: myemf/validation/constraints/MySelector
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>> at
>
> Yep, I thought so. The plug-in class loader is trying to load this
class,
> but needs to activate the plug-in in order to do so. Activating the
> plug-in for some reason needs to load this class. The circular
dependency
> causes the VM to fail loading the class.
>

but why should this happen? I actually used the same selector as
reported in the tutorial... did you happen to try my simple plugin?

> Try putting this selector in a package that doesn't cause your plug-in to
> load (i.e., add its package to the Eclipse-LazyStart exceptions list
in the
> bundle manifest).

but, again, this is the same selector of the tutorial... actually, it's
even simpler since it always return true...

<snip>
>> !ENTRY org.eclipse.emf.validation 4 121 2007-09-18 14:06:59.997
>> !MESSAGE Client context myemf.validation.clientContext1 does not exist
>> in constraint binding defined by plug-in myemf.validation.
>>
>> !ENTRY org.eclipse.emf.validation 2 70 2007-09-18 14:07:00.422
>> !MESSAGE Constraint "myemf.validation.constraint1" could not find target
>> EMF type "EClass."
>
> You need to specify the Ecore namespace URI in a <package> element in
your
> <constraintProvider> if you want to target constraints on the EClass
> metaclass.

I did that (see the plugin.xml I had sent)...

everything makes me think of a broken eclipse installation...

I'll try to install a brand new copy these days...

thanks
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #414491 is a reply to message #413040] Thu, 08 November 2007 21:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.vouffo.gmx.net

Hi,

I'm facing exactly the same problem. Has any solution been suggested for
it ?

Thanks
Alain

Lorenzo Bettini wrote:
> Christian W. Damus wrote:
>> Hi, Lorenzo,
>>
>> I didn't understand that the constraint that wasn't working is the one
>> that
>> is defined in the same "general" example plug-in.
>
> If I use only the general example plugin, the constraints are not used...
>
> taking a look at its plugin.xml it looks like the context and the
> binding refer only to classes of the general plugin, and not to the
> adapter plugin... that's why I can't see why it's not working...
>
>>
>> In looking at your test case, there are a few things to check up:
>>
>> - your constraint language is "java". I'm not sure that these language
>> names are case-sensitive, but try "Java" instead
>> - no <target> element is defined. This should apply your constraint to
>> all EClasses in the myemf package, but maybe there's something wrong
>> with that? Try specifying a target EClass
>>
>
> I've modified the plugin.xml (see the attached file) as you suggested
> but nothing changes
>
>> Do you see any messages in the workspace .log file indicating problems in
>> parsing the extensions that you have defined?
>>
>
> I actually noticed these problems (but I actually can't see why...
> everything seems to be defined, isn't it?):
>
> eclipse.buildId=I20070625-1500
> java.version=1.6.0
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
> Framework arguments: -product org.eclipse.sdk.ide
> Command-line arguments: -product org.eclipse.sdk.ide -data
> /home/bettini/workspaces/EMFLibrary/runtime-MyEmf -dev
> file:/home/bettini/workspaces/EMFLibrary/.metadata/.plugins/ org.eclipse.pde.core/MyEmf/dev.properties
> -os linux -ws gtk -arch x86
>
> !ENTRY org.eclipse.equinox.registry 4 1 2007-09-18 14:06:59.980
> !MESSAGE Plug-in myemf.validation was unable to load class
> myemf.validation.constraints.MySelector.
> !STACK 0
> java.lang.ClassCircularityError: myemf/validation/constraints/MySelector
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
>
> at
> <...SNIP...>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
>
> !ENTRY org.eclipse.emf.validation 4 121 2007-09-18 14:06:59.997
> !MESSAGE Client context myemf.validation.clientContext1 does not exist
> in constraint binding defined by plug-in myemf.validation.
>
> !ENTRY org.eclipse.emf.validation 2 70 2007-09-18 14:07:00.422
> !MESSAGE Constraint "myemf.validation.constraint1" could not find target
> EMF type "EClass."
>
>
>
Re: problems with the validation tutorial [message #414492 is a reply to message #414491] Thu, 08 November 2007 22:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Alain,

Hopefully Christian will see your question tomorrow.


Alain Vouffo wrote:
> Hi,
>
> I'm facing exactly the same problem. Has any solution been suggested
> for it ?
>
> Thanks
> Alain
>
> Lorenzo Bettini wrote:
>> Christian W. Damus wrote:
>>> Hi, Lorenzo,
>>>
>>> I didn't understand that the constraint that wasn't working is the
>>> one that
>>> is defined in the same "general" example plug-in.
>>
>> If I use only the general example plugin, the constraints are not
>> used...
>>
>> taking a look at its plugin.xml it looks like the context and the
>> binding refer only to classes of the general plugin, and not to the
>> adapter plugin... that's why I can't see why it's not working...
>>
>>>
>>> In looking at your test case, there are a few things to check up:
>>>
>>> - your constraint language is "java". I'm not sure that these
>>> language
>>> names are case-sensitive, but try "Java" instead
>>> - no <target> element is defined. This should apply your
>>> constraint to
>>> all EClasses in the myemf package, but maybe there's something
>>> wrong
>>> with that? Try specifying a target EClass
>>>
>>
>> I've modified the plugin.xml (see the attached file) as you suggested
>> but nothing changes
>>
>>> Do you see any messages in the workspace .log file indicating
>>> problems in
>>> parsing the extensions that you have defined?
>>>
>>
>> I actually noticed these problems (but I actually can't see why...
>> everything seems to be defined, isn't it?):
>>
>> eclipse.buildId=I20070625-1500
>> java.version=1.6.0
>> java.vendor=Sun Microsystems Inc.
>> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
>> Framework arguments: -product org.eclipse.sdk.ide
>> Command-line arguments: -product org.eclipse.sdk.ide -data
>> /home/bettini/workspaces/EMFLibrary/runtime-MyEmf -dev
>> file:/home/bettini/workspaces/EMFLibrary/.metadata/.plugins/ org.eclipse.pde.core/MyEmf/dev.properties
>> -os linux -ws gtk -arch x86
>>
>> !ENTRY org.eclipse.equinox.registry 4 1 2007-09-18 14:06:59.980
>> !MESSAGE Plug-in myemf.validation was unable to load class
>> myemf.validation.constraints.MySelector.
>> !STACK 0
>> java.lang.ClassCircularityError: myemf/validation/constraints/MySelector
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
>>
>> at
>> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
>>
>> at
>> <...SNIP...>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
>>
>> !ENTRY org.eclipse.emf.validation 4 121 2007-09-18 14:06:59.997
>> !MESSAGE Client context myemf.validation.clientContext1 does not
>> exist in constraint binding defined by plug-in myemf.validation.
>>
>> !ENTRY org.eclipse.emf.validation 2 70 2007-09-18 14:07:00.422
>> !MESSAGE Constraint "myemf.validation.constraint1" could not find
>> target EMF type "EClass."
>>
>>
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problems with the validation tutorial [message #414502 is a reply to message #414491] Fri, 09 November 2007 15:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Alain,

Do you mean, that you are seeing ClassCircularityErrors? The usual reason
for this in an Eclipse/OSGi environment is that some code (in this case,
the validation framework) is trying to:

- load a class X from some bundle
- loading the class prompts lazy bundle activation
- bundle activation attempts to access the class X
- class X is still trying to initialize itself
- bang

One possible work-around is to put class X in some package that is declared
in the bundle manifest's lazy-start exclusions (the PDE's manifest editor
makes this easy). Most client selectors won't need to lazy-start their
containing bundles. If they did, then they probably would be trying to do
more work than they should (they should be as efficient as possible in
inspecting objects because they are invoked frequently during validation).

HTH,

Christian

Alain Vouffo wrote:

> Hi,
>
> I'm facing exactly the same problem. Has any solution been suggested for
> it ?
>
> Thanks
> Alain
>
> Lorenzo Bettini wrote:
>> Christian W. Damus wrote:
>>> Hi, Lorenzo,
>>>
>>> I didn't understand that the constraint that wasn't working is the one
>>> that
>>> is defined in the same "general" example plug-in.
>>
>> If I use only the general example plugin, the constraints are not used...
>>
>> taking a look at its plugin.xml it looks like the context and the
>> binding refer only to classes of the general plugin, and not to the
>> adapter plugin... that's why I can't see why it's not working...
>>
>>>
>>> In looking at your test case, there are a few things to check up:
>>>
>>> - your constraint language is "java". I'm not sure that these
>>> language
>>> names are case-sensitive, but try "Java" instead
>>> - no <target> element is defined. This should apply your constraint
>>> to
>>> all EClasses in the myemf package, but maybe there's something wrong
>>> with that? Try specifying a target EClass
>>>
>>
>> I've modified the plugin.xml (see the attached file) as you suggested
>> but nothing changes
>>
>>> Do you see any messages in the workspace .log file indicating problems
>>> in parsing the extensions that you have defined?
>>>
>>
>> I actually noticed these problems (but I actually can't see why...
>> everything seems to be defined, isn't it?):
>>
>> eclipse.buildId=I20070625-1500
>> java.version=1.6.0
>> java.vendor=Sun Microsystems Inc.
>> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
>> Framework arguments: -product org.eclipse.sdk.ide
>> Command-line arguments: -product org.eclipse.sdk.ide -data
>> /home/bettini/workspaces/EMFLibrary/runtime-MyEmf -dev
>>
file:/home/bettini/workspaces/EMFLibrary/.metadata/.plugins/ org.eclipse.pde.core/MyEmf/dev.properties
>> -os linux -ws gtk -arch x86
>>
>> !ENTRY org.eclipse.equinox.registry 4 1 2007-09-18 14:06:59.980
>> !MESSAGE Plug-in myemf.validation was unable to load class
>> myemf.validation.constraints.MySelector.
>> !STACK 0
>> java.lang.ClassCircularityError: myemf/validation/constraints/MySelector
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>> at
>>
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
>>
>> at
>>
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
>>
>> at
>> <...SNIP...>
>>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
>>
>> !ENTRY org.eclipse.emf.validation 4 121 2007-09-18 14:06:59.997
>> !MESSAGE Client context myemf.validation.clientContext1 does not exist
>> in constraint binding defined by plug-in myemf.validation.
>>
>> !ENTRY org.eclipse.emf.validation 2 70 2007-09-18 14:07:00.422
>> !MESSAGE Constraint "myemf.validation.constraint1" could not find target
>> EMF type "EClass."
>>
>>
>>
Re: problems with the validation tutorial [message #415322 is a reply to message #414502] Wed, 12 December 2007 13:12 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Christian W. Damus wrote:
> Hi, Alain,
>
> Do you mean, that you are seeing ClassCircularityErrors? The usual reason
> for this in an Eclipse/OSGi environment is that some code (in this case,
> the validation framework) is trying to:
>
> - load a class X from some bundle
> - loading the class prompts lazy bundle activation
> - bundle activation attempts to access the class X
> - class X is still trying to initialize itself
> - bang
>
> One possible work-around is to put class X in some package that is declared
> in the bundle manifest's lazy-start exclusions (the PDE's manifest editor
> makes this easy). Most client selectors won't need to lazy-start their
> containing bundles. If they did, then they probably would be trying to do
> more work than they should (they should be as efficient as possible in
> inspecting objects because they are invoked frequently during validation).

but I get this problem with the validation tutorial itself; so should it
put such class in the bundle manifest's lazy start exclusions?

--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: problems with the validation tutorial [message #415324 is a reply to message #415322] Wed, 12 December 2007 13:30 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Lorenzo,

I guess I've always got a lucky ordering of OSGi bundle initialization or
something, I don't know, because I've never seen this in just the
validation example projects.

However, I think I can fix this problem with the following:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=212429

as there really is no need to load client-context selectors during bundle
start-up.

cW


Lorenzo Bettini wrote:

> Christian W. Damus wrote:
>> Hi, Alain,
>>
>> Do you mean, that you are seeing ClassCircularityErrors? The usual
>> reason for this in an Eclipse/OSGi environment is that some code (in this
>> case, the validation framework) is trying to:
>>
>> - load a class X from some bundle
>> - loading the class prompts lazy bundle activation
>> - bundle activation attempts to access the class X
>> - class X is still trying to initialize itself
>> - bang
>>
>> One possible work-around is to put class X in some package that is
>> declared in the bundle manifest's lazy-start exclusions (the PDE's
>> manifest editor
>> makes this easy). Most client selectors won't need to lazy-start their
>> containing bundles. If they did, then they probably would be trying to
>> do more work than they should (they should be as efficient as possible in
>> inspecting objects because they are invoked frequently during
>> validation).
>
> but I get this problem with the validation tutorial itself; so should it
> put such class in the bundle manifest's lazy start exclusions?
>
Previous Topic:Extendings EClass?
Next Topic:Language Workbench?
Goto Forum:
  


Current Time: Tue Apr 16 17:36:09 GMT 2024

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

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

Back to the top