如何消除虚假的“引用的bean ...未找到” STS警告? [英] How to eliminate bogus "Referenced bean ... not found" warnings in STS?

查看:410
本文介绍了如何消除虚假的“引用的bean ...未找到” STS警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

STS(3.6.1和其他),Spring 4.1.x(最新),Spring集成4.1.2

STS (3.6.1 and others), Spring 4.1.x (latest), Spring Integration 4.1.2

在许多Spring项目中,我在Eclipse / STS,我们有许多被引用的bean未找到警告。这些通常是指内部Spring bean /类,不是我们自己的bean的合法错误配置。

In many Spring projects I work on in Eclipse/STS, we have numerous "Referenced bean not found" warnings. These often refer to internal Spring beans/classes, not legitimate mis-configuration of our own beans.

下面是我们的一个Spring Data JPA配置的例子:

Here's an example from one of our Spring Data JPA configurations:

引用的bean'jpaMappingContext'未找到[config set:cr-core / primary]

相关配置只是:

<?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:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.5.xsd
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
    http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">

<!-- other stuff -->
<jpa:repositories base-package="com.xyz.persistence" />

在我们的Spring Integration配置中,我们得到了更多的警告:

In our Spring Integration configuration we get even more warnings:

Referenced bean 'Create Text$child.Build Transmission.handler' not found [config set: c-r-integration/primary]
Referenced bean 'Create Text$child.Store ControlNumber in Header.handler' not found [config set: c-r-integration/primary]
Referenced bean 'Create Text$child.Store Parameters in Header.handler' not found [config set: c-r-integration/primary]
Referenced bean 'Create Text$child.Write IC to String.handler' not found [config set: c-r-integration/primary]
Referenced bean 'FilePoller.source' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.channel.interceptor.WireTap#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.channel.interceptor.WireTap#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.channel.interceptor.WireTap#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.handler.MessageHandlerChain#0$child.Store GS info in Header.handler' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.handler.MessageHandlerChain#0$child.Store IC info in Header.handler' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.integration.json.JsonToObjectTransformer#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.jms.listener.DefaultMessageListenerContainer#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.jms.listener.DefaultMessageListenerContainer#0' not found [config set: c-r-integration/primary]
Referenced bean 'org.springframework.scheduling.support.PeriodicTrigger#0' not found [config set: c-r-integration/primary]

似乎我们使用Spring Integration命名空间越多,这些显示。

It seems that the more we use Spring Integration namespaces the more of these show up.

旧的STS论坛还有一些其他相关问题,另外还有一些关于SO,像这样的一个,其接受的答案根本没有帮助。我已经尝试了多次清理,启用和禁用Spring Bean Reference验证,但不管我做什么,这些虚假警告总是在启用验证时返回。

There are other related questions in the old STS forums and a few on SO, like this one whose accepted answer is no help at all. I've tried multiple iterations of cleaning, enabling and disabling the Spring Bean Reference validation, but no matter what I do these bogus warnings always come back when the validation is enabled.

要重复一遍,这些不是由于配置错误导致的实际问题,或STS中的导入支持功能(如这里)。应用程序在运行时正常运行;这显然是STS唯一的问题。

To repeat, these are not actual problems due to mis-configuration, or to the "import support" feature in STS (as described here). And the apps behave correctly at runtime; this is clearly an STS-only issue.

我们努力保持我们的项目清理所有警告,所以这些非常混乱,隐藏真正需要我们注意的合法警告。

We strive to keep our projects clean of all warnings, so these are very cluttering and hide legitimate warnings that really do need our attention.

有什么办法排除故障并最终消除这些问题吗?他们甚至都是因为同样的根本问题,还是有不同的问题在这里玩?

Is there any way to troubleshoot these and eventually eliminate them? Are they even all due to the same underlying problem, or are there different issues at play here?

推荐答案

他们很可能是问题与命名空间解析器;我不知道我们可以解决他们,但是我同意,如果我们可以消除这些虚假警告,那将是很好的。

They are most likely issues with the namespace parsers; I am not sure we can address them all but, I agree, it would be nice if we could eliminate these false warnings.

请继续打开一个 JIRA针对Spring Integration的问题,如果需要,我们将与STS团队进行交流。

Please go ahead and open a JIRA Issue against Spring Integration for now and, if needed, we'll talk to the STS team.

(对于jpa问题,您应该对Spring数据打开一个jira。)

(For the jpa issue, you should open a jira against Spring Data).

编辑:我无法重现


引用的bean'org.springframework.integration.channel.interceptor.WireTap#0'未找到[config set :cr-integration / primary]

Referenced bean 'org.springframework.integration.channel.interceptor.WireTap#0' not found [config set: c-r-integration/primary]

你可以提供一个小的测试用例吗?

Can you provide a small test case?

这篇关于如何消除虚假的“引用的bean ...未找到” STS警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆