Skip to content

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

Description

@Saltfish835

将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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions