0

SpringIntegrationとXMLは初めてです。次の構成ファイルを作成しました。

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

http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:component-scan base-package="com.springProject.app"/>
<int:channel id="input"/>
<int:channel id="output">
    <int:queue capacity="10"/>
</int:channel>


<int:service-activator input-channel="input"
                       output-channel="output"
                       ref="messageHandler"/>
</beans>

ただし、IDEからエラーが発生し、「名前空間'int'がバインドされていません」と表示されます。エラーがどこにあるか知っている人はいますか?前もって感謝します!

4

2 に答える 2

1

現在、統合xmlnsはプレフィックスsiにバインドされています。これをintに変更してください。

<?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:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="

4行目の変更に注意してください

または、次のように、接頭辞がinttoのすべてのタグを変更することもできます。si

<si:channel id="input"/>
<si:channel id="output">
    <si:queue capacity="10"/>
</si:channel>
于 2013-01-15T09:57:16.037 に答える
0

Beansタグ xmlns:mvc = "http://www.springframework.org/schema/mvc"に次のテキストを追加 し、xmlファイルを保存します。

于 2016-07-13T06:07:28.070 に答える