GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: 解决强制依赖redis错误 by huayanYu · Pull Request #2015 · binarywang/WxJava

Conversation

@huayanYu

@huayanYu huayanYu commented Feb 25, 2021

Copy link
Copy Markdown

如果不使用Redis,如只使用redisson作为storage,则会在打包后报错。
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

相关ISSUE
#1973
#1956

最小化示例项目 https://github.com/huayanYu/wxjava-mini-demo mvn test 即可复现。

分析原因: 不太确定,没仔细研究spring源码,大概是因为配置类里会用到JedisPool,所以会去查找相关类。
放到内部类通过静态方法调用则不会。

另外的解决办法
我的多数据源单独配了一个独立Configuration先通过判断所有能加入的,放到一个池子里。 然后再要使用的地方注入这个池子,去这个池子里取。 不过本项目要改造,工作量有些大。 也不一定是最合适的方案。 可以参考讨论。
https://github.com/baomidou/dynamic-datasource-spring-boot-starter/blob/master/src/main/java/com/baomidou/dynamic/datasource/spring/boot/autoconfigure/DynamicDataSourceCreatorAutoConfiguration.java

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@huayanYu
fix: 解决强制依赖redis错误
2b6a8a8
@binarywang binarywang added this to the 4.0.6 milestone Feb 26, 2021
@binarywang
binarywang merged commit da512ff into binarywang:develop Feb 26, 2021
@mozaboy

mozaboy commented Aug 19, 2024

Copy link
Copy Markdown


我也是类似错误, 初始化这个bean一直报错

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.0.6

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@huayanYu @mozaboy @binarywang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.