Hello again all.
I am continuing the work on a custom module and have encountered an issue that I cannot figure out how to troubleshoot. The problem is surely in my code, but the error results and location are baffling me at the moment.
I have a custom content type (extends contentbox.model.content.BaseContent) that I have a related service for (closely mimics the other content types). In my service, I have a saveCustomContentType function, just as the built-in services do. When this function is called, everything works fine, but the moment it exits the function back to the calling function (an event in my handler), it crashes with the error:
The root cause of this exception was: coldfusion.orm.hibernate.HibernateSessionException: The value for property java.lang.String cannot be retrieved from object of type contentID. Expected object type is cbContent.
The exact location line 135 of coldbox.system.aop.MethodInvocation.cfc: return instance.interceptors[ instance.interceptorIndex ].invokeMethod( this.incrementInterceptorIndex() );
This is in the proceed() function, inside the if( instance.interceptorIndex LTE instance.interceptorLen ){ conditional. If I put a try/catch around this line and allow processing to continue, the code continues to run.
Back to where in my code this throws the error. If I abort processing just before the return at the end of my saveCustomContentType function, the error is not thrown. If I put the abort immediately following the exit from my saveCustomContentType function, the error is thrown. Obviously the issue is that some update in the transaction is not correct (like other types, my saveCustomContentType function is transactional). But I’m unsure why:
- It’s throwing an error now when earlier in the development process the save did not throw the error (I know, not very helpful)
- What interceptor is running via return instance.interceptors[ instance.interceptorIndex ].invokeMethod( this.incrementInterceptorIndex() ); when the error is thrown. There is only one element in the instance.interceptors array, I just don’t know how to figure out where the interceptor is, and what interception point is running? I’ve searched for the ORMPostUpdate interception, but I can’t find anything that intercepts that point.
I should note that the problem only occurs when I try to publish my custom content. A normal save does not throw any errors.
Like I said, the problem is obviously in my code, I just need help figuring out where the actual error is being thrown so that I can debug it.
Thanks,
John