SpringClound项目相关

nacos本机模式非虚拟机启动也可正常连接

nacos中的配置中心相当于在application.yml中的相关配置,转移位置,内容同application.yml完全一样均可。

黑马项目导入后,依赖缺失:

  • 首先尝试maven重新加载,控制台提示传递依赖异常
[WARNING] The POM for com.baomidou:mybatis-plus-boot-starter:jar:3.4.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:jar:2.2.5.RELEASE is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:jar:2.2.5.RELEASE is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

尝试在缺失依赖处进行手动导入提示下方错误

2024-01-31 10:46:21.345 [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt:
提示自动配置失败,refresh方法调用失败

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apUserLoginController': Unsatisfied dependency expressed through field 'apUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apUserMapper' defined in file [D:\project\heima-leadnews\heima-leadnews-service\heima-leadnews-user\target\classes\com\heima\user\mapper\ApUserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
2024-01-31 10:46:21.360 [main] INFO  o.a.catalina.core.StandardService - Stopping service [Tomcat]
20 file:/D:/maven/respository/org/apache/hbase/hbase-protocol/2.1.5/hbase-protocol-2.1.5.jar, file:/D:/maven/respository/org/apache/hbase/thirdparty/hbase-shaded-miscellaneous/2.1.0/hbase-shaded-miscellaneous-2.1.0.jar, file:/D:/maven/respository/com/google/protobuf/protobuf-java/3.13.0/protobuf-java-3.13.0.jar, file:/D:/maven/respository/org/apache/hbase/thirdparty/hbase-shaded-netty/2.1.0/hbase-shaded-netty-2.1.0.jar, file:/D:/maven/respository/org/apache/zookeeper/zookeeper/3.4.10/zookeeper-3.4.10.jar, 2/knife4j-spring-boot-starter-2.0.2.jar, file:/D:/maven/respository/com/github/xiaoymin/knife4j-spring-boot-autoconfigure/2.0.2/knife4j-spring-boot-autoconfigure-2.0.2.jar, file:/D:/maven/respository/com/github/xiaoymin/knife4j-spring/2.0.2/knife4j-spring-2.0.2.jar, file:/D:/maven/respository/com/github/xiaoymin/knife4j-annotations/2.0.2/knife4j-annotations-2.0.2.jar, file:/D:/maven/respository/com/github/xiaoymin/knife4j-core/2.0.2/knife4j-core-2.0.2.jar, file:/D:/maven/respository/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2.jar, file:/D:/maven/respository/com/github/xiaoymin/knife4j-spring-ui/2.0.2/knife4j-spring-ui- file:/D:/maven/respository/org/apache/tomcat/embed/tomcat-embed-core/9.0.43/tomcat-embed-core-9.0.43.jar, file:/D:/maven/respository/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar, file:/D:/maven/respository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.43/tomcat-embed-websocket-9.0.43.jar, -slf4j-1.7.30.jar, file:/D:/maven/respository/org/projectlombok/lombok/1.18.8/lombok-1.18.8.jar, file:/D:/Software/IntelliJ%20IDEA%202021.2.1/lib/idea_rt.jar]
2024-01-31 10:46:21.392 [main] DEBUG o.s.b.a.l.ConditionEvaluationReportLoggingListener - 


============================
CONDITIONS EVALUATION REPORT  :条件评估报告,下方的自动配置可能失效
============================


Positive matches:
-----------------

   AopAutoConfiguration matched:
      - @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)

   AopAutoConfiguration.ClassProxyingConfiguration matched:
      - @ConditionalOnMissingClass did not find unwanted class 'org.aspectj.weaver.Advice' (OnClassCondition)
      - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)

   AuditEventsEndpointAutoConfiguration matched:
      - @ConditionalOnAvailableEndpoint no property management.endpoint.auditevents.enabled found so using endpoint default; @ConditionalOnAvailableEndpoint marked as exposed by a 'management.endpoints.jmx.exposure' property (OnAvailableEndpointCondition)

   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.boot.actuate.health.HealthIndicator' (OnClassCondition)
      - @ConditionalOnProperty (spring.cloud.discovery.enabled) matched; @ConditionalOnProperty (spring.cloud.discovery.blocking.enabled) matched (OnPropertyCondition)
      - @ConditionalOnBean (types: org.springframework.cloud.client.discovery.DiscoveryClient; SearchStrategy: all) found beans 'nacosDiscoveryClient', 'simpleDiscoveryClient', 'compositeDiscoveryClient' (OnBeanCondition)

   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration#discoveryClientHealthIndicator matched:
      - @ConditionalOnProperty (spring.cloud.discovery.client.health-indicator.enabled) matched (OnPropertyCondition)

   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration#discoveryCompositeHealthContributor matched:
      - @ConditionalOnProperty (spring.cloud.discovery.client.composite-indicator.enabled) matched (OnPropertyCondition)
      - @ConditionalOnBean (types: org.springframework.cloud.client.discovery.health.DiscoveryHealthIndicator; SearchStrategy: all) found bean 'discoveryClientHealthIndicator' (OnBeanCondition)

   CompatibilityVerifierAutoConfiguration matched:
      - @ConditionalOnProperty (spring.cloud.compatibility-verifier.enabled) matched (OnPropertyCondition)

   CompositeMeterRegistryAutoConfiguration matched:
      - @ConditionalOnClass found required class 'io.micrometer.core.instrument.composite.CompositeMeterRegistry' (OnClassCondition)

   ConditionsReportEndpointAutoConfiguration matched:
      - @ConditionalOnAvailableEndpoint no property management.endpoint.conditions.enabled found so using endpoint default; @ConditionalOnAvailableEndpoint marked as exposed by a 'management.endpoints.jmx.exposure' property (OnAvailableEndpointCondition)

   ConditionsReportEndpointAutoConfiguration#conditionsReportEndpoint matched:
      - @ConditionalOnMissingBean (types: org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint; SearchStrategy: current) did not find any beans (OnBeanCondition)

   ConfigurationPropertiesReportEndpointAutoConfiguration matched:
      - @ConditionalOnAvailableEndpoint no property management.endpoint.configprops.enabled found so using endpoint default; @ConditionalOnAvailableEndpoint marked as exposed by a 'management.endpoints.jmx.exposure' property (OnAvailableEndpointCondition)

   ConfigurationPropertiesReportEndpointAutoConfiguration#configurationPropertiesReportEndpoint matched:
      - @ConditionalOnMissingBean (types: org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint; SearchStrategy: all) did not find any beans (OnBeanCondition)

   DiskSpaceHealthContributorAutoConfiguration matched:
      - @ConditionalOnEnabledHealthIndicator management.health.defaults.enabled is considered true (OnEnabledHealthIndicatorCondition)

   DiskSpaceHealthContributorAutoConfiguration#diskSpaceHealthIndicator matched:
      - @ConditionalOnMissingBean (names: diskSpaceHealthIndicator; SearchStrategy: all) did not find any beans (OnBeanCondition)

   DispatcherServletAutoConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.web.servlet.DispatcherServlet' (OnClassCondition)
      - found 'session' scope (OnWebApplicationCondition)

   DispatcherServletAutoConfiguration.DispatcherServletConfiguration matched:
      - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration' (OnClassCondition)


      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder' (OnClassCondition)

   JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder' (OnClassCondition)

   JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration#jacksonObjectMapperBuilder matched:
      - @ConditionalOnMissingBean (types: org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)

   JacksonAutoConfiguration.JacksonObjectMapperConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder' (OnClassCondition)

io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics; SearchStrategy: all) did not find any beans (OnBeanCondition)

   JvmMetricsAutoConfiguration#jvmGcMetrics matched:
 CacheMeterBinderProvidersConfiguration.HazelcastCacheMeterBinderProviderConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required classes 'com.hazelcast.spring.cache.HazelcastCache', 'com.hazelcast.core.Hazelcast' (OnClassCondition)

   CacheMeterBinderProvidersConfiguration.JCacheCacheMeterBinderProviderConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'javax.cache.CacheManager' (OnClassCondition)

   CacheMetricsAutoConfiguration:

         - @ConditionalOnWebApplication did not find reactive web application classes (OnWebApplicationCondition)

   WebSocketServletAutoConfiguration.JettyWebSocketConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer' (OnClassCondition)

   WebSocketServletAutoConfiguration.UndertowWebSocketConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'io.undertow.websockets.jsr.Bootstrap' (OnClassCondition)

   XADataSourceAutoConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager' (OnClassCondition)


Exclusions: 除外
-----------

    None


Unconditional classes: 无条件的类
----------------------

    com.github.tobato.fastdfs.FdfsClientConfig

   

    org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration

    com.heima.common.exception.ExceptionCatch

    org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration

2024-01-31 10:46:21.408 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apUserLoginController': Unsatisfied dependency expressed through field 'apUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apUserMapper' defined in file [D:\project\heima-leadnews\heima-leadnews-service\heima-leadnews-user\target\classes\com\heima\user\mapper\ApUserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660)
    at

Bean后置增强,注入失败

sqlSessionFactory:每个基于 MyBatis 的应用都是以一个 SqlSessionFactory 的实例为核心的,SqlSessionFactory 的实例可以通过 SqlSessionFactoryBuilder 获得。而 SqlSessionFactoryBuilder 则可以从 XML 配置文件中读取,结合上文初步推测,未正确读取nacos配置的数据源信息导致

 org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1425)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
    at 

Process finished with exit code 1
 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/359994.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

聊一聊GPT、文心、通义、混元

我使用同一个Prompt提示词“请以记叙文的文体来写”,分别发送给GPT-3.5(调用API)、文心、通义、混元,下面是它们各自生成的文本内容,大家一看便知了。 GPT-3.5: 在我个人使用GPT模型的过程中,我…

ESP32-C3 vscode USB-Serial-JTAG 调试

硬件 接线 查看驱动 vs code配置 debugging via builtin USB-JTAG 配置调试UART 配置下载类型 创建调试配置 调试 参考 esp32c3内置USB-Serial-JTAG的使用 链接: link 看了之后,还是不会ESP32-C3的调试及下载,你过来打我!!&…

KAFKA高可用架构涉及常用功能整理

KAFKA高可用架构涉及常用功能整理 1. kafka的高可用系统架构和相关组件2. kafka的核心参数2.1 常规配置2.2 特殊优化配置 3. kafka常用命令3.1 常用基础命令3.1.1 创建topic3.1.2 获取集群的topic列表3.1.3 获取集群的topic详情3.1.4 删除集群的topic3.1.5 获取集群的消费组列表…

微信小程序之下拉刷新事件、上拉触底事件和案例

学习的最大理由是想摆脱平庸,早一天就多一份人生的精彩;迟一天就多一天平庸的困扰。各位小伙伴,如果您: 想系统/深入学习某技术知识点… 一个人摸索学习很难坚持,想组团高效学习… 想写博客但无从下手,急需…

【方法】RAR分卷压缩文件如何打开?

当RAR压缩文件比较大,不利于传输时,我们可以把文件压缩成分卷文件,那压缩后的分卷文件如何打开呢?今天就来说说RAR分卷压缩文件的两种打开方法。 方法一: 和普通压缩包一样,打开分卷压缩包也需要用到解压…

Web3与个人隐私:打破数据壁垒的新时代

随着科技的不断发展,Web3技术的兴起为我们带来了一个全新的数字时代,重新定义了个人隐私的概念与实践。在这个时代,我们不再被动地成为数据经济的被动参与者,而是迎来了一个更加安全、透明和个人主导的网络生态。 1. 去中心化的数…

比FTP更好用的企业远程传输大文件工具居然是这个!

在数字化浪潮的推动下,企业对于数据传输的速度和安全性有了更高的要求。传统的FTP协议,尽管历史悠久,但在当前的企业应用场景中,其局限性逐渐暴露。企业现在寻求的是能够提供快速、安全、便捷且经济高效的文件传输解决方案。本文旨…

springboot整合mqtt实现消息订阅和推送

前言 mica-mqtt-client-spring-boot-starter是一个基于Spring Boot的MQTT客户端启动器,它集成了mica-mqtt客户端,提供了在Spring Boot应用程序中使用MQTT协议进行消息通信的能力。以下是关于mica-mqtt-client-spring-boot-starter的简介: 特…

【Prometheus】Prometheus的PromQL语句

Prometheus promQL的语法: #时间序列 node_cpu_guest_seconds_total{cpu"0"} 监控(指标数据) {标签} node使用CPU的描述的统计,符合标签CPU0的时间序列的查询结果 指标标签生成时间序列 标签: __address…

DeepSORT算法实现车辆和行人跟踪计数和是否道路违规检测(代码+教程)

DeepSORT算法是一种用于目标跟踪的算法,它可以对车辆和行人进行跟踪计数,并且可以检测是否存在道路违规行为。该算法采用深度学习技术来提取特征,并使用卡尔曼滤波器来估计物体的速度和位置。 DeepSORT算法通过首先使用目标检测算法来识别出…

基于Kubernetes的微服务架构,你学废了吗?

至于服务网关,虽然保留了 Zuul,但没有采用 Kubernetes 的 Ingress 来替代。这里有两个主要考虑因素:首先,Ingress Controller 并非 Kubernetes 的内置组件,有多种可选方案(例如 KONG、Nginx、Haproxy 等&am…

目标检测算法训练数据准备——Penn-Fudan数据集预处理实例说明(附代码)

目录 0. 前言 1. Penn-Fudan数据集介绍 2. Penn-Fudan数据集预处理过程 3. 结果展示 4. 完整代码 0. 前言 按照国际惯例,首先声明:本文只是我自己学习的理解,虽然参考了他人的宝贵见解及成果,但是内容可能存在不准确的地方。如…

Springboot项目启动后浏览器不能直接访问接口,而postman可以访问?

在云服务器上部署springboot后端时,项目启动后浏览器不能直接访问接口,而postman可以访问。这是当时困扰了我大半天的小问题,在我打开防火墙和阿里云安全组之后还是没解决。然后在网上搜了很多很多资料,以为是浏览器访问权限或者是https什么证…

微信公众号数量达到上限怎么办

一般可以申请多少个公众号?许多用户在申请公众号时可能会遇到“公众号显示主体已达上限”的问题。这是因为在2018年11月16日对公众号申请数量进行了调整,具体调整如下:1、个人主体申请公众号数量上限从2个调整为1个。2、企业主体申请公众号数…

Mac删除自带的ABC输入法,简单快捷

一、下载PlistEdit Pro软件 二、终端执行 sudo open ~/Library/Preferences/com.apple.HIToolbox.plist 三、其中有一个数字下面的KeyboardLayout Name的value为“ABC”,这就是ABC输入法,点击上面的Delete按钮,删除整项ABC内容&#xff0c…

【计算机毕业设计】128电脑配件销售系统

🙊作者简介:拥有多年开发工作经验,分享技术代码帮助学生学习,独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。🌹赠送计算机毕业设计600个选题excel文件,帮助大学选题。赠送开题报告模板&#xff…

public class和class的区别

不用public修饰的类 一个Java源文件中可以定义多个不用public修饰的class,且类名不用和java源文件名一致。public修饰的类可以没有。编译之后,一个class就会对应生成一个class字节码文件 对于用public修饰的类 如果一个类用了public修饰,那…

搞懂Nginx的.conf文件路径配置

详解server中各部分作用及如何配置 如下图所示,这是我配置好的一个server代码块,我这里配置了https,所以会比默认的多一部分内容,如果你只需要配置http,则只需关注红色方框的部分即可,下面会按顺序讲解。 ①…

C++进阶--继承

概念 继承,允许一个类(称为子类或派生类)从另一个类(称为父类或基类)继承属性和方法。 继承的主要目的是实现代码的重用和构建类之间的层次关系。通过继承,子类可以获得父类的特性,包括数据成员…