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

运行example-plugin-b-v3-self出现异常 #32

Open
Saltfish835 opened this issue Feb 15, 2025 · 0 comments
Open

运行example-plugin-b-v3-self出现异常 #32

Saltfish835 opened this issue Feb 15, 2025 · 0 comments

Comments

@Saltfish835
Copy link

将example-plugin-b-v3-self案例的jar包复制到exp-plugins目录下后,在main方法中使用插件,如下:
optional = expAppContext.get(UserService.class.getName(), "cn.think.in.java.open.exp.example.bv3_3.0.0");
optional.ifPresent(userService -> {
log.info("example.plugin.a_1.0.0--->userService.getClass().getName()={}", userService.getClass().getName());
userService.createUserExt();
});
然后出现以下异常:
Exception in thread "main" java.lang.ClassCastException: cn.think.in.java.open.exp.example.bv3.UserPlugin cannot be cast to cn.think.in.java.open.exp.adapter.springboot2.example.UserService
at java.util.Optional.ifPresent(Optional.java:159)
at cn.think.in.java.simple.app.example.SimpleJavaAppMain.main(SimpleJavaAppMain.java:32)

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