I got the same error from using the file based idp.xml and formatting it!!! Don't format it, use curl, or chrome and save the file from https://idp.ssocircle.com/idp-meta.xml directly to spring-security-saml-1.0.2.RELEASE\sample\src\main\resources\metadata\idm.xml
Then in SecurityContext.cml