When getting this error when trying to access a database configured with OJB, then check the XML-files referenced by the repository.xml file. If you find a XML-header then remove it and it should work fine again.
I had the problem when I wanted to dynamically change the repository_database.xml file and then tried to access the MetadataManager, which accessed the configuration file(s). When I wrote the XML file with the TransformerFactory I had to do the following to remove the header:
ClassPathResource input = new ClassPathResource("repository_database.xml");
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(input.getURI().getPath());