Jun 4th, 2010, 11:34 AM
XML Schema errors
Hi, I'm getting the following exception when deploying a WAR file that uses the osgi namespace in its applicationContext.xml:
[2010-06-04 17:25:54.898] http-8080-1 org.springframework.beans.factory.xml.XmlBeanDefin itionReader Ignored XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/osgi/spring-osgi.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
Subsequently the web application context fails to start due to an XML validation error:
[2010-06-04 17:25:54.898] http-8080-1 org.springframework.web.servlet.DispatcherServlet Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 170 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'osgi:reference'.
I saw a message in another thread in which Costin recommended recreating the project, however this does not appear to be a build error. I have tried restarting dm Server with the -clean flag and also wiped the "work/" directory, but this had no effect.
The machine on which this server is running does have internet access, via an authenticated proxy, but obviously I would prefer it to use the schema that should be included in the distribution rather than downloading it.
Jun 7th, 2010, 05:00 AM
I have been able to workaround these errors by configuring the Java HTTP proxy settings in the environment (i.e. -Dhttp.proxyHost etc) but obviously this is still not ideal as it requires the server to have internet access.
Jun 7th, 2010, 08:33 AM
Now I have discovered that the correct solution to this problem is to:
a) Use the schema URL "http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd", rather than just "ttp://www.springframework.org/schema/osgi/spring-osgi.xsd" as specified in some parts of the dm Server Programmer's Guide document (i.e. don't omit the Schema version).
b) Ensure that the package "org.springframework.osgi.config" is imported by the bundle.
Tags for this Thread