-
Notifications
You must be signed in to change notification settings - Fork 68
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
ClassNotFoundException for plugin class, loading a spring boot executable jar #10
Comments
I have commit demonstration code of building plugin jar. Please checkout 9107e87 for more details. Also, you could read the doc describe further more. Regarding to
the quick answer is no. I recommand search plugins jar via file system, rather than searching classpath. It's design to load/unload plugins dynamically at runtime time. If you use classpath, sbp has not difference as other ordinary monolithic Spring Boot application. |
I'm added the plugin jar via file system, but my jar is a spring boot executable jar, not a standard jar. Look at this link to browser the structure of a spring boot executable jar: https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-executable-jar-format.html#executable-jar-jar-file-structure You've done a wonderful work with this library, but since it addresses pluggability of spring boot apps, I'm expecting that it's possible to provide via filesystem a spring boot executable jar because it's a standard way to build for spring. So, according your opinion, loading a plugin jar with that structure, is it possibile to specify to sbp plugin loader the path (inside jar): EDIT: I've just tried to load a standard jar (not spring boot executable jar ) assembling manually it with "libs" and it run OK. I think it could be more convenient to load a spring boot executable jar, because it contains all libs by default. |
got your point. I think this could be done by add a custom |
Thank you for the answer. Now, it's clear to me how to define a new |
I have just added a configuration spring.sbp.custom-plugin-loaders to allow you customize your own You could use the SNAPSHOT version to experience it. |
Good, so it's easier to add a custom plugin loader. Very nice! |
I don't suggest you to extend What you have to do now is to load jars inside a jar. Looks like there are no out-of-box solution till today(can't believe that >_<!). Here is antoher example. Then you could implement a custom |
Not only jars, also the classes are in another folder ( |
With |
adding, after the builtin pluginLoader |
Ok, I would need to remove/replace JarPluginLoader because it's apply to all jars. I would like to have an extended |
Have make |
i also get same error |
@wuyuan2009123 For a fatJar plugin, you need to unzip the jar and load classes/libs seperator. Or you can build your jar in flatten format. This issue is still open because it is still waiting a workable FatJar example... |
@fabioformosa finally, how to fix this issue? I get this issue too. Could you show me how to resolve it? |
I'm testing the
deployment
runtime-mode.Main App finds plugin jar that I put in plugins folder, but it fails when it tries to switch plugin state from RESOLVED to STARTED because:
I put the spring boot fat jar, built by
spring-boot-maven-plugin
that creates the following structure into the jar:-> classes -> com.example.MyPlugin and all others
-> libs -> all jar dependencies
Managing plugins with the shape of spring boot application, is SBP library aware to search classes under BOOT-INF folder?
The text was updated successfully, but these errors were encountered: