I am playing around with CB 3 and CF9 ORM. I am not sure its wiring
everything up correctly as I get the message...
Error Messages: Mapping for component user not found.
Either the mapping for this component is missing or the application
must be restarted to generate the mapping.
I have followed the sample app 'task manager' but think i have missed
something..
That's a error thrown by ColdFusion, rather than Coldbox. Try calling
ORMReload() (don't use this in production!), this tells ColdFusion to
reload all ORM settings (as it caches quite a lot of stuff)
and should it be entityService? I have tired "userService:user" and
still no joy. from my understanding this means to to inject the user
object into the userService?
it still cannot find the user object the error is....
Application Execution Exception
Error Type: Application : [N/A]
Error Messages: Mapping for component user not found.
Either the mapping for this component is missing or the application
must be restarted to generate the mapping.
ID: CF_CFPAGE
LINE: 348
Template: C:\inetpub\wwwroot\cms.yourbrandreality.co.uk\coldbox\system
\orm\hibernate\BaseORMService.cfc
ID: CF_SUPERSCOPE
LINE: 97
Template: C:\inetpub\wwwroot\cms.yourbrandreality.co.uk\coldbox\system
\orm\hibernate\VirtualEntityService.cfc
that's a good point @Mark thanks for the links. using ColdSpring I
took the road the other way around and found it easy seeing demos in
CB outside and then it made sense. but I think I will go and look at
ORM first also. the dependency injection tho is CB error and I think
this is where I am falling here with this, but I agree I need to look
at ORM outside of CB first. if I can just get the dependency to work
here this is where I will start. I understand about objects and using
the model approach and a bit about ORM from my JAVA days.
@ Andrew, yes the model/userService.cfc and model/user.cfc is in the
same folder as the ORMEventHandler which is what CB uses to invoke CF9
ORM from what I understand.
to see if someone can spot anything here is all the files with the
relevant parts...
There are a couple of things that is going on. One the user entity has
errors. So I replaced the properties with ones I knew worked, and found that
your userService has the method getUser instead of get.
Once I fixed those two things up it all worked fine.
cool i have an error I understand now lol. looks like i am now
getting somewhere, i have a bit more to learn on CF9 syntax. its not
so much the methodology I am lucky in that respect from JAVA OO but
the syntax thanks for you help.
Also, I have found that on Mac OS for some reason it was not respecting (coldfusion) my orm entities by name like User. Throwing the same error you showed.
What I did to make it work was use full path notation of where my User was in my app: myApp.model.User
For some reason this worked in windows but not on OS X, something with coldfusion. Another workaround,
was to create a self pointing mapping on the application.cfc to my app and using that instead.