我在控制台中遇到此错误: java.lang.IllegalArgumentException:无法解析占位符&#39; T(org.springframework.integration.context.IntegrationContextUtils).getIntegrationProperties(beanFactory).getProperty(&#39; spring.integraton.channels.autoCreate&#39;)& #39; in string value&#34; $ {T(org.springframework.integration.context.IntegrationContextUtils).getIntegrationProperties(beanFactory).getProperty(&#39; spring.integraton.channels.autoCreate&#39;)}&#34; < / p>
使用spring integration 4.1.5.RELEASE
<int:channel id="mailChannel"/>
<int-mail:inbound-channel-adapter id="emailReceiverAdapter"
store-uri="imaps://username:password@imap.mail.yahoo.com:993/inbox"
channel="receiveChannel"
auto-startup="true"
should-delete-messages="false"
should-mark-messages-as-read="false"
java-mail-properties="javaMailProperties"
max-fetch-size="1">
<int:poller max-messages-per-poll="1" fixed-rate="10000"/>
</int-mail:inbound-channel-adapter>
<bean id="mailReceiver" class="com.company.email.EmailReceiver"/>
<int:service-activator input-channel="receiveChannel" ref="mailReceiver" method="process"/>
<util:properties id="javaMailProperties">
<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.imap.socketFactory.fallback">false</prop>
<prop key="mail.store.protocol">imap</prop>
<prop key="mail.debug">false</prop>
</util:properties>
在测试中一切运行正常,但是当我启动应用程序时,我收到了错误。
答案 0 :(得分:1)
在Spring集成迁移指南
中找到了这个从版本3.0开始的Spring集成引入了全局 选项,可以使用META-INF / integration.properties进行更改 file或integrationGlobalProperties bean。从版本4.0开始 spring.integraton丰富了属性。字首。这是 所有支持的全局选项的列表及其默认值:
spring.integraton.channels.autoCreate =真 spring.integraton.channels.maxUnicastSubscribers = 0x7FFFFFFF的 spring.integraton.channels.maxBroadcastSubscribers = 0x7FFFFFFF的 spring.integraton.taskScheduler.poolSize = 10 spring.integraton.messagingTemplate.throwExceptionOnLateReply =假
所以你得到它的那种错误似乎你必须创建这个属性文件并把它放到提到的适当位置。您可以查看链接here 一个例子也给出了here
<context:property-placeholder
location="org/springframework/integration/config/xml/propertyplaceholder/channel.properties" />