更多ruoyi-nbcio功能请看演示系统
gitee源代码地址
前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio
演示地址: http://218.75.87.38:9666
更多nbcio-boot功能请看演示系统
gitee源代码地址
后端代码: https://gitee.com/nbacheng/nbcio-boot
前端代码:https://gitee.com/nbacheng/nbcio-vue.git
在线演示(包括H5) : http://218.75.87.38:9888
1、环境升级到java17
2、相关pom.xml版本进行升级
3、不过最好还是升级时候加一个下面升级包,这样有什么问题提示的好一些,当然升级好后要去掉下面这个
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-properties-migrator</artifactId> <scope>runtime</scope> </dependency>
4、原来很多javax.要修改成jakarta.开头的包,因为升级后变了,但有些sql之类还是要用javax.
编译通过后,运行出现下面错误
2024-02-23 21:58:40[0;39m [32m[main][0;39m [34mINFO [0;39m [1;35mcom.ruoyi.RuoYiApplication [0;39m - The following 1 profile is active: "dev" [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.LogAspect [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.LogAspect [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.RateLimiterAspect [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.RepeatSubmitAspect [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.RepeatSubmitAspect [31m2024-02-23 21:58:41[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.c.LocalVariableTableParameterNameDiscoverer [0;39m - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework.aspectj.RepeatSubmitAspect [31m2024-02-23 21:58:42[0;39m [32m[main][0;39m [34mINFO [0;39m [1;35mio.undertow.servlet [0;39m - Initializing Spring embedded WebApplicationContext [31m2024-02-23 21:58:42[0;39m [32m[main][0;39m [31mWARN [0;39m [1;35mo.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext [0;39m - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaController' defined in file [F:\codestudy\nbcio-oa\test\ruoyi-nbcio-pro\ruoyi-admin\target\classes\com\ruoyi\web\controller\common\CaptchaController.class]: Unsatisfied dependency expressed through constructor parameter 2: Error creating bean with name 'sysConfigServiceImpl' defined in file [F:\codestudy\nbcio-oa\test\ruoyi-nbcio-pro\ruoyi-system\target\classes\com\ruoyi\system\service\impl\SysConfigServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'sysConfigMapper' defined in file [F:\codestudy\nbcio-oa\test\ruoyi-nbcio-pro\ruoyi-system\target\classes\com\ruoyi\system\mapper\SysConfigMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class [31m2024-02-23 21:58:42[0;39m [32m[main][0;39m [1;31mERROR[0;39m [1;35mo.s.b.d.LoggingFailureAnalysisReporter [0;39m - *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).
5、其中下面这个问题可以在根pom.xml里解决
Compile the affected code with '-parameters' instead or avoid its introspection: com.ruoyi.framework
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.9.0</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>${project.build.sourceEncoding}</encoding> <annotationProcessorPaths> <path> <groupId>com.github.therapi</groupId> <artifactId>therapi-runtime-javadoc-scribe</artifactId> <version>0.15.0</version> </path> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> </path> <path> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <version>${spring-boot.version}</version> </path> </annotationProcessorPaths> <compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration> </plugin>
主要是增加下面这个来解决
<compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration>
6、数据源找不到的原因是ds必须要加一个boot3才能支持springboot3
<!-- dynamic-datasource 多数据源--> <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot3-starter</artifactId> <version>${dynamic-ds.version}</version> </dependency>
7、修改完redis配置后出现下面错误
Description: Failed to bind properties under 'spring.data.redis.ssl' to org.springframework.boot.autoconfigure.data.redis.RedisProperties$Ssl: Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.Boolean] to type [org.springframework.boot.autoconfigure.data.redis.RedisProperties$Ssl] Action: Update your application's configuration