1
votes

I am not able to add attribute "fixed-rate" under the poller tag, giving "Attribute 'fixed-rate' is not allowed to appear in element 'int:poller'.". Please refer below xml file.

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
             xsi:schemaLocation="http://www.springframework.org/schema/integration
             http://www.springframework.org/schema/integration/spring-integration.xsd
             http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/integration/sftp
             http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">

    <int:channel id="fileTransferChannel"/>

    <int:inbound-channel-adapter id="fileTransferChannelAdapter" auto-startup="true" ref="fileTransferCollector" method="poll" channel="fileTransferChannel">
        <int:poller fixed-rate="500"/>
    </int:inbound-channel-adapter>

</beans:beans>

Please help on this


after changing code to

<int:poller>
        	<int:interval-trigger interval="1000" fixed-rate="500"/>
        </int:poller>

I am getting below exception

Offending resource: class path resource [appcont.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 17 in XML document from class path resource [filetransfer.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 66; cvc-complex-type.2.4.a: Invalid content was found starting with element 'int:interval-trigger'. One of '{"http://www.springframework.org/schema/integration":transactional, "http://www.springframework.org/schema/integration":advice-chain}' is expected. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:271) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:196) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:181) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) 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:174) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)

5

5 Answers

0
votes

That's because the schema does not allow the fixed-rate attribute on that element. My guess is that you want this:

<int:inbound-channel-adapter .... >
    <int:poller >
        <int:interval-trigger fixed-rate=".." />
    </int:poller >
</int:inbound-channel-adapter>
0
votes

I've encountered the same problem and I can resolve it like this :

<int:inbound-channel-adapter id="fileTransferChannelAdapter" auto-startup="true" ref="fileTransferCollector" method="poll" channel="fileTransferChannel">
    <int:poller fixed-rate="500">
    </int:poller>
</int:inbound-channel-adapter>
0
votes

I know i am late but i am adding this for someone like me who stumbles upon this. Some times it may be due to simple mistakes like not including spring dependencies. I moved application to spring boot and forgot to include following two dependencies and i received this error. You should add version in the dependencies below if directly using in pom without dependencyManagement BOM of spring integration.

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-integration</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-file</artifactId>
        </dependency>
0
votes

Replace the tag with the below :

<int:poller>
    <int:interval-trigger interval="1000" fixed-rate="500"/>
</int:poller>
0
votes

just by addiing this dependency to pom.xml it worked for me

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-jdbc</artifactId>
</dependency>