1
votes

Hi Can you please help me about it? I am using Spring 4.3.8 in Spring STS IDE. I get this exception: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/ip] Offending resource: class path resource [spring-config.xml]

Maven config:

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

My Spring config is:

<?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-ip="http://www.springframework.org/schema/integration/ip"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
    http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd">

<context:property-placeholder location="classpath:udp-server.properties" />

<bean id="udpConsumer" class="com.example.udp.UDPConsumer" />

<int:channel id="inputChannel">
    <int:queue />
</int:channel>

<int-ip:udp-inbound-channel-adapter id="udpReceiver"
    channel="inputChannel"
    port="${udp-server.port}"
    pool-size="${udp-server.threads}"
    receive-buffer-size="${udp-server.buffer-size}"
    multicast="false"
    check-length="true"/>

<int:service-activator input-channel="inputChannel"
    ref="udpConsumer" />

<int:poller default="true" fixed-rate="500" />

1

1 Answers

1
votes

The integration starter only brings in the spring-integration-core jar, to avoid classpath bloat for jars you don't need; you need to add

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

Boot/Maven will bring in the right version to match the core.