Announcement Announcement Module
Collapse
No announcement yet.
schemaLocation Error: No definition can be found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • schemaLocation Error: No definition can be found

    Hi guys,

    I'm trying to use a simple jdbc outbound channel adapter, but I'm getting the following error (the output has been shortened):

    Code:
    18:00:23.688 WARN  [main][org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Ignored XML validation warning
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.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.warning(ErrorHandlerWrapper.java:96)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)
    Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 85 in XML document from file [...blahblahblah\target\classes\META-INF\spring\integration\spring-integration-context.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 'int-jdbc:outbound-channel-adapter'.
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    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 'int-jdbc:outbound-channel-adapter'.
    	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)
    The schema definition I have is:

    Code:
    xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    	http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/integration
    	http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
    	http://www.springframework.org/schema/integration/file
    	http://www.springframework.org/schema/integration/file/spring-integration-file-2.1.xsd
    	http://www.springframework.org/schema/integration/jdbc
    	http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd"
    And if I go to the actual address I see the schema. My config file looks like:

    Code:
    <int:channel id="dbDataOut" />
    		
    <int-jdbc:outbound-channel-adapter
    	channel="dbDataOut"
    	data-source="dataSource"
    	query="INSERT INTO dataComingInLotsAndLotsOverAndOver (payload) values (:payload)" />	
    
    <bean id="dataSource" 
             class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    	<property name="driverClassName" value="com.mysql.jdbc.Driver" />
    	<property name="url" value="jdbc:mysql://localhost/integrationTesting" />
    	<property name="username" value="root" />
    	<property name="password" value="blahblah" />
    </bean>
    Any ideas? I can't see a data-source attribute in the schema referenced but all the examples that I have seen have one...

    Cheers for any help,
    Tony

  • #2
    Do you have spring-integration-jdbc module on your classpath?

    Comment


    • #3
      Hi Oleg, thanks for replying. I didn't have the dependency in my pom file. A very basic mistake, I apologise. I just assumed that since the auto-complete was working fine, that it knew about it. I then also noticed that I didn't have the mysql driver in the pom either! Anyway, thanks for your help,
      Tony

      Comment

      Working...
      X