Consider defining a bean of type ‘com.example.springbootdemo.mapper.UserMapper‘ in your configuratio

这篇具有很好参考价值的文章主要介绍了Consider defining a bean of type ‘com.example.springbootdemo.mapper.UserMapper‘ in your configuratio。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:49658,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" -javaagent:C:\Users\Lucas\AppData\Local\JetBrains\IntelliJIdea2022.3\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\tfy\code\springbootDemo\springbootDemo\target\classes;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.6.11\spring-boot-starter-data-jdbc-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\data\spring-data-jdbc\2.3.6\spring-data-jdbc-2.3.6.jar;C:\Users\Lucas\.m2\repository\org\springframework\data\spring-data-relational\2.3.6\spring-data-relational-2.3.6.jar;C:\Users\Lucas\.m2\repository\org\springframework\data\spring-data-commons\2.6.6\spring-data-commons-2.6.6.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-tx\5.3.22\spring-tx-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-context\5.3.22\spring-context-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-beans\5.3.22\spring-beans-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.6.11\spring-boot-starter-data-jpa-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-aop\2.6.11\spring-boot-starter-aop-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-aop\5.3.22\spring-aop-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\aspectj\aspectjweaver\1.9.7\aspectjweaver-1.9.7.jar;C:\Users\Lucas\.m2\repository\jakarta\transaction\jakarta.transaction-api\1.3.3\jakarta.transaction-api-1.3.3.jar;C:\Users\Lucas\.m2\repository\jakarta\persistence\jakarta.persistence-api\2.2.3\jakarta.persistence-api-2.2.3.jar;C:\Users\Lucas\.m2\repository\org\hibernate\hibernate-core\5.6.10.Final\hibernate-core-5.6.10.Final.jar;C:\Users\Lucas\.m2\repository\org\jboss\logging\jboss-logging\3.4.3.Final\jboss-logging-3.4.3.Final.jar;C:\Users\Lucas\.m2\repository\net\bytebuddy\byte-buddy\1.11.22\byte-buddy-1.11.22.jar;C:\Users\Lucas\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\Lucas\.m2\repository\org\jboss\jandex\2.4.2.Final\jandex-2.4.2.Final.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\Lucas\.m2\repository\org\hibernate\common\hibernate-commons-annotations\5.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;C:\Users\Lucas\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.6\jaxb-runtime-2.3.6.jar;C:\Users\Lucas\.m2\repository\org\glassfish\jaxb\txw2\2.3.6\txw2-2.3.6.jar;C:\Users\Lucas\.m2\repository\com\sun\istack\istack-commons-runtime\3.0.12\istack-commons-runtime-3.0.12.jar;C:\Users\Lucas\.m2\repository\com\sun\activation\jakarta.activation\1.2.2\jakarta.activation-1.2.2.jar;C:\Users\Lucas\.m2\repository\org\springframework\data\spring-data-jpa\2.6.6\spring-data-jpa-2.6.6.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-orm\5.3.22\spring-orm-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-aspects\5.3.22\spring-aspects-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.6.11\spring-boot-starter-jdbc-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter\2.6.11\spring-boot-starter-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot\2.6.11\spring-boot-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.6.11\spring-boot-autoconfigure-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.6.11\spring-boot-starter-logging-2.6.11.jar;C:\Users\Lucas\.m2\repository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;C:\Users\Lucas\.m2\repository\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;C:\Users\Lucas\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;C:\Users\Lucas\.m2\repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;C:\Users\Lucas\.m2\repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;C:\Users\Lucas\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\Users\Lucas\.m2\repository\org\yaml\snakeyaml\1.29\snakeyaml-1.29.jar;C:\Users\Lucas\.m2\repository\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-jdbc\5.3.22\spring-jdbc-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\2.6.11\spring-boot-starter-thymeleaf-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\thymeleaf\thymeleaf-spring5\3.0.15.RELEASE\thymeleaf-spring5-3.0.15.RELEASE.jar;C:\Users\Lucas\.m2\repository\org\thymeleaf\thymeleaf\3.0.15.RELEASE\thymeleaf-3.0.15.RELEASE.jar;C:\Users\Lucas\.m2\repository\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;C:\Users\Lucas\.m2\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;C:\Users\Lucas\.m2\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.6.11\spring-boot-starter-web-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.6.11\spring-boot-starter-json-2.6.11.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.3\jackson-databind-2.13.3.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.3\jackson-annotations-2.13.3.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.3\jackson-core-2.13.3.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.3\jackson-datatype-jdk8-2.13.3.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.3\jackson-datatype-jsr310-2.13.3.jar;C:\Users\Lucas\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.3\jackson-module-parameter-names-2.13.3.jar;C:\Users\Lucas\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.6.11\spring-boot-starter-tomcat-2.6.11.jar;C:\Users\Lucas\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.65\tomcat-embed-core-9.0.65.jar;C:\Users\Lucas\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.65\tomcat-embed-el-9.0.65.jar;C:\Users\Lucas\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.65\tomcat-embed-websocket-9.0.65.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-web\5.3.22\spring-web-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-webmvc\5.3.22\spring-webmvc-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-expression\5.3.22\spring-expression-5.3.22.jar;C:\Users\Lucas\.m2\repository\mysql\mysql-connector-java\8.0.13\mysql-connector-java-8.0.13.jar;C:\Users\Lucas\.m2\repository\org\mybatis\mybatis\3.2.6\mybatis-3.2.6.jar;C:\Users\Lucas\.m2\repository\org\mybatis\mybatis-spring\1.2.2\mybatis-spring-1.2.2.jar;C:\Users\Lucas\.m2\repository\org\postgresql\postgresql\42.3.6\postgresql-42.3.6.jar;C:\Users\Lucas\.m2\repository\org\checkerframework\checker-qual\3.5.0\checker-qual-3.5.0.jar;C:\Users\Lucas\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\Users\Lucas\.m2\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-core\5.3.22\spring-core-5.3.22.jar;C:\Users\Lucas\.m2\repository\org\springframework\spring-jcl\5.3.22\spring-jcl-5.3.22.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.1\lib\idea_rt.jar" com.example.springbootdemo.SpringbootDemoApplication
Connected to the target VM, address: '127.0.0.1:49658', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::               (v2.6.11)

2023-01-11 09:50:12.735  INFO 91244 --- [           main] c.e.s.SpringbootDemoApplication          : Starting SpringbootDemoApplication using Java 1.8.0_181 on DESKTOP-JSP3CM3 with PID 91244 (C:\tfy\code\springbootDemo\springbootDemo\target\classes started by Lucas in C:\tfy\code\springbootDemo\springbootDemo)
2023-01-11 09:50:12.738  INFO 91244 --- [           main] c.e.s.SpringbootDemoApplication          : No active profile set, falling back to 1 default profile: "default"
2023-01-11 09:50:13.260  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2023-01-11 09:50:13.260  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2023-01-11 09:50:13.270  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 JDBC repository interfaces.
2023-01-11 09:50:13.276  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2023-01-11 09:50:13.277  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-01-11 09:50:13.284  INFO 91244 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 2 ms. Found 0 JPA repository interfaces.
2023-01-11 09:50:13.703  INFO 91244 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-11 09:50:13.714  INFO 91244 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-11 09:50:13.714  INFO 91244 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.65]
2023-01-11 09:50:13.837  INFO 91244 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-11 09:50:13.837  INFO 91244 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1063 ms
2023-01-11 09:50:13.956  INFO 91244 --- [           main] com.zaxxer.hikari.HikariDataSource       : defaultDataSource - Starting...
2023-01-11 09:50:14.199  INFO 91244 --- [           main] com.zaxxer.hikari.HikariDataSource       : defaultDataSource - Start completed.
2023-01-11 09:50:14.281  INFO 91244 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-01-11 09:50:14.323  INFO 91244 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.10.Final
2023-01-11 09:50:14.458  INFO 91244 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2023-01-11 09:50:14.545  INFO 91244 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2023-01-11 09:50:14.658  INFO 91244 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2023-01-11 09:50:14.666  INFO 91244 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-01-11 09:50:14.680  WARN 91244 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.springbootdemo.mapper.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2023-01-11 09:50:14.681  INFO 91244 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-01-11 09:50:14.684  INFO 91244 --- [           main] com.zaxxer.hikari.HikariDataSource       : defaultDataSource - Shutdown initiated...
2023-01-11 09:50:14.687  INFO 91244 --- [           main] com.zaxxer.hikari.HikariDataSource       : defaultDataSource - Shutdown completed.
2023-01-11 09:50:14.689  INFO 91244 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-01-11 09:50:14.699  INFO 91244 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-01-11 09:50:14.722 ERROR 91244 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field userMapper in com.example.springbootdemo.service.impl.UserServiceImpl required a bean of type 'com.example.springbootdemo.mapper.UserMapper' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.example.springbootdemo.mapper.UserMapper' in your configuration.

Disconnected from the target VM, address: '127.0.0.1:49658', transport: 'socket'

Process finished with exit code 1
 文章来源地址https://www.toymoban.com/news/detail-753614.html

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.example.springbootdemo.mapper.UserMapper" >
    <select id="selectUserById" parameterType="int" resultType="com.example.springbootdemo.model.User">
        select * from yyb where id='03'
    </select>
</mapper>

到了这里,关于Consider defining a bean of type ‘com.example.springbootdemo.mapper.UserMapper‘ in your configuratio的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • IDEA提示找不到Mapper接口:Could not autowire.No beans of ‘xxxMapper‘ type found

    我们可以看到,上面的红色警告在提示我们,找不到 xxxMaper 这个类型的 bean。 为啥呢? 因为 @Mapper 这个注解是 Mybatis 提供的,而 @Autowried 注解是 Spring 提供的,IDEA能理解 Spring 的上下文,但是却和 Mybatis 关联不上。而且我们可以根据 @Autowried 源码看到,默认情况下,@Autowri

    2024年02月08日
    浏览(41)
  • A component required a bean of type ‘...Mapper‘ that could not be found问题解决

    错误如图 第一步 查看配置文件是否正确 第二步 查看标签是否正确 检查UserMapper上是否加上@Mapper 补充 第二步还是不行的话查看下POM文件是否导入mybatis-plus-boot-starter 配置mybatis-plus.mapper-locations无提示信息; 此时发现右上角出现感叹号,Cannot resolve configuration property ‘mybatis-

    2024年02月16日
    浏览(40)
  • Springboot启动出现A component required a bean of type ‘com.xxx‘ that could not问题解决

    今日写一个websocket小demo,启动项目时出现错误如下图 检查也没发现漏写注解,思考片刻后突然想起springboot扫描的范围是与启动类同级别的包-就是com.huang.demo.ssm目录下所有注解bean都被扫描,那么ws包里面的bean不在ssm这个路径下,所以导致springboot启动时扫描不到。最后把ws包

    2024年02月11日
    浏览(51)
  • 【Spring常见错误】No qualifying bean of type

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name \\\'com.ssmpdemo.ServiceTest\\\': Unsatisfied dependency expressed through field \\\'userService\\\'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type \\\'com.ssmpdemo.service.UserService\\\' available: expected at leas

    2023年04月08日
    浏览(43)
  • springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type ‘x‘ available

    今天在执行 quartz 定时任务时,报出如下错误: 发现这个错误: No qualifying bean of type \\\'com.xxx.CollectionTaskServiceImpl\\\' available 。 我们继续看错误,错误发生在 SpringApplicationContext.getBean 的方法中。 结合 No qualifying bean of type \\\'com.xxx.CollectionTaskServiceImpl\\\' available 错误可知, SpringApplica

    2024年02月04日
    浏览(47)
  • Could not autowire. No beans of ‘DiscoveryClient‘ type found.

    一、导错了包 DiscoveryClient对应有两个包: org.springframework.cloud.client.discovery.DiscoveryClient; com.netflix.discovery.DiscoveryClient; 目前导入的包是: 改成第一个包,发现不再报红了。

    2024年02月11日
    浏览(42)
  • 解决Mapper method ‘com.xxx‘ attempted to return null from a method with a primitive return type (xxx)

    今天写完 页面按钮排序 接口,如下代码所示:

    2024年02月05日
    浏览(80)
  • idea报错:Could not autowire. No beans of ‘UserService‘ type found.

    点个关注,必回关 翻译:无法自动连线。未找到“用户服务”类型的服务类。 当报错之后idea会提示错误,不过程序的编译和运行都是没有问题的(这个错误提示不会产生任何印象) 解决方案 解决方案1: Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class

    2024年02月11日
    浏览(47)
  • @Autowired报错Could not autowire. No beans of ‘XXX‘ type found

      IDEA中使用 @Autowired 报错 Could not autowire. No beans of \\\'XXX\\\' type found ,错误大致意思为:没有匹配到类型为XXX的bean。   个人觉得,注入 controller 的 service 虽然一般来说我们都是注入一个接口,但是该接口有实现类,并且使用 @Service 进行关联,所以注入类型应该也可以视为一

    2024年02月07日
    浏览(47)
  • No qualifying bean of type ‘org.springframework.transaction.TransactionManager‘ available: expected

    报错信息 Spring Boot 启动报错: 报错信息显示:没有可注入的 TransactionManager ,因为要求此事物管理器应该是一个,但是发现了两个,容器不知道应该注入哪个,存在的两个容器分别是: transactionManager 、 mongoTransactionManager 解决办法 方法一:Primary 查找项目内bean名称为: tra

    2024年02月03日
    浏览(41)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包