Giter Club home page Giter Club logo

Comments (2)

JamesChenX avatar JamesChenX commented on September 25, 2024

你好,请问一下,我该如何在plugin-demo项目中正确的引用turms-service依赖的userService,供在Handler中使用?是否有demo,如果有可以提供一个链接吗?

Your usage is correct, so you don't need to change your code.
For example, we also use messageService = context.getBean(MessageService.class); to get the MessageService in im.turms.plugin.rasa.RasaResponser#setUp in turms-plugin-rasa.
These official plugins are good examples.

在上面的图片中,我通过继承start函数赋值userService回报错

In simple words, using im.turms.gateway.domain.session.service.UserService should fix your problem.

Details:

The problems usually happen when you load a plugin into the wrong server.

For your case, im.turms.gateway.infra.plugin.extension.UserAuthenticator is an extension point for turms-gateway (because turms-gateway is responsible for authentication and authorization), while im.turms.service.domain.user.service.UserService is a class of turms-service, so the following error is thrown, which is reasonable.:

caused by: java.lang.ClassNotFoundException: Could not find the class (im.turms.service.domain.user.service.UserService) of Turms. This may happen if the plugin descriptor specifies a wrong server type, or the class has been removed by Turms】`


btw, I suggest you only import turms-service or turms-gateway in the pom.xml of your plugins if your plugins will only be loaded in turms-service or turms-gateway so you won't have the chance to use wrong classes.

from turms.

darkSystemCode avatar darkSystemCode commented on September 25, 2024

好的,感谢!

from turms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.