IDEA cannot properly parse custom bean defined by Dubbo's custom tag

Answered

Dubbo in a popular (at least in China) RPC framework. And it entered Apache Incubator in February, 2018.

In the consumer side, users define beans by Dubbo's custom tag: <dubbo:reference id="bar" interface="com.foo.bar"/>. id is the bean id, and interface serves as the bean's class.

Currently IDEA parses the bean definition as id=bar and class=com.alibaba.dubbo.config.spring.ReferenceBean. This causes IDEA warning "No beans of 'com.foo.bar' type found" when autowiring the bean.

How does IDEA's "Parse custom bean" feature work? Any way to make it properly parse these bean definitions?

0
8 comments

Make sure that the Spring Facet is added for the module and the Spring config file includes this bean under the Spring Application Context. There also should be an intention action (Alt+Enter shortcut) on the not parsed bean to parse it.

If issue remains, please provide a sample project.

0
Avatar
Permanently deleted user

Sample project: https://github.com/bianjp/spring-examples/tree/master/idea-dubbo-bean-demo

The problem is not that IntelliJ IDEA did not parse the custom bean, but it generates incorrect bean definition (to be more precise, incorrect class attribute).

0

Thank you very much for the sample project. What IDE version do you use? Works fine for me in 2018.1.2 EAP Could you please check this version?

Please also make sure all Spring facets have Spring context configured.

0
Avatar
Permanently deleted user

I was using IntelliJ IDEA Ultimate 2018.1.1 on Arch Linux (Kernel 4.15.15, Gnome 3.28.1). Tried 2018.1.2.EAP with no luck.

Are you sure "Parse custom bean" works correctly on your computer? Can you show me what "Alt + Enter -> Parse custom bean" on <dubbo:reference> gives out?

0
Avatar
Permanently deleted user

Note that the problem is not that the application is not running, but just that IDEA generates unexpected warnings. Though the warning can be turned off, this is not what I want to do.

Can you tell me how "Parse custom bean" works? Any way to tweak it? Or it's just not designed or possible to cover all cases?

0

Thank you, I've reproduced the issue. Please follow the https://youtrack.jetbrains.com/issue/IDEA-190547 for updates.

0
Avatar
Permanently deleted user

I've encountered the same problem with Dubbo's custom tag. Will this problem be fixed? Are there any ways to change the type of the bean parsed by "Parse custom bean"?

0

I asked developers to provide plans for this issue.

0

Please sign in to leave a comment.