Announcement Announcement Module
Collapse
No announcement yet.
problem with int-jdbc:outbound-channel-adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with int-jdbc:outbound-channel-adapter

    hello,
    this is my first post in this forum, I am a beginner in Spring Integration
    I make a program for write in a database from a file....
    according to my log, the problem is in a shema 'http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd' and in channel="agencyOutput"

    int-jdbc:outbound-channel-adapter
    query="insert into `spring`(`id`, `name`) values (:headers[id], ayload.toSingleValueMap())"
    data-source="dataSource" channel="agencyOutput" />
    Code:
    <?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:int="http://www.springframework.org/schema/integration"
    	xmlns:int-file="http://www.springframework.org/schema/integration/file"
    	xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
    	xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
    	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.xsd
           http://www.springframework.org/schema/integration/file
           http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
           http://www.springframework.org/schema/integration/xml
           http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd
           http://www.springframework.org/schema/integration/stream
           http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
           http://www.springframework.org/schema/integration/jdbc
           http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd
           ">
    
    	<!-- intercept and log every message -->
    	<int:logging-channel-adapter id="logger"
    		level="DEBUG" />
    	<int:wire-tap channel="logger" />
    
    	<int-file:inbound-channel-adapter id="filesIn"
    		directory="file:${input.directory}" prevent-duplicates="true"
    		channel="messageChannel">
    		<int:poller />
    	</int-file:inbound-channel-adapter>
    
    	<int:channel id="messageChannel" />
    
    	<int-file:file-to-string-transformer
    		input-channel="messageChannel" output-channel="strings" />
    
    	<int:channel id="strings" />
    
    	<int:recipient-list-router id="customRouter"
    		input-channel="strings" timeout="2000" ignore-send-failures="true"
    		apply-sequence="true">
    		<int:recipient channel="agency" />
    		<int:recipient channel="calendar" />
    		<int:recipient channel="routes" />
    		<int:recipient channel="stop_times" />
    		<int:recipient channel="stops" />
    		<int:recipient channel="trip" />
    	</int:recipient-list-router>
    
    	<int:channel id="agency" />
    	<int:channel id="calendar" />
    
    	<int-xml:xslt-transformer id="agencyXSL"
    		input-channel="agency" output-channel="agencyOutput" xsl-resource="file:${xsl.agency}" />
    	<int:channel id="agencyOutput" />
    	<int-jdbc:outbound-channel-adapter
    		query="insert into `spring`(`id`, `name`) values (:headers[id], :payload.toSingleValueMap())"
    		data-source="dataSource" channel="agencyOutput" />
    
    </beans>
    Code:
    10:41:12.364 WARN  [net.test.pst.neptunes2gtfs.Neptunes2GtfsApplication.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 docum
    ent could not be read; 3) the root element of the document is not <xsd:schema>.
          
    Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Fa
    iled to import bean definitions from relative location [neptunes2gtfs-int-schema.xml]
    Offending resource: class path resource [neptunes2gtfs-context.xml]; nested exception is org.springframework.b
    eans.factory.xml.XmlBeanDefinitionStoreException: Line 61 in XML document from class path resource [neptunes2g
    tfs-int-schema.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'.
    
    
    Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 61 in XML document from
     class path resource [neptunes2gtfs-int-schema.xml] is invalid; nested exception is org.xml.sax.SAXParseExcept
    ion: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int
    -jdbc:outbound-channel-adapter'.
    
    -----------------------------------------------------------------------
    [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project spring-
    integration-neptunes2gtfs: An exception occured while executing the Java class. null: InvocationTargetExceptio
    n: Configuration problem: Failed to import bean definitions from relative location [neptunes2gtfs-int-schema.x
    ml]
    [ERROR] Offending resource: class path resource [neptunes2gtfs-context.xml]; nested exception is org.springfra
    mework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 61 in XML document from class path resource [ne
    ptunes2gtfs-int-schema.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-a
    dapter'.
    [ERROR] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    help please !
    thanks in advance

  • #2
    Hi!

    You should be sure that you have in the CLASSPATH the latest Spring Integration jars:
    http://www.springsource.org/spring-integration#maven
    Now it looks like you have Spring Integration 1.0

    Take care,
    Artem

    Comment


    • #3
      yes, I have already spring Integration jars
      this is my pom
      Code:
      <dependencies>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-context</artifactId>
      			<version>3.2.1.RELEASE</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.integration</groupId>
      			<artifactId>spring-integration-core</artifactId>
      			<version>2.2.3.RELEASE</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.integration</groupId>
      			<artifactId>spring-integration-file</artifactId>
      			<version>2.2.3.RELEASE</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.integration</groupId>
      			<artifactId>spring-integration-stream</artifactId>
      			<version>2.2.3.RELEASE</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.integration</groupId>
      			<artifactId>spring-integration-xml</artifactId>
      			<version>2.2.3.RELEASE</version>
      		</dependency>
      
      		<dependency>
      			<groupId>log4j</groupId>
      			<artifactId>log4j</artifactId>
      			<version>1.2.16</version>
      		</dependency>
      		<dependency>
      			<groupId>com.google.guava</groupId>
      			<artifactId>guava</artifactId>
      			<version>13.0.1</version>
      		</dependency>
      		<dependency>
      			<groupId>org.testng</groupId>
      			<artifactId>testng</artifactId>
      			<version>6.5.2</version>
      		</dependency>
      		<!-- MySQL database driver -->
      		<dependency>
      			<groupId>mysql</groupId>
      			<artifactId>mysql-connector-java</artifactId>
      			<version>5.1.9</version>
      		</dependency>
      
      		<!-- spring-jdbc -->
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-jdbc</artifactId>
      			<version>3.2.3.RELEASE</version>
      		</dependency>
      
      	</dependencies>

      Comment


      • #4
        Right. But there is no this dependency:
        HTML Code:
        <dependency>
        	<groupId>org.springframework.integration</groupId>
        	<artifactId>spring-integration-jdbc</artifactId>
        	<version>2.2.3.RELEASE</version>
        </dependency>

        Comment


        • #5
          ok, thank you very much

          Comment

          Working...
          X