1. 程式人生 > 實用技巧 >springboot微服務遇到的問題

springboot微服務遇到的問題

學習微服務的時候遇到了好多問題,在這裡記錄下來

  1. 建立maven專案common作為公共工具專案的時候,Target btyecode version老是顯示1.5版本,修改了一次之後,下一次執行專案的時候又給我改回去了...我也是服氣,最後在這個部落格中找到了解決辦法 IDEA Target btyecode version老是顯示1.5
<properties>
    <java.version>1.8</java.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>
</properties>
  1. nacos註冊不上,基本就兩種情況:
// 在SpringBoot啟動類上加入允許發現
@EnableDiscoveryClient
// 第一種是沒有加入專案名稱,需要將以下兩個配置都加上才行
spring:
  cloud:
    nacos:
      server-addr: 127.0.0.1:8848
  application:
    name: my_name

第二種是版本不對應,檢視以下版本內容 SpringCloud