首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法为XML架构命名空间[http://www.springframework.org/schema/integration/ip定位NamespaceHandler

无法为XML架构命名空间[http://www.springframework.org/schema/integration/ip定位NamespaceHandler
EN

Stack Overflow用户
提问于 2017-05-07 15:52:28
回答 1查看 1.2K关注 0票数 1

嗨,你能帮我一下吗?我在中使用Spring4.3.8。我得到了这个异常: org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法为XML模式命名空间[http://www.springframework.org/schema/integration/ip]定位[http://www.springframework.org/schema/integration/ip]:类路径资源[http://www.springframework.org/schema/integration/ip]-config.xml

Maven配置:

代码语言:javascript
复制
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-integration</artifactId>
</dependency>

我的Spring配置是:

代码语言:javascript
复制
<?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" />

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-07 16:17:07

集成入门器只引入spring-integration-core jar,以避免不需要的jar类路径膨胀;您需要添加

代码语言:javascript
复制
<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-ip</artifactId>
</dependency>

Boot/Maven将引入与核心匹配的正确版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43833512

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档