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

FastDFS error reporting No beans of & # 039 domestic FastDFS Client' type found solution

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "FastDFS error No beans of 'FastDFS Client' type found solution", in daily operation, I believe many people in FastDFS error No beans of 'FastDFS Client' type found solution problem has doubts, small editor consulted all kinds of information, sorted out simple and easy to use operation method, hope to answer everyone "FastDFS error No beans of 'FastDFS Client' type found solution" doubts helpful! Next, please follow the small series to learn together!

Foreword:

Today, I took over a small project my colleague did before, which involved the use of FastDFS. Could not autowire No beans of 'FastDFS Client' type found.

Next, we will describe in detail the solution to FastDFS error.

I. Description of the problem

Start Application class error:

required a bean of type 'org.springframework.fasfdfs.server.FastDFSClient' that could not be found.

II. Problem Analysis

As shown in the figure below: According to the error message, it is found that there is no lack of jar packages, and the classes required in the error prompt are also available. I don't know why the error is reported.

To sum up, combined with colleagues can run normally through ideas, so it is suspected that there may be dependency conflicts in FastDFS related jar packages.

III. SOLUTIONS

1. First delete FastDFS-related jar packages from Maven repository. There are two jar packages in total, fastdfs-client-java-1.27-SNAPSHOT.jar and spring-boot-starter-fastdfs-1.0-SNAPSHOT.jar, respectively, where the latter depends on the former.

2. Since it is impossible to download the above jar package of FastDFS from the central repository, it is necessary to manually build the source code generation jar file. Download fastdfs-client-java and spring-boot-starter-fastdfs source code locally, configure the Maven address of the source code project, and execute mvn clean install. After successful execution, the corresponding Maven repository automatically has the above two jar packages. Special note: you need to type fastdfs-client-java jar package first, because spring-boot-starter-fastdfs project packaging depends on fastdfs-client-java-1.27-SNAPSHOT.jar.

3. Restart idea by Invalidate and Restart, so that idea can reload the project.

4. Run FastDFS project again. Start successfully!

IV. Summary 1. Summary of problems

I've tested this question repeatedly, assuming I have fastdfs-client-java-1.27-SNAPSHOT.jar and spring-boot-starter-fastdfs-1.0-SNAPSHOT.jar packages, using

mvn install:install-file -Dfile="xxx.jar" -DgroupId=xxx -DartifactId=xxx -Dversion=xxx -Dpackaging=jar

Import the local jar package into the Maven repository in the form of. Although it can be successfully imported, the startup project will still report the above error, so the most secure way is to download the source code and package it, and import the required jar package into the Maven repository in this way.

2. Introduction to maven related commands

mvn clean : Empty compiled files.

mvn test : Run the test case.

mvn compile : Compile the project.

mvn package : package project.

mvn install : Install jar packages into Maven's local repository.

Note: mvn test will execute mvn compile ; mvn package will execute mvn compile and mvn test ; mvn install will execute mvn package first.

At this point, the study of "FastDFS error No beans of 'FastDFS Client' type found" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

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

Internet Technology

Wechat

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

12
Report