Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Failed to read schema document / blueprint.xsd Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed to read schema document / blueprint.xsd

    I am trying to get Spring DM 2.0.0 working with Equinox 3.5.1
    My spring config file is a minimal one as in the examples:

    <?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:osgi="http://www.springframework.org/schema/osgi"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <bean id="documentUtilities"
    class="org.epo.dg3.casap.client.editor.document.im pl.DocumentUtilitiesImpl">
    </bean>

    </beans>

    However when the spring extender starts, I get the error:

    "org.xml.sax.SAXParseException: schema_
    reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.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>."

    I don't understand where the reference to "blueprint" is coming from?
    Can anyone help?

    The full output from equinox is:
    osgi> 02-Feb-2010 17:03:51 org.springframework.osgi.extender.internal.boot.Ch ainActivator <init>
    INFO: Blueprint API detected; enabling Blueprint Container functionality
    02-Feb-2010 17:03:51 org.springframework.osgi.extender.internal.activat or.ContextLoaderListener start
    INFO: Starting [org.springframework.osgi.extender] bundle v.[2.0.0.M1]
    02-Feb-2010 17:03:51 org.springframework.osgi.extender.internal.support .ExtenderConfiguration <init>
    INFO: No custom extender configuration detected; using defaults...
    02-Feb-2010 17:03:52 org.springframework.scheduling.timer.TimerTaskExec utor afterPropertiesSet
    INFO: Initializing Timer
    02-Feb-2010 17:03:52 org.springframework.osgi.extender.support.DefaultO sgiApplicationContextCreator createApplicationCon
    text
    INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [EPO Editor Document (org.epo.dg3.casap.cl
    ient.editor.document)]
    02-Feb-2010 17:03:52 org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing OsgiBundleXmlApplicationContext(bundle=org.epo.dg3 .casap.client.editor.document, config=osgibundle:/MET
    A-INF/spring/*.xml): startup date [Tue Feb 02 17:03:52 CET 2010]; root of context hierarchy
    02-Feb-2010 17:03:52 org.springframework.osgi.context.support.AbstractO sgiBundleApplicationContext unpublishContextAsOsg
    iService
    INFO: Application Context service already unpublished
    02-Feb-2010 17:03:52 org.springframework.osgi.extender.internal.bluepri nt.event.EventAdminDispatcher <clinit>
    INFO: EventAdmin package not found; no Blueprint lifecycle events will be published
    02-Feb-2010 17:03:52 org.springframework.osgi.extender.internal.activat or.ContextLoaderListener start
    INFO: Starting [org.springframework.osgi.extender] bundle v.[2.0.0.M1]
    02-Feb-2010 17:03:52 org.springframework.osgi.extender.internal.support .ExtenderConfiguration <init>
    INFO: No custom extender configuration detected; using defaults...
    02-Feb-2010 17:03:52 org.springframework.scheduling.timer.TimerTaskExec utor afterPropertiesSet
    INFO: Initializing Timer
    02-Feb-2010 17:03:52 org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from URL [bundleentry://12.fwk5383406/META-INF/spring/document-context.xml]
    02-Feb-2010 17:03:54 org.springframework.osgi.extender.internal.support .DefaultOsgiBundleApplicationContextListener onOs
    giApplicationEvent
    SEVERE: Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.epo.dg 3.casap.client.editor.docum
    ent, config=osgibundle:/META-INF/spring/*.xml))
    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 5 in XML document from URL [bundleentry://12
    .fwk5383406/META-INF/spring/document-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: schema_
    reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.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>.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.j
    ava:378)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.jav
    a:316)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.jav
    a:284)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefini
    tionReader.java:143)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefini
    tionReader.java:178)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefini
    tionReader.java:149)
    at org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext.loadBeanDefinitions(OsgiBun dleXmlApp
    licationContext.java:172)
    at org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext.loadBeanDefinitions(OsgiBun dleXmlApp
    licationContext.java:142)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefresha
    bleApplicationContext.java:127)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationCont
    ext.java:429)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.access$800(Abs tractDele
    gatedExecutionApplicationContext.java:62)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext$3.run(Abstract Delegated
    ExecutionApplicationContext.java:244)
    at org.springframework.osgi.util.internal.PrivilegedU tils.executeWithCustomTCCL(PrivilegedUtils.java:87 )
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.startRefresh(A bstractDe
    legatedExecutionApplicationContext.java:222)
    at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor.st
    ageOne(DependencyWaiterApplicationContextExecutor. java:225)
    at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor.re
    fresh(DependencyWaiterApplicationContextExecutor.j ava:178)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.refresh(Abstra ctDelegat
    edExecutionApplicationContext.java:159)
    at org.springframework.osgi.extender.internal.activat or.LifecycleManager$1.run(LifecycleManager.java:22 3)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/
    blueprint/v1.0.0/blueprint.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>.
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.getSchemaDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.parseSchema(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maLoader.loadSchema(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maLoader.processJAXPSchemaSource(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maLoader.loadSchema(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.findSchemaGrammar(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl$NSContentDriver.scanRootElementHook (Unknown
    Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDriver.next(Un known Sou
    rce)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(Unknown Source)
    at

  • #2
    Could you double check the META-INF/spring/document-context.xml resource in bundle 12? Make sure that you have the version installed by the framework (which might be an old one due to caching).
    Spring DM loads the schema only if required by the configuration file - moreover, this particular schema is already available to Spring DM which makes this error even stranger.
    Could you install a minimum number of bundles and then post the list here (using [c o d e] tags please)?

    Thanks

    Comment


    • #3
      Works in Felix

      Hello,
      Since being unable to solve this error I deployed my application in Felix instead of Equinox and it all works fine. However after retrying in Equinox I am still getting the same mysterious error on all my bundles:

      Code:
      Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/
      blueprint/v1.0.0/blueprint.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>.
              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown
      Source)
              at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Sou
      rce)
              at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
              at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
              at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
              at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.j
      ava:388)
      >Could you double check the
      >META-INF/spring/document-context.xml resource in >bundle 12? Make sure that you have the version installed >by the framework (which might be an old one due to >caching).

      I don't quite understand, document-context.xml is my own...

      >Spring DM loads the schema only if required by the >configuration file - moreover, this particular schema is >already available to Spring DM which makes this error >even stranger.

      It's strange to me that it can work fine in Felix but not Equinox...
      Any suggestions much appreciated.

      Comment


      • #4
        I don't quite understand, document-context.xml is my own...
        Right however each platform has its own internal cache and sometimes, the platform keeps reusing an older version and ignored other changes. I don't know how you are starting Equinox but try using the "-clean" parameter (there's an equivalent for it, if you're using the .ini file).

        It's strange to me that it can work fine in Felix but not Equinox...
        Indeed. Could you please raise an issue on JIRA with a minimal bundle that exposes your problem and some information about your setup, such as the bundles contained in each platform and the versions of Equinox and Felix used along with the stracktrace?
        Things are working just fine locally and on the build server and I can't seem to reproduce the problem on my side.

        Comment


        • #5
          Similiar Problem

          Hallo,

          I tried the same like Beeron with Eclipse 3.5.1 and the spring-osgi-2.0.0.M1 release, espacially for an Eclipse RCP application.

          I started with the Eclipse Hello RCP Template Project and got the same Errors like Beeron.

          Here is the console output:
          Code:
          osgi> 0    [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.boot.ChainActivator  - Blueprint API detected; enabling Blueprint Container functionality
          16   [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.activator.ContextLoaderListener  - Starting [org.springframework.osgi.extender] bundle v.[2.0.0.M1]
          78   [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.activator.ContextLoaderListener  - No custom extender configuration detected; using defaults...
          78   [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.support.ExtenderConfiguration$1  - Initializing Timer
          109  [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.blueprint.activator.BlueprintLoaderListener  - Starting [org.springframework.osgi.extender] bundle v.[2.0.0.M1]
          125  [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.blueprint.activator.BlueprintLoaderListener  - No custom extender configuration detected; using defaults...
          125  [Start Level Event Dispatcher] INFO  org.springframework.osgi.extender.internal.support.ExtenderConfiguration$1  - Initializing Timer
          266  [main] INFO  org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator  - Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [Test2 (Test2; singleton:=true)]
          297  [SpringOsgiExtenderThread-1] INFO  org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext  - Refreshing OsgiBundleXmlApplicationContext(bundle=Test2, config=osgibundle:/META-INF/spring/*.xml): startup date [Mon Mar 01 16:21:59 CET 2010]; root of context hierarchy
          297  [SpringOsgiExtenderThread-1] INFO  org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext  - Application Context service already unpublished
          344  [SpringOsgiExtenderThread-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from URL [bundleentry://28.fwk5538765/META-INF/spring/services-context.xml]
          21250 [SpringOsgiExtenderThread-1] ERROR org.springframework.osgi.extender.internal.activator.ContextLoaderListener  - Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=Test2, config=osgibundle:/META-INF/spring/*.xml))
          org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from URL [bundleentry://28.fwk5538765/META-INF/spring/services-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.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>.
          	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:378)
          	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316)
          	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:284)
          	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
          	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
          	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
          	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:172)
          	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
          	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127)
          	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:429)
          	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:62)
          	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:244)
          	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:87)
          	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:222)
          	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:225)
          	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:178)
          	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:159)
          	at org.springframework.osgi.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:223)
          	at java.lang.Thread.run(Thread.java:619)
          Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.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>.
          	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
          	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
          	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
          	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
          	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2541)
          	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
          	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:1825)
          	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:531)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:713)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:550)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2408)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1753)
          	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
          	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
          	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
          	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3095)
          	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
          	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
          	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
          	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
          	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
          	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
          	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
          	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
          	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
          	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
          	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:370)
          	... 18 more
          21265 [SpringOsgiExtenderThread-1] ERROR org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor  - Unable to create application context for [Test2], unsatisfied dependencies: none
          org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from URL [bundleentry://28.fwk5538765/META-INF/spring/services-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.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>.
          So I tried the same without a RCP application but only with a simple plugin project.
          All worked fine (i did not change my target platform or something else).

          Can anybody reproduce this or has a running example?

          Regards
          Max

          Comment


          • #6
            Similar issues

            I had similar issues with xml schema parsing inside an Equinox environment which also runs Eclipse RCP. I had to set startup levels to 4 for several Spring bundles (e.g. org.springframework.aop) for the XML reader to recognize schema definitions within the bundles.

            It still seems it cannot find all schema definitions from within the bundles and it downloads them from the internet (I'm starting to wonder if I should set all start levels to 4 to fix this). When internet is up it now works for me, but Spring starts up very slowly when reading the XML files.

            That it connects to the internet for reading schema files was also proven today when I had this error when my internet connection was down:

            Code:
            org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.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>.

            Comment


            • #7
              Well, I just tried my idea and I set org.springframework.beans and org.springframework.context to auto-start (don't forget this!) with a start level of 4. The start up time of my Eclipse RCP application (which uses Spring to connect to a server) went from 17s to only 6s!!!!!.

              For more on these start levels, see Ralf Ebers blog.

              I'm not sure if this is the correct way to do this, but I'm sure happy that it works!!!

              Note: something like this used to be logged, see how long it used to take to only load the XML files:

              Code:
              17:02:37,979 INFO  [SpringOsgiExtenderThread-7] activator.ContextLoaderListener - Application context successfully refreshed (OsgiBundleXmlApplicationContext(bundle=nl.hm.ilja.user, config=osgibundle:/META-INF/spring/*.xml))
              17:02:38,244 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/notification-osgi-context.xml]
              Application Started: 5432
              17:02:39,493 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/notificationClientJMS.xml]
              17:02:40,477 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/pessimisticLockManagerClient.xml]
              17:02:41,491 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/security-client-osgi-context.xml]
              17:02:42,662 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/sessionClient.xml]
              17:02:43,630 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/common/securityCommon.xml]
              Compare this with how long it takes now:
              Code:
              17:10:32,451 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/clientSideCacheFlush.xml]
              Starting application: 2144
              17:10:32,550 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/locking-osgi-context.xml]
              17:10:32,601 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/notification-osgi-context.xml]
              17:10:32,632 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/notificationClientJMS.xml]
              17:10:32,685 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/pessimisticLockManagerClient.xml]
              17:10:32,712 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/security-client-osgi-context.xml]
              17:10:32,815 INFO  [SpringOsgiExtenderThread-3] xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [bundleentry://175.fwk18378667/META-INF/spring/client/sessionClient.xml]
              17:
              Last edited by SlowStrider; Mar 8th, 2010, 02:36 PM.

              Comment


              • #8
                Hallo SlowStrider,
                thank you for your answer.

                I tried your solution but it does not work for me. I have the additional problem, that i'm behind a firewall and i do not know how i can configure the http proxy for my rcp app so that it can load the shema files from web.

                Furthermore I do not understand why Spring tries to load the blueprint shema from web at all:
                1) I configured my xml files to use only spring namespaces without any OSGi-Blueprint content.
                Is this a error in the current release 2.0.0.M1?
                2) As i can see in the spring jars (e.g. spring-osgi-core-2.0.0.M1.jar\org\springframework\osgi\blueprint\co nfig), the xsd files are present and so it should only be necessary to load the files from the file system and not from web. If i start the bundle spring-osgi-core before the extender bundle, spring discovers the xsd files, but it seems that the content is not correct.
                I get following error message:
                Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.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>
                Any ideas?

                Perhaps it is possible to use a cache or provide the shema programatically.
                An other question is why it works when i do not deploy a rcp app, but only a plugin. Is it possible, that in this case the eclipse cache and configured proxy settings are used?

                Regards
                Max
                Last edited by maxost; Mar 8th, 2010, 01:20 PM.

                Comment


                • #9
                  Hi, I forgot to mention that I am also using the 2.0.0.M1 version but that I am using it in combination with the 3.0.0.RELEASE, although I don't know if this matters much.

                  You are right, Spring-DM should find the xsd files from the bundles and shouldn't download them, but when I do not set the same start level AND auto-start true, somehow it does not automatically find them from the non-started bundles and it tries to download them from the internet.
                  Just like you, I did not have this problem when I left out all the Eclipse RCP bundles and started my context with no GUI at all.

                  Have you tried setting auto start and the same start level (4) as the org.springframework.osgi.extender for the following bundles?
                  • your own bundle
                  • org.springframework.core
                  • org.springframework.context
                  • org.springframework.beans
                  • org.springframework.aop

                  I must say I'm not sure if these are all necessary for finding the XSD files, but it seems to work for me.

                  Maybe someone from Spring can clarify when XSD files can be found and when they can't be found by the osgi extender.

                  Comment


                  • #10
                    Hallo SlowStrider,

                    it works, thank you.
                    Actually i only have to set the bundles
                    • org.springframework.core
                    • org.springframework.context
                    • org.springframework.beans
                    • org.springframework.aop
                    to auto-Start.
                    My own bundles were not necessary.

                    Even so, i'm not sure if this is the correct solution and it would be nice if someone from Spring can explain the issue.

                    Regards
                    Max

                    Comment


                    • #11
                      Originally posted by maxost View Post
                      Hallo SlowStrider,

                      it works, thank you.
                      Even so, i'm not sure if this is the correct solution and it would be nice if someone from Spring can explain the issue.

                      Regards
                      Max
                      Glad it works for you too. Exactly my thoughts in your last sentence, it still feels like a hack.

                      Comment


                      • #12
                        Hi guys,

                        If you want an answer, raising a JIRA issue usually helps. As for why this happens, I'm not using Eclipse RCP myself but I suspect its usage of Spring might be the problem.
                        I'll keep you posted.

                        Comment


                        • #13
                          Hello,

                          I'm actually changing the version of Spring DM from 1.2.0.M2 to 2.0.0.M1 and Spring from version 2.5.6 to 3.0.2.RELEASE.
                          Now I have the same problem as SlowStrider and maxost that the xsd-files can't be found during making the application context without setting the start level. But in our productive environment it is not an option to set the start level of individual bundles. So I'm very interesting if there is already an jira issue raised? If so please post the jira number.

                          Thanks

                          Comment


                          • #14
                            Hello,

                            until now i did not raised an JIRA issue. Perhaps SlowStrider did, but i can not find anything.

                            Regards Max

                            Comment


                            • #15
                              Hello maxost,

                              thanks, for your quick reply.
                              I also haven't found a similar issue on jira, so I will raise one.

                              For a temporary workaround, does anybody know how I can disable the validation of the xml files during startup?

                              Comment

                              Working...
                              X