Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of interdependent error reporting in springboot

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to solve the problem of interdependence of springboot". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Springboot interdependent error reporting

During the hard work of code handling yesterday, I found that all the annotations in the service layer in a new module of the springboot project turned black, which would normally be yellow.

I think it may be that some related components of springboot did not introduce pom files.

So I copied some dependencies directly against the original module.

There was a false report from the new world.

Error:java: Annotation processing is not supported for module cycles. Please ensure that all modules from cycle [core,dao,service] are excluded from annotation processing.

After chewing repeatedly the answers of the website bosses without eating fireworks.

I'm sure.

This is a mistake called interdependence, which is called the endless cycle of dependence.

Solution method

Just open the pom of the interdependent module and delete one of the dependencies on the other

So how do you know more clearly which modules depend on each other?

1.

Then I saw a red packet on the right that relied on reporting an error.

two。 The red box is the interdependence between the two modules, dealing with the dependencies between the modules (there can be no dependencies between the modules)

3. Right-click the package that you do not want to rely on and select open module setting this option

The springboot project deals with circular dependencies (circular reference)

SpringBoot failed to start, error BeanCurrentlyInCreationException

Org.springframework.beans.factory.BeanCurrentlyInCreationException:

Error creating bean with name 'AxxxxService':

Bean with name 'BxxxxService'

Has been injected into other beans [CxxxxService] in its raw version as part of a circular reference

But has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching-

Consider using 'getBeanNamesOfType' with the' allowEagerInit' flag turned off, for example.

Solution method

Find Service: CxxxxService in square brackets

Find the statement of BxxxxService (the nearest one, if you can't read English) in CxxxxService

Annotate BxxxService's statement with @ Lazy

Note: if there is more than one CxxxxService in square brackets, do this for each, plus @ Lazy

Remorse

I didn't start with Baidu, the solution, but self-righteously assembled new Service classes.

Today, I came across a person with multiple classes in square brackets, which needed to be changed a lot, so I searched for other people's solutions and shed tears of remorse.

Now I've adjusted the code back. It's past 10:00 in the evening.

Originally wanted to try revert, in the past too long, too much commit, scared, flinched

This is the end of the content of "how to solve the problem of springboot interdependence error reporting". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report