Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'cn.dev33.satoken.dao.alone.SaAloneRedisInject': io/lettuce/core/ClientOptions #710

Open
bruce-pang opened this issue Nov 28, 2024 · 1 comment

Comments

@bruce-pang
Copy link

bruce-pang commented Nov 28, 2024

使用版本:

sa-token-alone-redis:1.39.0

报错信息:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.dev33.satoken.dao.alone.SaAloneRedisInject': io/lettuce/core/ClientOptions
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at com.jikongmro.bulk.server.JkServerApplication.main(JkServerApplication.java:26)
Caused by: java.lang.NoClassDefFoundError: io/lettuce/core/ClientOptions
at org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration$LettuceClientConfigurationBuilder.(LettuceClientConfiguration.java:172)
at org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration$LettucePoolingClientConfigurationBuilder.(LettucePoolingClientConfiguration.java:97)
at org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration.builder(LettucePoolingClientConfiguration.java:51)
at cn.dev33.satoken.dao.alone.SaAloneRedisInject.setEnvironment(SaAloneRedisInject.java:195)
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:94)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1765)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
... 15 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.lettuce.core.ClientOptions
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 24 common frames omitted

希望结果:

复现步骤:

在jdk17+springboot3.2.2环境中
在Spring配置文件添加如下配置

maven的配置包如下:

           <properties>
                <java.version>17</java.version>
                <sa-token.version>1.39.0</sa-token.version>
                <redisson.version>3.26.0</redisson.version>
           </properties>
            <dependency>
                <groupId>cn.dev33</groupId>
                <artifactId>sa-token-spring-boot3-starter</artifactId>
                <version>${sa-token.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.dev33</groupId>
                <artifactId>sa-token-core</artifactId>
                <version>${sa-token.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.dev33</groupId>
                <artifactId>sa-token-redis</artifactId>
                <version>${sa-token.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.dev33</groupId>
                <artifactId>sa-token-alone-redis</artifactId>
                <version>${sa-token.version}</version>
            </dependency>

            <dependency>
                <groupId>com.jikongmro.bulk</groupId>
                <artifactId>jk-spring-boot-starter-redis</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>org.redisson</groupId>
                <artifactId>redisson-spring-boot-starter</artifactId>
                <version>${redisson.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-actuator</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>


```yaml
# saToken配置
sa-token:
  # 是否输出操作日志
  is-log: true
  alone-redis:
    database: 14
    host: 192.168.122.1
    port: 6379
    password: 123456
    timeout: 10
    lettuce:
      pool:
        max-active: 50       # 最大连接数
        max-idle: 10         # 最大空闲连接数
        min-idle: 5          # 最小空闲连接数
        max-wait: 2000ms     # 连接池最大等待时间

启动项目报错上述错误,
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
@bruce-pang
Copy link
Author

项目中所有涉及到的satoken依赖如图
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant