Hi all
Am working on a fairly mature and functioning application. This morning I opened a browser, called the following commands to ‘reset’ the app after some messing around yesterday (ApplicationStop, ORMReload, fwreinit) and instantly hit this error:
Entity has incorrect type for being called as a function.
The symbol you provided get is not the name of a function.
The error occurs on a line of code in a Service template
var entity = super.get(argumentCollection = arguments);
‘Super’ in this case is the EntityService
EntityService does nothing except extend coldbox.system.orm.hibernate.VirtualEntityService
VirtualEntityService extends coldbox.system.orm.hibernate.BaseORMService
So the error appears to be coming out of BaseORMService (?)
Nothing I do, including a reversal of the small code changes I was working on yesterday, clears this error.
Can anyone help?
I wouldn’t do that to be honest.
Hi Andrew
Which part in particular?
super.get() I was trying to also work out why you are doing that.
In truth I couldn’t say. This is a legacy app, not originally built by me. I am merely building in new features and ironing out bugs, and I am not that familiar with Coldbox ORM (although learning all the time).
In this case, I just now replaced the call to super.get() with an ordinary entityLoadByPK(), and the app is up and running again (phew!).
But I would still be curious to know what was generating the error…
I am assuming that the get is an actual getter, therefor if you extend that you should be able to to just use get. But I am not sure that would work for getters with persistent objects to be honest.
Solved it!
For the record, the Service template had simply stopped extending the EntityService (although I have NO idea why).
To fix it, I changed the javadoc style
/** @extends EntityService */
to ordinary CF-style
component extends=“EntityService”
syntax, did a fwreinit, and all is fine again!
Weird…
cool, yeah I have had issues with Annotations like this before with no explanation.