What was wrong: When inserting binary and xml-documents into the same collection, a query results in an exception. What did i fix: I changed "Document getDocument(Object key)" to first have a look if the ressource is a binary ressource, and then just returning null instead of an XMLDocument, like if the ressource wasn't there at all. How to test it: I appended a small test class, and my change (not in diff-format, but just replace the corresponding function, please.)
Created attachment 13265 [details] patch
Created attachment 13266 [details] Small program to reproduce the error
Created attachment 13267 [details] Config for small program to replace the error
Use this instead if (!(entry instanceof Document)) { if (log.isErrorEnabled()) { log.error("Message", new DBException(FaultCodes.COL_INVALID_RESULT,"Resource '" + key + "' in collection '" + getCanonicalName() + "' is not a document")); } return null; }
Fixed. Collection.getDocument should throw exception if resource of incorrect type, so fix was done at query resolver level.