一、renren-fast 1.解决maven报错 ‘parent.relativePath‘ of POM 错误分析 子模块的parent写的不是父模块,而是继承了springboot
<parent > <groupId > org.springframework.boot</groupId > <artifactId > spring-boot-starter-parent</artifactId > <version > 2.1.8.RELEASE</version > </parent >
解决我这里用的版本改为了2.1.8.RELEASE,还有最后那个https改为了http不然我的插件会报错:
<parent > <groupId > org.springframework.boot</groupId > <artifactId > spring-boot-starter-parent</artifactId > <version > 2.1.8.RELEASE</version > <relativePath > </relativePath > </parent >
2.java: 找不到符号 符号: 方法 allowedOriginPatterns(java.lang.String) 位置: 类 org.springframework.web.servlet.config.annotation.CorsRegistration
将1.18.4改为<lombok.version > 1.18.20</lombok.version >
标红的.allowedOriginParrterns("*" )改为.allowedOrigins("*" )
3.Connection timed out: connect url: jdbc:mysql://192.168.188.132/gulimall_admin?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
改为
url: jdbc:mysql://192.168.188.132:3306/gulimall_admin?useSSL=false&serverTimezone=UTC
二、renren-fast-vue报错 1.npm install报错 我用的node18版本修改renren-fast-vue项目里面package-lock.json和packge.json文件,node-sass版本改为”node-sass”: “^8.0.0”,否则版本node-sass版本和nodejs版本不兼容报错
package-lock.json
"node-sass" : { "version" : "8.0.0" , "resolved" : "https://registry.npmjs.org/node-sass/-/node-sass-8.0.0.tgz" ,
package.json
然后又有这个问题,好像要npm cache clean –force清除一下缓存然后就成功了
npm ERR! code EINTEGRITY npm ERR! sha512-QFHfrZl6lqRU3csypwviz2XLgGNOoWQbo2GOvtsfQqOfL4cy1BtWnhx/XUeAO9LT3ahBzSRXcEO6DdvAH9DzSg== integrity checksum failed when using sha512: wanted sha512-QFHfrZl6lqRU3csypwviz2XLgGNOoWQbo2GOvtsfQqOfL4cy1BtWnhx/XUeAO9LT3ahBzSRXcEO6DdvAH9DzSg== but got sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==. (390148 bytes) npm ERR! A complete log of this run can be found in: D:\tool\nodejs\node_cache\_logs\2024-03-24T11_26_02_744Z-debug-0.log
2.npm run dev报错 ERROR Failed to compile with 4 errors 20:09:38 These relative modules were not found: * ./modules/es7.weak-set.of in ./node_modules/core-js/shim.js * ./modules/web.dom.iterable in ./node_modules/core-js/shim.js * ./modules/web.immediate in ./node_modules/core-js/shim.js * ./modules/web.timers in ./node_modules/core-js/shim.js
3.以上我没解决换个node14版本成功了 C:\Users\ASUS>node --version v14.19.1 C:\Users\ASUS>npm --version 6.14.16
三、renren-generator报错 1.插件报错 加了 这句话就不爆红了。
<parent > <groupId > org.springframework.boot</groupId > <artifactId > spring-boot-starter-parent</artifactId > <version > 2.2.6.RELEASE</version > <relativePath > </relativePath > </parent >
四、运行guliamll-product 1、运行guliamll-product项目时没有test按钮 在class前面加public
五、运行gulimall-coupon 1.报错Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationPropertiesBean 依赖冲突了将spring-cloud版本改成2021.0.5
版本对应网址https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E
<spring-boot.version > 2.6.13</spring-boot.version > <spring-cloud.version > 2021.0.5</spring-cloud.version >
六.idea内存占用过高 原来的配置文件
-Xms128m -Xmx2048m -XX:ReservedCodeCacheSize=512m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off -XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log -XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED -javaagent:D:\tool\mysql\datagroup\jetbra\ja-netfilter.jar=jetbrains
内存占用高达92%
修改后
-Xms1024m -Xmx2048m -XX:ReservedCodeCacheSize=256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1000 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off -XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log -XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED -javaagent:D:\tool\mysql\datagroup\jetbra\ja-netfilter.jar=jetbrains
修改过后87%
七、Nacos相关 1.服务启动时报错 *************************** APPLICATION FAILED TO START *************************** Description: No spring.config.import property has been defined Action: 1. Add a spring.config.import=polaris property to your configuration. 2. If configuration is not required add spring.config.import=optional:polaris instead. 3. If you still want use bootstrap.yml, you can add <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> dependency for compatible upgrade.
SpringCloud 2021.* 版本把bootstrap禁用了,只要把spring-cloud-starter-bootstrap导入进来就会生效了。
<dependency > <groupId > org.springframework.cloud</groupId > <artifactId > spring-cloud-starter-bootstrap</artifactId > </dependency >
nacos版本用2.2.0
八、OpenFeign 1.No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer? 解决在gulimall-member的pom文件加入
<dependency > <groupId > org.springframework.cloud</groupId > <artifactId > spring-cloud-loadbalancer</artifactId > </dependency >
我的两个spring版本为:
<spring-boot.version > 2.6.13</spring-boot.version > <spring-cloud.version > 2021.0.5</spring-cloud.version >
原因是因为SpringCloud Feign在Hoxton.M2 RELEASED版本之后抛弃了Ribbon,使用了spring-cloud-loadbalancer,所以我们这里还需要引入spring-cloud-loadbalancer的依赖。但是我在网上看好多人说还要在nacos 中排除ribbon依赖discovery依赖中
<exclusions > <exclusion > <groupId > org.springframework.cloud</groupId > <artifactId > spring-cloud-starter-netflix-ribbon</artifactId > </exclusion > </exclusions >