-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
将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)
Metadata
Metadata
Assignees
Labels
No labels