On Feb 16, 2008, at 10:22 AM, Florijan Stamenkovic wrote:
[2008-02-15 16:53:14 EST] <WorkerThread0> Server exception: The fetchSpecification <SNIP/> was not allowed to execute on the server. If your application needs to execute this method, the security needs to be relaxed by implementing the delegate method distributionContextShouldFetchObjectsWithFetchSpecification
The original server-side calls for this were catching the error and just returning null without putting anything in the log.
Interesting... Do you know exactly at which point in your code was this error generated? Was in on the line where you try to retrieve the fetch spec object from the model on the server side? When you try to return that fetch spec over to the client?
The funny thing is that it doesn't actually generate an error. I got that message in the log when I used a logging statement to look at the FetchSpecification immdiately after pulling it from the model:
EOFetchSpecification fs = (EOFetchSpecification) distributedObjectStore().invokeStatelessRemoteMethodWithKeyPath(
"session",
"clientSideRequestGetFetchSpecification",
new Class[] {String.class, String.class },
new String[] { "USDACalories", "NutritionElementType" });
NSLog.out.appendln(fs);
Apperently calling editingContext().objectsWithFetchSpecification(fs) just returns null and doesn't raise an exception.
The funny thing is that I can call this FetchSpecification using the normal invokeRemoteMethod() method of EOCustomObject, but if I try to use the invokeStatelessRemoteMethodWithKeyPath() method of EODistributedObjectStore, then it throws the above error.
So, if I understand you well, now that you've removed the SQL from the spec, you can use also stateless RMI to get it?
Yep. I didn't change anything else.
This is really weird.
Tell me about it.
At first it seemed like a valid security precaution, but the more I think about it, the less sense it makes...
Especially when you can get around it by using EOCustomObject's invokeRemoteMethod(). Seems like maybe it was the beginnings of something, then abandoned and left in.