error dNU

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

error dNU

Juan-2
folks

sometimes throws glass dnu ,  with one method that if there.
the class has this method,but at runtime fail.

may be due to this?
happened to someone?
any ideas will be appreciated.
tia.
best regards
MDC
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

SeanTAllen
Are you sending the message to the class or an instance of the class?

How do you know that the method 'is there'?
Have you examined the class of the receiver to make sure it is an
instance of the class you expect?

On Wed, Feb 24, 2010 at 4:39 PM, Juan <[hidden email]> wrote:

> folks
>
> sometimes throws glass dnu ,  with one method that if there.
> the class has this method,but at runtime fail.
>
> may be due to this?
> happened to someone?
> any ideas will be appreciated.
> tia.
> best regards
> MDC
>
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Dale
In reply to this post by Juan-2
Juan,

One of the things to be aware of with GemStone is that references to classes (in a class var or other global slot) can go "stale". Compiled in references to the class reference the association from the SymbolDictionary in which the class is loaded (normally UerGlobals for GLASS), but direct references to the class can be problematic.

The problem stems from the fact that unlike Pharo/Squeak, GemStone creates a new instance of a class when you change it's shape. The GLASS tools migrate the instances of the class, but references to the "old" class remain. At this point in time there is no simple way to automatically update the refs.

You can be defensive, by not storing direct references to classes, or you can arrange to make it easy refresh the direct references...

Dale
----- "Juan" <[hidden email]> wrote:

| folks
|
| sometimes throws glass dnu ,  with one method that if there.
| the class has this method,but at runtime fail.
|
| may be due to this?
| happened to someone?
| any ideas will be appreciated.
| tia.
| best regards
| MDC
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Juan-2
In reply to this post by SeanTAllen
hi

On Wed, Feb 24, 2010 at 7:08 PM, Sean Allen <[hidden email]> wrote:
> Are you sending the message to the class or an instance of the class?

instance .

Inspector show this instance is of  right class .( expected one ).

>
> How do you know that the method 'is there'?
yes
> Have you examined the class of the receiver to make sure it is an
> instance of the class you expect?
 yes

>
> On Wed, Feb 24, 2010 at 4:39 PM, Juan <[hidden email]> wrote:
>> folks
>>
>> sometimes throws glass dnu ,  with one method that if there.
>> the class has this method,but at runtime fail.
>>
>> may be due to this?
>> happened to someone?
>> any ideas will be appreciated.
>> tia.
>> best regards
>> MDC
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

SeanTAllen
>> How do you know that the method 'is there'?
> yes

How do you know the method 'is there'?

Was this instance created before you added the method to the class?
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Juan-2
hi
the browser show me that method.
the inspector show me the instances of correct class.
the execution stop in this message with dnu.
but method dictionary of that class show this selector
i 'don't  know how proceed.
best regards
MDC

On Wed, Feb 24, 2010 at 10:09 PM, Sean Allen
<[hidden email]> wrote:
>>> How do you know that the method 'is there'?
>> yes
>
> How do you know the method 'is there'?
>
> Was this instance created before you added the method to the class?
>
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Dale
In reply to this post by Juan-2
Juan,

A stack trace would be a good place to start ... I am suspicious about Class History, so I am interested in tracing back to discover how the instance was created. Could you show us the method or script where these instance would be created?

BTW, in GemTools Launcher the annotation looks like this:
 
  1.0-beta.8 workspace: 'GLASS' auto: [commit migrate] backup: '1.0-beta.8.dbf'

Could you copy and paste you annotation pane. I am interested in finding out if you have autoMigrate set or not, since that _will_ affect an instance and whether or not the methods are visible...

Dale
----- "Juan" <[hidden email]> wrote:

| hi
| the browser show me that method.
| the inspector show me the instances of correct class.
| the execution stop in this message with dnu.
| but method dictionary of that class show this selector
| i 'don't  know how proceed.
| best regards
| MDC
|
| On Wed, Feb 24, 2010 at 10:09 PM, Sean Allen
| <[hidden email]> wrote:
| >>> How do you know that the method 'is there'?
| >> yes
| >
| > How do you know the method 'is there'?
| >
| > Was this instance created before you added the method to the class?
| >
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Juan-2
Dale

Ok , tomorrow i post that information,
very very thanks for you time response and support.

Best
Juan


On Wed, Feb 24, 2010 at 10:26 PM, Dale Henrichs
<[hidden email]> wrote:

> Juan,
>
> A stack trace would be a good place to start ... I am suspicious about Class History, so I am interested in tracing back to discover how the instance was created. Could you show us the method or script where these instance would be created?
>
> BTW, in GemTools Launcher the annotation looks like this:
>
>  1.0-beta.8 workspace: 'GLASS' auto: [commit migrate] backup: '1.0-beta.8.dbf'
>
> Could you copy and paste you annotation pane. I am interested in finding out if you have autoMigrate set or not, since that _will_ affect an instance and whether or not the methods are visible...
>
> Dale
> ----- "Juan" <[hidden email]> wrote:
>
> | hi
> | the browser show me that method.
> | the inspector show me the instances of correct class.
> | the execution stop in this message with dnu.
> | but method dictionary of that class show this selector
> | i 'don't  know how proceed.
> | best regards
> | MDC
> |
> | On Wed, Feb 24, 2010 at 10:09 PM, Sean Allen
> | <[hidden email]> wrote:
> | >>> How do you know that the method 'is there'?
> | >> yes
> | >
> | > How do you know the method 'is there'?
> | >
> | > Was this instance created before you added the method to the class?
> | >
>
Reply | Threaded
Open this post in threaded view
|

Re: error dNU

Carla F. Griggio
It also happened to me once (I work with Juan). I had auto-migrate and auto-commit ON, but the problem still occurred. I tried to work around some solution playing with the class's versions, but in the end I discarded the 'bad' instances (as I was just testing, it didn't really matter).

If I made a new instance of the same class, it did understand all the messages it was supposed to.

Too bad to here about that again :(

On Wed, Feb 24, 2010 at 11:28 PM, Juan <[hidden email]> wrote:
Dale

Ok , tomorrow i post that information,
very very thanks for you time response and support.

Best
Juan


On Wed, Feb 24, 2010 at 10:26 PM, Dale Henrichs
<[hidden email]> wrote:
> Juan,
>
> A stack trace would be a good place to start ... I am suspicious about Class History, so I am interested in tracing back to discover how the instance was created. Could you show us the method or script where these instance would be created?
>
> BTW, in GemTools Launcher the annotation looks like this:
>
>  1.0-beta.8 workspace: 'GLASS' auto: [commit migrate] backup: '1.0-beta.8.dbf'
>
> Could you copy and paste you annotation pane. I am interested in finding out if you have autoMigrate set or not, since that _will_ affect an instance and whether or not the methods are visible...
>
> Dale
> ----- "Juan" <[hidden email]> wrote:
>
> | hi
> | the browser show me that method.
> | the inspector show me the instances of correct class.
> | the execution stop in this message with dnu.
> | but method dictionary of that class show this selector
> | i 'don't  know how proceed.
> | best regards
> | MDC
> |
> | On Wed, Feb 24, 2010 at 10:09 PM, Sean Allen
> | <[hidden email]> wrote:
> | >>> How do you know that the method 'is there'?
> | >> yes
> | >
> | > How do you know the method 'is there'?
> | >
> | > Was this instance created before you added the method to the class?
> | >
>

Reply | Threaded
Open this post in threaded view
|

Re: error dNU

EstebanLM
hi,
be aware! gemstone classes are NOT immutable... you shouldn't use class as a key as you do usually in Pharo (better keep the class name and perform an Smalltalk at: when needed)
I had this problem and it was painful until I realize that. 
I wrote a small script to make sure my application was keeping just the latest versions: 

| classes |
{ 'MA'. 'ME'. 'MO'. 'WA'. 'SU'. 'JQ'. 'DC'. 'CM'. } do: [ :prefix | 
[ classes := ((Object allSubclasses
select: [ :each | each name beginsWith: prefix ]) 
select: [ :each | each classHistory size > 1 ]). 
classes size > 0  ]
whileTrue: [ 
[ classes do: [ :eachClass | 
| aClass |
aClass := eachClass.
1 to: ( aClass classHistory size - 1)
do: [ :each | aClass classHistory removeVersion: ( aClass classHistory at: each) ] ] ] 
on: Error do: [ :e | ] ] ].

(change the array with your own prefixes)

but anyway, you need to replace your class reference instances with names... otherwise, you will live in a world of pain :)

Cheers,
Esteban


El 24/02/2010, a las 11:04p.m., Carla F. Griggio escribió:

It also happened to me once (I work with Juan). I had auto-migrate and auto-commit ON, but the problem still occurred. I tried to work around some solution playing with the class's versions, but in the end I discarded the 'bad' instances (as I was just testing, it didn't really matter).

If I made a new instance of the same class, it did understand all the messages it was supposed to.

Too bad to here about that again :(

On Wed, Feb 24, 2010 at 11:28 PM, Juan <[hidden email]> wrote:
Dale

Ok , tomorrow i post that information,
very very thanks for you time response and support.

Best
Juan


On Wed, Feb 24, 2010 at 10:26 PM, Dale Henrichs
<[hidden email]> wrote:
> Juan,
>
> A stack trace would be a good place to start ... I am suspicious about Class History, so I am interested in tracing back to discover how the instance was created. Could you show us the method or script where these instance would be created?
>
> BTW, in GemTools Launcher the annotation looks like this:
>
>  1.0-beta.8 workspace: 'GLASS' auto: [commit migrate] backup: '1.0-beta.8.dbf'
>
> Could you copy and paste you annotation pane. I am interested in finding out if you have autoMigrate set or not, since that _will_ affect an instance and whether or not the methods are visible...
>
> Dale
> ----- "Juan" <[hidden email]> wrote:
>
> | hi
> | the browser show me that method.
> | the inspector show me the instances of correct class.
> | the execution stop in this message with dnu.
> | but method dictionary of that class show this selector
> | i 'don't  know how proceed.
> | best regards
> | MDC
> |
> | On Wed, Feb 24, 2010 at 10:09 PM, Sean Allen
> | <[hidden email]> wrote:
> | >>> How do you know that the method 'is there'?
> | >> yes
> | >
> | > How do you know the method 'is there'?
> | >
> | > Was this instance created before you added the method to the class?
> | >
>