Are we actually using the spring.schemas files?

Rod Widdowson rdw at steadingsoftware.com
Sun Feb 2 07:06:55 EST 2014


OK,  So I understand this a lot better and realize that I was answering the
question wrongly.

> I *am* pretty certain that at some stage I
> have had a series of schema validation errors

The issue is not about schema validation, but location of the schemata.    A
bit of spelunking also reminded me of previous conversations.  AIUI, the
issue is that attribute resolver file might say something like:

xsi:schemaLocation="URI_1 URI_2"

and our 'spring.schemas' says something like:

URI_1=<location>

If I remember this discussion from before (I didn't understand it then but I
think I do now) is that the format of the 'spring.schemas' file is wrong.
It should be

URI_2=<location>

But that in V2 we forced the issue by some extra code which is not there for
V3.

So, I made the change to the 'spring.schemas' file that Scott suggested:

urn\:mace\:shibboleth\:2.0\:resolver\:ad=schema/shibboleth-2.0-attribute-res
olver-adXXXXXXX.xsd

And nothing broke.

However when I changed a test file to 

    xsi:schemaLocation="

		[SNIP]
		urn:mace:shibboleth:2.0:resolver:ad
random:schema/shibboleth-2.0-attribute-resolver-ad.xsd
                	[SNIP]"

Things broke, but when I added 

random\:schema/shibboleth-2.0-attribute-resolver-ad.xsd=schema/shibboleth-2.
0-attribute-resolver-ad.xsd

to 'spring.schemas' things started working again.

So the answer is not that we are not loading the files, it is just that they
are full of junk.

It seems like the issue now is that we have a lot of legacy files which are
also valid classpath-uri locations (for instance  classpath:schema/
shibboleth-2.0-attribute-resolver-ad.xsd)

I did about 5 minutes experimentation and it turns out that if you put this
classpath-uri (suitably escaped) on the LHS of the 'spring.schemas' file,
the right thing almost happens, in that if the schema is found at the
pointed-to location it is loaded in preference to the one pointed to by the
classpath-uri.  If however there is nothing at the pointed-to location then
the classpath-uri is looked at.  I think, YMMV &c.

/Rod



More information about the dev mailing list