Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] ERROR: Could not find feature CDOFeature ...
[CDO] ERROR: Could not find feature CDOFeature ... [message #427616] Tue, 24 February 2009 13:19 Go to next message
Anders Forsell is currently offline Anders ForsellFriend
Messages: 127
Registered: July 2009
Senior Member
Using CDO 2.0 M5 I have run into a problem that I have been trying to
hunt down using the debugger.

I am getting an IllegalArgumentException: "Could not find feature
CDOFeature ...". The problem boils down to that
CDOClassImpl.getFeatureID returns -1:

public int getFeatureID(CDOFeature feature)
{
int index = feature.getFeatureIndex();
if (index != -1)
{
CDOFeature[] features = getAllFeatures();
while (index < features.length)
{
if (features[index] == feature)
{
return index;
}

++index;
}
}

return -1;
}

My setup is a MEMStore repository with two clients connected.
This happens when one of the clients commits a transaction.

This happens in the CDO Server process, and using the debugger I can
that the condition "features[index] == feature" fails because there are
two different instances of CDOFeatureImpl. However, both instances have
the same attribute values, so I suspect that this is a bug that could be
solved using "equals" comparison, but I would like to check here first
before I file a bug.

---
Anders
Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427620 is a reply to message #427616] Tue, 24 February 2009 16:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Anders,

It sounds like a bug, although I wonder that none of our tests and none
of the other users caught it.
Please file a Bugzilla and if possible attach your model and the full
stack trace.
If you find the time it would be great if you write a small test case so
that we can easily reproduce it. If you look at our other tests you'll
find that they're easy to write...

Cheers
/Eike

----
http://thegordian.blogspot.com




Anders Forsell schrieb:
> Using CDO 2.0 M5 I have run into a problem that I have been trying to
> hunt down using the debugger.
>
> I am getting an IllegalArgumentException: "Could not find feature
> CDOFeature ...". The problem boils down to that
> CDOClassImpl.getFeatureID returns -1:
>
> public int getFeatureID(CDOFeature feature)
> {
> int index = feature.getFeatureIndex();
> if (index != -1)
> {
> CDOFeature[] features = getAllFeatures();
> while (index < features.length)
> {
> if (features[index] == feature)
> {
> return index;
> }
>
> ++index;
> }
> }
>
> return -1;
> }
>
> My setup is a MEMStore repository with two clients connected.
> This happens when one of the clients commits a transaction.
>
> This happens in the CDO Server process, and using the debugger I can
> that the condition "features[index] == feature" fails because there
> are two different instances of CDOFeatureImpl. However, both instances
> have the same attribute values, so I suspect that this is a bug that
> could be solved using "equals" comparison, but I would like to check
> here first before I file a bug.
>
> ---
> Anders


Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427642 is a reply to message #427620] Wed, 25 February 2009 09:43 Go to previous messageGo to next message
Anders Forsell is currently offline Anders ForsellFriend
Messages: 127
Registered: July 2009
Senior Member
Eike,

I was able to find a workaround, maybe you can comment if I describe the
scenario in more detail.

As I mentioned I have two clients (Client1, Client2) connected to the
same model repository. In the repository I store two different models.
Client1 and Client2 uses only one CDOSession each and one transaction to
modify content in both models.
The "Could not find feature" error seems to disappear when I use one
CDOSession per model, i.e. two CDOSessions for each client.

Is it not supported to have only one session modify several models?
Could it also be a problem that I only use one transaction that is
active all the time?

---
Anders

Eike Stepper wrote:
> Anders,
>
> It sounds like a bug, although I wonder that none of our tests and none
> of the other users caught it.
> Please file a Bugzilla and if possible attach your model and the full
> stack trace.
> If you find the time it would be great if you write a small test case so
> that we can easily reproduce it. If you look at our other tests you'll
> find that they're easy to write...
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
>
> Anders Forsell schrieb:
>> Using CDO 2.0 M5 I have run into a problem that I have been trying to
>> hunt down using the debugger.
>>
>> I am getting an IllegalArgumentException: "Could not find feature
>> CDOFeature ...". The problem boils down to that
>> CDOClassImpl.getFeatureID returns -1:
>>
>> public int getFeatureID(CDOFeature feature)
>> {
>> int index = feature.getFeatureIndex();
>> if (index != -1)
>> {
>> CDOFeature[] features = getAllFeatures();
>> while (index < features.length)
>> {
>> if (features[index] == feature)
>> {
>> return index;
>> }
>>
>> ++index;
>> }
>> }
>>
>> return -1;
>> }
>>
>> My setup is a MEMStore repository with two clients connected.
>> This happens when one of the clients commits a transaction.
>>
>> This happens in the CDO Server process, and using the debugger I can
>> that the condition "features[index] == feature" fails because there
>> are two different instances of CDOFeatureImpl. However, both instances
>> have the same attribute values, so I suspect that this is a bug that
>> could be solved using "equals" comparison, but I would like to check
>> here first before I file a bug.
>>
>> ---
>> Anders
Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427645 is a reply to message #427642] Wed, 25 February 2009 10:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Anders,

It should be possible to use one session per client to access/modify
(through one transaction) everything in a repository. A transaction can
be used for multiple subsequent commits (it's like a JDBC connection in
this regard). What exactly do you mean by "models"? Packages or resources?

Cheers
/Eike

----
http://thegordian.blogspot.com



Anders Forsell schrieb:
> Eike,
>
> I was able to find a workaround, maybe you can comment if I describe
> the scenario in more detail.
>
> As I mentioned I have two clients (Client1, Client2) connected to the
> same model repository. In the repository I store two different models.
> Client1 and Client2 uses only one CDOSession each and one transaction
> to modify content in both models.
> The "Could not find feature" error seems to disappear when I use one
> CDOSession per model, i.e. two CDOSessions for each client.
>
> Is it not supported to have only one session modify several models?
> Could it also be a problem that I only use one transaction that is
> active all the time?
>
> ---
> Anders
>
> Eike Stepper wrote:
>> Anders,
>>
>> It sounds like a bug, although I wonder that none of our tests and
>> none of the other users caught it.
>> Please file a Bugzilla and if possible attach your model and the full
>> stack trace.
>> If you find the time it would be great if you write a small test case
>> so that we can easily reproduce it. If you look at our other tests
>> you'll find that they're easy to write...
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>>
>>
>>
>>
>> Anders Forsell schrieb:
>>> Using CDO 2.0 M5 I have run into a problem that I have been trying
>>> to hunt down using the debugger.
>>>
>>> I am getting an IllegalArgumentException: "Could not find feature
>>> CDOFeature ...". The problem boils down to that
>>> CDOClassImpl.getFeatureID returns -1:
>>>
>>> public int getFeatureID(CDOFeature feature)
>>> {
>>> int index = feature.getFeatureIndex();
>>> if (index != -1)
>>> {
>>> CDOFeature[] features = getAllFeatures();
>>> while (index < features.length)
>>> {
>>> if (features[index] == feature)
>>> {
>>> return index;
>>> }
>>>
>>> ++index;
>>> }
>>> }
>>>
>>> return -1;
>>> }
>>>
>>> My setup is a MEMStore repository with two clients connected.
>>> This happens when one of the clients commits a transaction.
>>>
>>> This happens in the CDO Server process, and using the debugger I can
>>> that the condition "features[index] == feature" fails because there
>>> are two different instances of CDOFeatureImpl. However, both
>>> instances have the same attribute values, so I suspect that this is
>>> a bug that could be solved using "equals" comparison, but I would
>>> like to check here first before I file a bug.
>>>
>>> ---
>>> Anders


Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427648 is a reply to message #427645] Wed, 25 February 2009 11:28 Go to previous messageGo to next message
Anders Forsell is currently offline Anders ForsellFriend
Messages: 127
Registered: July 2009
Senior Member
Ok, thats what I thought.

With "model" I was referring to resources, where in my case the two
resources were instances of two different ecore packages.

---
Anders

Eike Stepper wrote:
> Anders,
>
> It should be possible to use one session per client to access/modify
> (through one transaction) everything in a repository. A transaction can
> be used for multiple subsequent commits (it's like a JDBC connection in
> this regard). What exactly do you mean by "models"? Packages or resources?
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Anders Forsell schrieb:
>> Eike,
>>
>> I was able to find a workaround, maybe you can comment if I describe
>> the scenario in more detail.
>>
>> As I mentioned I have two clients (Client1, Client2) connected to the
>> same model repository. In the repository I store two different models.
>> Client1 and Client2 uses only one CDOSession each and one transaction
>> to modify content in both models.
>> The "Could not find feature" error seems to disappear when I use one
>> CDOSession per model, i.e. two CDOSessions for each client.
>>
>> Is it not supported to have only one session modify several models?
>> Could it also be a problem that I only use one transaction that is
>> active all the time?
>>
>> ---
>> Anders
>>
>> Eike Stepper wrote:
>>> Anders,
>>>
>>> It sounds like a bug, although I wonder that none of our tests and
>>> none of the other users caught it.
>>> Please file a Bugzilla and if possible attach your model and the full
>>> stack trace.
>>> If you find the time it would be great if you write a small test case
>>> so that we can easily reproduce it. If you look at our other tests
>>> you'll find that they're easy to write...
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://thegordian.blogspot.com
>>>
>>>
>>>
>>>
>>> Anders Forsell schrieb:
>>>> Using CDO 2.0 M5 I have run into a problem that I have been trying
>>>> to hunt down using the debugger.
>>>>
>>>> I am getting an IllegalArgumentException: "Could not find feature
>>>> CDOFeature ...". The problem boils down to that
>>>> CDOClassImpl.getFeatureID returns -1:
>>>>
>>>> public int getFeatureID(CDOFeature feature)
>>>> {
>>>> int index = feature.getFeatureIndex();
>>>> if (index != -1)
>>>> {
>>>> CDOFeature[] features = getAllFeatures();
>>>> while (index < features.length)
>>>> {
>>>> if (features[index] == feature)
>>>> {
>>>> return index;
>>>> }
>>>>
>>>> ++index;
>>>> }
>>>> }
>>>>
>>>> return -1;
>>>> }
>>>>
>>>> My setup is a MEMStore repository with two clients connected.
>>>> This happens when one of the clients commits a transaction.
>>>>
>>>> This happens in the CDO Server process, and using the debugger I can
>>>> that the condition "features[index] == feature" fails because there
>>>> are two different instances of CDOFeatureImpl. However, both
>>>> instances have the same attribute values, so I suspect that this is
>>>> a bug that could be solved using "equals" comparison, but I would
>>>> like to check here first before I file a bug.
>>>>
>>>> ---
>>>> Anders
Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427649 is a reply to message #427648] Wed, 25 February 2009 11:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Anders Forsell schrieb:
> Ok, thats what I thought.
>
> With "model" I was referring to resources, where in my case the two
> resources were instances of two different ecore packages.
Ok, that should not matter...

Cheers
/Eike

----
http://thegordian.blogspot.com


>
> ---
> Anders
>
> Eike Stepper wrote:
>> Anders,
>>
>> It should be possible to use one session per client to access/modify
>> (through one transaction) everything in a repository. A transaction
>> can be used for multiple subsequent commits (it's like a JDBC
>> connection in this regard). What exactly do you mean by "models"?
>> Packages or resources?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>>
>>
>>
>> Anders Forsell schrieb:
>>> Eike,
>>>
>>> I was able to find a workaround, maybe you can comment if I describe
>>> the scenario in more detail.
>>>
>>> As I mentioned I have two clients (Client1, Client2) connected to
>>> the same model repository. In the repository I store two different
>>> models.
>>> Client1 and Client2 uses only one CDOSession each and one
>>> transaction to modify content in both models.
>>> The "Could not find feature" error seems to disappear when I use one
>>> CDOSession per model, i.e. two CDOSessions for each client.
>>>
>>> Is it not supported to have only one session modify several models?
>>> Could it also be a problem that I only use one transaction that is
>>> active all the time?
>>>
>>> ---
>>> Anders
>>>
>>> Eike Stepper wrote:
>>>> Anders,
>>>>
>>>> It sounds like a bug, although I wonder that none of our tests and
>>>> none of the other users caught it.
>>>> Please file a Bugzilla and if possible attach your model and the
>>>> full stack trace.
>>>> If you find the time it would be great if you write a small test
>>>> case so that we can easily reproduce it. If you look at our other
>>>> tests you'll find that they're easy to write...
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://thegordian.blogspot.com
>>>>
>>>>
>>>>
>>>>
>>>> Anders Forsell schrieb:
>>>>> Using CDO 2.0 M5 I have run into a problem that I have been trying
>>>>> to hunt down using the debugger.
>>>>>
>>>>> I am getting an IllegalArgumentException: "Could not find feature
>>>>> CDOFeature ...". The problem boils down to that
>>>>> CDOClassImpl.getFeatureID returns -1:
>>>>>
>>>>> public int getFeatureID(CDOFeature feature)
>>>>> {
>>>>> int index = feature.getFeatureIndex();
>>>>> if (index != -1)
>>>>> {
>>>>> CDOFeature[] features = getAllFeatures();
>>>>> while (index < features.length)
>>>>> {
>>>>> if (features[index] == feature)
>>>>> {
>>>>> return index;
>>>>> }
>>>>>
>>>>> ++index;
>>>>> }
>>>>> }
>>>>>
>>>>> return -1;
>>>>> }
>>>>>
>>>>> My setup is a MEMStore repository with two clients connected.
>>>>> This happens when one of the clients commits a transaction.
>>>>>
>>>>> This happens in the CDO Server process, and using the debugger I
>>>>> can that the condition "features[index] == feature" fails because
>>>>> there are two different instances of CDOFeatureImpl. However, both
>>>>> instances have the same attribute values, so I suspect that this
>>>>> is a bug that could be solved using "equals" comparison, but I
>>>>> would like to check here first before I file a bug.
>>>>>
>>>>> ---
>>>>> Anders


Re: [CDO] ERROR: Could not find feature CDOFeature ... [message #427651 is a reply to message #427649] Wed, 25 February 2009 12:21 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
hi Anders,

Could you provide us the complete stack trace of the exception and the two
ecore packages ? (optional : a testcase :-))

Simon

> Anders Forsell schrieb:
>> Ok, thats what I thought.
>>
>> With "model" I was referring to resources, where in my case the two
>> resources were instances of two different ecore packages.
> Ok, that should not matter...

> Cheers
> /Eike

> ----
> http://thegordian.blogspot.com


>>
>> ---
>> Anders
>>
>> Eike Stepper wrote:
>>> Anders,
>>>
>>> It should be possible to use one session per client to access/modify
>>> (through one transaction) everything in a repository. A transaction
>>> can be used for multiple subsequent commits (it's like a JDBC
>>> connection in this regard). What exactly do you mean by "models"?
>>> Packages or resources?
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://thegordian.blogspot.com
>>>
>>>
>>>
>>> Anders Forsell schrieb:
>>>> Eike,
>>>>
>>>> I was able to find a workaround, maybe you can comment if I describe
>>>> the scenario in more detail.
>>>>
>>>> As I mentioned I have two clients (Client1, Client2) connected to
>>>> the same model repository. In the repository I store two different
>>>> models.
>>>> Client1 and Client2 uses only one CDOSession each and one
>>>> transaction to modify content in both models.
>>>> The "Could not find feature" error seems to disappear when I use one
>>>> CDOSession per model, i.e. two CDOSessions for each client.
>>>>
>>>> Is it not supported to have only one session modify several models?
>>>> Could it also be a problem that I only use one transaction that is
>>>> active all the time?
>>>>
>>>> ---
>>>> Anders
>>>>
>>>> Eike Stepper wrote:
>>>>> Anders,
>>>>>
>>>>> It sounds like a bug, although I wonder that none of our tests and
>>>>> none of the other users caught it.
>>>>> Please file a Bugzilla and if possible attach your model and the
>>>>> full stack trace.
>>>>> If you find the time it would be great if you write a small test
>>>>> case so that we can easily reproduce it. If you look at our other
>>>>> tests you'll find that they're easy to write...
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://thegordian.blogspot.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Anders Forsell schrieb:
>>>>>> Using CDO 2.0 M5 I have run into a problem that I have been trying
>>>>>> to hunt down using the debugger.
>>>>>>
>>>>>> I am getting an IllegalArgumentException: "Could not find feature
>>>>>> CDOFeature ...". The problem boils down to that
>>>>>> CDOClassImpl.getFeatureID returns -1:
>>>>>>
>>>>>> public int getFeatureID(CDOFeature feature)
>>>>>> {
>>>>>> int index = feature.getFeatureIndex();
>>>>>> if (index != -1)
>>>>>> {
>>>>>> CDOFeature[] features = getAllFeatures();
>>>>>> while (index < features.length)
>>>>>> {
>>>>>> if (features[index] == feature)
>>>>>> {
>>>>>> return index;
>>>>>> }
>>>>>>
>>>>>> ++index;
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> return -1;
>>>>>> }
>>>>>>
>>>>>> My setup is a MEMStore repository with two clients connected.
>>>>>> This happens when one of the clients commits a transaction.
>>>>>>
>>>>>> This happens in the CDO Server process, and using the debugger I
>>>>>> can that the condition "features[index] == feature" fails because
>>>>>> there are two different instances of CDOFeatureImpl. However, both
>>>>>> instances have the same attribute values, so I suspect that this
>>>>>> is a bug that could be solved using "equals" comparison, but I
>>>>>> would like to check here first before I file a bug.
>>>>>>
>>>>>> ---
>>>>>> Anders
Previous Topic:Reading CDATA content into an EMF model
Next Topic:Model Integrity in EMF with MDT OCL
Goto Forum:
  


Current Time: Thu Mar 28 16:49:50 GMT 2024

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

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

Back to the top