Announcement Announcement Module
Collapse
No announcement yet.
spring data neo4j 1.1.0.M2 xsd not found error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring data neo4j 1.1.0.M2 xsd not found error

    Hello, firstly I'm trying to get spring-data-jpa and spring-data-neo4j to work together but the stable releases wont compile since they each depend on different versions of spring-data-commons (there was a repackaging to core.support....).

    Right now i'm trying to get spring-data-jpa.SNAPSHOT and neo4j 1.1.0.M2 (they all depend on spring-data-commons-core 1.1.0.RC1) to work but with M2 getting this error in eclipse:

    Multiple markers at this line
    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'datagraph:config'.
    - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/data/graph/datagraph-1.0.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>.
    - Referenced bean 'graphDatabaseService' not found

    PHP Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:datagraph="http://www.springframework.org/schema/data/graph"
           xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context 
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/data/graph
           http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd">

        <context:annotation-config />
        <context:spring-configured />

        <datagraph:config storeDirectory="data/graph.db"/>
        
    </beans>
    when starting tomcat, here's the error:
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'datagraph:config'.

    I don't know what's causing it since http://www.springframework.org/schem...agraph-1.0.xsd can be resolved and since datagraph-1.0.xsd is also located inside the spring-data-neo4j.jar file.

    Fyi, neo4j RELEASE worked fine (except the jpa would complain). I'm just trying to get spring-data-jpa and spring-data-neo4j to work together so if anyone has different routes for this, i can try those out as well.

    Thanks,
    Dmitri
    Last edited by dmitri926; Jul 21st, 2011, 10:10 AM.

  • #2
    Could you please list all Spring Data related JARs and their versions you have in the classpath?

    Comment


    • #3
      I get this error in eclipse and also when starting the tomcat server. Also i do see the datagraph-1.0.xsd inside the spring-data-neo4j jar. The list of spring-* libs are below the stacktrace.


      2011-07-25 13:18:51,939 - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
      org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring/datagraph.xml]
      Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 18 in XML document from ServletContext resource [/WEB-INF/spring/datagraph.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 'datagraph:config'.
      at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error(FailFastProblemReporter.java :68)
      at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:85)
      at org.springframework.beans.factory.parsing.ReaderCo ntext.error(ReaderContext.java:76)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.importBeanDefinitionResour ce(DefaultBeanDefinitionDocumentReader.java:218)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseDefaultElement(Defaul tBeanDefinitionDocumentReader.java:147)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:132)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:93)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:493)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:390)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
      at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:124)
      at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:93)
      at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:130)
      at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:467)
      at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:397)
      at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
      at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
      at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
      at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3934)
      at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4429)
      at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:722)
      at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
      at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
      at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalin a.java:583)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:413)
      Caused by: org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 18 in XML document from ServletContext resource [/WEB-INF/spring/datagraph.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 'datagraph:config'.
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.importBeanDefinitionResour ce(DefaultBeanDefinitionDocumentReader.java:202)
      ... 33 more
      Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'datagraph:config'.
      at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
      at org.apache.xerces.util.ErrorHandlerWrapper.error(U nknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIEr rorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.repor tSchemaError(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.handl eStartElement(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.empty Element(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
      at org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 75)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:388)
      ... 36 more


      07/25/2011 01:05 PM 437,920 com.springsource.com.thoughtworks.xstream-1.3.1.jar
      07/25/2011 01:05 PM 396,713 com.springsource.org.apache.log4j-1.2.15.jar
      07/25/2011 01:05 PM 25,220 com.springsource.org.xmlpull-1.1.4.c.jar
      07/25/2011 01:05 PM 321,190 spring-aop-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 53,082 spring-asm-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 35,548 spring-aspects-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 555,410 spring-beans-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 668,861 spring-context-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 100,870 spring-context-support-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 382,442 spring-core-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 187,706 spring-data-commons-core-1.1.0.RELEASE.jar
      07/25/2011 01:05 PM 101,459 spring-data-jpa-1.0.0.RELEASE.jar
      07/25/2011 01:05 PM 312,350 spring-data-neo4j-1.1.0.BUILD-20110725.083130-95.jar
      07/25/2011 01:05 PM 169,752 spring-expression-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 508,881 spring-integration-core-2.0.0.RELEASE.jar
      07/25/2011 01:05 PM 39,689 spring-integration-mail-2.0.0.RELEASE.jar
      07/25/2011 01:05 PM 335,484 spring-jdbc-2.5.6.jar
      07/25/2011 01:05 PM 224,641 spring-ldap-core-1.3.0.RELEASE.jar
      07/25/2011 01:05 PM 334,327 spring-orm-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 61,379 spring-oxm-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 78,088 spring-security-acl-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 185,716 spring-security-config-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 311,038 spring-security-core-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 20,818 spring-security-kerberos-core-1.0.0.M2.jar
      07/25/2011 01:05 PM 86,119 spring-security-ldap-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 18,883 spring-security-taglibs-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 242,833 spring-security-web-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 205,278 spring-test-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 231,922 spring-tx-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 395,587 spring-web-3.0.5.RELEASE.jar
      07/25/2011 01:05 PM 418,977 spring-webmvc-3.0.5.RELEASE.jar
      Last edited by dmitri926; Jul 25th, 2011, 02:31 PM.

      Comment


      • #4
        That looks okay AFAICS. Are you sure you are using the exact namespace key and XSD reference like you've shown above? Does it work if you remove the Spring Data JPA stuff from the classpath?

        Comment


        • #5
          Downgrading to spring-data-neo4j 1.0.0.RELEASE clears the XSD errors.
          But i still get an error because the TransactionRepositoryFactoryBeanSupport class was repackaged to "org.springframework.data.repository.core.support.TransactionalRepositoryFactoryBeanSupport "

          Here are the combination i tried (i've also tried different combinations of M and RC and SNAPSHOTS but didnt document), but the main problem i've ran into is the XSD error for neo4j > 1.0.0.RELEASE.

          /********************/
          spring-data-jpa 1.0.0.RELEASE
          spring-data-neo4j 1.0.0.RELEASE
          spring-data-commons-core 1.1.0.RELEASE

          --- Error ---
          Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.support.Transa ctionalRepositoryFactoryBeanSupport
          (referenced from neo4j)
          /********************/
          (removed JPA)
          spring-data-neo4j 1.0.0.RELEASE
          spring-data-commons-core 1.0.0.RELEASE

          --- WORKS ---

          /********************/
          spring-data-neo4j-1.1.0.BUILD-20110725.083130-95
          spring-data-commons-core-1.1.0.RC1

          --- Error ---
          Multiple markers at this line
          - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'datagraph:config'.
          - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/data/graph/datagraph-1.0.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>.
          - Referenced bean 'graphDatabaseService' not found
          /********************/
          spring-data-neo4j-1.1.0.RC1
          spring-data-commons-core-1.1.0.RELEASE

          --- Error ---
          Multiple markers at this line
          - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'datagraph:config'.
          - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/data/graph/datagraph-1.0.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>.
          - Referenced bean 'graphDatabaseService' not found
          /********************/


          Confirmation on these questions will be helpful:
          1) is there some sort of XSD schema issue in spring-data-neo4j > 1.0.0.RELEASE?
          2) what's the compatible combination of data-commons, data-jpa, and data-neo4j?
          Last edited by dmitri926; Jul 26th, 2011, 10:29 AM.

          Comment


          • #6
            Ok, found it, thanks for pointing it out. Unfortunately it didn't show up in the tests, because those use the xsd from the jar, the problem was that the
            META-INF/spring.schemas contained still the package name from before the renaming.

            Pushed a fix to github.

            Thanks

            Michael

            Comment

            Working...
            X