[Seaside] VM freezes; how to find the cause?
Bahman Movaqar
Bahman at BahmanM.com
Mon May 27 03:26:00 UTC 2013
On 2013-05-26 16:40, Chris wrote:
> #initalizeMenuComponent and #initializeListComponent are not returning
> anything (and will therefore return self, the StRootComponent) This
> means you will have an infinite loop as StRootComponent contains itself
Oh. I was under the impression that a value is returned only when `^'
operator is used.
> One way to fix it would be to change your initialize method as follows
> as you are already setting the menuComponent and listComponent variables
> in their own initialize methods:
>
> StRootComponent >>#initialize
> super initialize.
> self
> initializeMenuComponent;
> initializeListComponent.
Thanks for the suggestion but it doesn't solve the freeze problem.
>> Apparently `initialize' is done correctly because when I put `self
>> halt.' at the bottom of `initialize' the VM actually halts there. But
>> after pushing the "proceed" button, it freezes again.
>>
>> <code>
>>
>> StRootComponent >>#initialize
>> super initialize.
>> self
>> menuComponent: self initializeMenuComponent;
>> listComponent: self initializeListComponent.
>>
>>
>> StRootComponent >>#initializeListComponent
>> self listComponent: StListComponent new.
>> self listComponent
>> sortBlock: [ :items | items sortBy: [ :a :b | a deadline < b
>> deadline ] ];
>> renderItemBlock: [ :task :html | self renderTask: task asRowOn:
>> html ].
>> self showPendingTasks.
>> self listComponent items: self testTasks.
>>
>>
>> StRootComponent >>#initializeMenuComponent
>> self
>> menuComponent:
>> (StMenuComponent new
>> addEntry: 'All' withAction: [ self showAllTasks ];
>> addEntry: 'Completed' withAction: [ self
>> showCompletedTasks ];
>> addEntry: 'Pending' withAction: [ self
>> showPendingTasks ];
>> addEntry: 'Missed' withAction: [ self showMissedTasks ];
>> yourself)
>>
>>
>> StRootComponent >>#testTasks
>> ^ OrderedCollection
>> with:
>> (StTask new
>> deadline: Date yesterday;
>> completed: false;
>> taskName: 'Missed task')
>> with:
>> (StTask new
>> deadline: Date tomorrow;
>> completed: false;
>> taskName: 'Pending task')
>> with:
>> (StTask new
>> deadline: Date tomorrow;
>> completed: true;
>> taskName: 'Already completed task')
>> </code>
>>
>> On 2013-05-26 15:04, Johan Brichau wrote:
>>> On 26 May 2013, at 12:30, Bahman Movaqar <Bahman at BahmanM.com> wrote:
>>>
>>>> As I said, I'm using Pharo (2.0).
>>> sorry, missed that part.
>>>
>>>> This means that something is going wrong in the `initialize' method,
>>>> right?
>>> Possibly. What is the code of your initialize method?
>>> The most common cause would be an infinite loop by doing a 'self
>>> initialize' instead of a super initialize inside your initialize method.
--
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant
More information about the seaside
mailing list