just some guessing...
You might try to remove the newline and spaces between "xsi:schemaLocation="...." and the first id/schemalocation pair.
If this does not work: try to specify the schema locations on the first element of each xsd, as seen here: http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000JulSep/0235.html. Maybe the JBoss XML parser does not like multiple schema locations...
Hope this helps
Thank you for your suggestions. Have tried them all with no result unfortunately.
I don't know Spring, so I can just try to reproduce what you post here. I tried to deploy a simple webapp with just one file "applicationContext.xml" with the content of your sample, and this worked.
I also tried to deploy the spring 2.5 sample "imagedb", and this also worked besides database errors because I don't have a MySQL database. The sample's applicationContext.xml has the same header as yours.
Could you give the "imagedb" sample a try?
I've now tried to run imagedb on JBoss 5.1.0 in a default server and there are no errors. Seems I have some more investigation to do and compare...
Thanks for the suggestion.
By the process of elimination I've now narrowed it down to a specific file, but can't for the life of me figure out what could be wrong.
The problematic file is my Hibernate/DAO configuration applicationContext-hibernate.xml. Strange however that it seems to fail with the "White spaces" error on the XSD for the first non-default namespace in the XML file.
Here is my "beans" tag:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
When the first non-default namespace tag starts with "<context:", in my case:
the error is:
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/context, baseURI=null, schemaLocation=null
When I remove that line so that the first non-default namespace tag starts with "<tx:", in my case:
<tx:annotation-driven transaction-manager="transactionManager" />
the error is:
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=http://www.springframework.org/schema/tx, baseURI=null, schemaLocation=null
Does that make sense to anyone?
I have the same exception with an applicationContext file in /WEB-INF, but it works fine when putting the context file in an classpath: location or elsewhere but /WEB-INF.
Alexis, yes that is the solution (or rather workaround).
Somehow I didn't understand it before as I had in my mind that Spring was hardwired to read these files from WEB-INF and I misread "a directory under WEB-INF" for "in WEB-INF".
Anyhow, I moved the problematic files into a new directory WEB-INF/appctx, updated my web.xml:
and the "White spaces are required between publicId and systemId" disappeared
I then had to go through a whole bunch of other issues, but I'm running on JBoss 5.1.0 now.
Many thanks for all your support.