hi guys
I'm following the Pharo MOOC and I'm at Week 4. the other day, I was trying to implement TinyBlog: Data Persistency using Voyage and Mongo, when I tried to compile the code, I've got an Error. the title of Error says: "MessageNotUnderstood: receiver of "save:" is nil", and it refers to TBMBlog>>writeBlogPost. TBMBlog>>writeBlogPost: aTBMPost posts add: aTBMPost. aTBMPost save. self save . thanks for your answers! -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html |
Hi,
You are missing to initialise the Voyage repository. I don’t know how is explained in the Mooc, but you will probably need to do something like: VOMemoryRepository new enableSingleton. Cheers, Esteban
|
EstebanLM wrote
> Hi, > > You are missing to initialise the Voyage repository. > I don’t know how is explained in the Mooc, but you will probably need to > do something like: > > VOMemoryRepository new enableSingleton. > > Cheers, > Esteban Hi Esteban. actually I'm using an External Mongo database and in the MOOC the initialization of Voyage Mongo repository, is done like: TBBlog class >> initializeLocalhostMongoDB | repository | repository := VOMongoRepository database: 'tinyblog'. repository enableSingleton. TBBlog class >> reset self initializeLocalhostMongoDB and in my code I'm doing exactly like above. but interestingly when I wanted to reset the cache of Voyage by: VORepository current reset again I've got another Error saying: "MessageNotUnderstood: receiver of "reset" is nill". thanks anyway! -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html |
Which again, should means you never executed initializeLocalhostMongoDB method. Can you try doing: TBBlock initializeLocalhostMongoDB. Esteban |
> Which again, should means you never executed initializeLocalhostMongoDB > method. > Can you try doing: > > TBBlock initializeLocalhostMongoDB. > > Esteban You were right Esteban, finally I fixed it by manually executing the code below at Playground: | repository | repository := VOMongoRepository database: 'tinyblog'. repository enableSingleton . Even thought I was putting the above code at initialize method of TBMBlog, but I don't know why its never get executed! Thank you very much for your help! -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html |
On Fri, Nov 23, 2018 at 1:25 PM iu136 via Pharo-users
<[hidden email]> wrote: > > You were right Esteban, finally I fixed it by manually executing the code > below at Playground: > > | repository | > repository := VOMongoRepository database: 'tinyblog'. > repository enableSingleton . > > Even thought I was putting the above code at initialize method of TBMBlog, > but I don't know why its never get executed! Hi, Class initialisation methods are executed at loading. If you write the method the first time it will not execute it by default. > Thank you very much for your help! > > > > > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html > -- Cyril Ferlicot https://ferlicot.fr |
Free forum by Nabble | Edit this page |