Bugfix/resolving dependency of some libraries by installed services.#196
Bugfix/resolving dependency of some libraries by installed services.#196shishir-lab wants to merge 2 commits intomasterfrom
Conversation
…ed verticles using maven service factory.
zero88
left a comment
There was a problem hiding this comment.
No, it is totally wrong fix and wrong direction.
This bug doesn't relate anything to classpath isolate or classpath sharing.
It is just simple because declare dependencies order, and I guess vertx-maven-service-factory is constructing a classpath is failed resolving this case.
Check:
https://github.com/NubeIO/iot-engine/blob/master/core/httpserver/build.gradle#L11-L12
https://github.com/NubeIO/iot-engine/blob/master/edge/module/gateway/build.gradle#L2-L3
Resolve by switch 2 lines in edge:module:gateway:build.gradle to
compile project(':core:httpserver')
compile project(':core:micro')
if not, try to update core:httpserver:build.gradle to
implementation project(':core:micro')
implementation "io.vertx:vertx-service-discovery:$project.versions.vertx"
Never do it, add countless unnecessary dependencies like that. Ask @RaiBnod to know the reason
|
@Zero-88 What do you mean by
I think you have misunderstood the issue. I have done a lot of research on this issue from the time this project was started and I know it is because of classpath isolation feature provided by vertx. I will explain the big picture here.
The problem: This problem is not due to our project but it is a corner case of vertx itself. So, your suggested changes will not solve the problem. In fact, The solution: I will be happy to answer if you have any other questions but I must suggest you to understand the issue before deciding or guessing if the approach is wrong or right :/ . |
|
Hi there, Just simple question for your (or you think) talent: Do you realized just simple disable Your link Remember
This is one valuable in your mention is
However, MavenVerticleFactory is using
So follow the code base both It is obviously very difficult issue, so don't treat as you are only guy in here understand it. This is quick The last words |
|
Seems like we are now going towards the same page.
To:
However, I believe this issue is not only limited to My comment as well as the proposed problem/solution is based on the answer provided by Julien Viet, the top contributor and vertx lead. In the thread he answers by saying:
I am not sure why you believe "it is a huge mistake" to pursue this lead. Anyway, I agree that this issue is difficult and mysterious as well. Yes, there are the cases where classes starting with "io.vertx" are resolved as well. I am still investigating these cases by identifying the path to these classes and also trying to come up with a demo where this issue is seen in other place except I understand agile development process and I have started this pull request so that this issue will be discussed with @RaiBnod and I don't expect my code should be merged right away. If you see the readme file, I have mentioned the limitation and alternative approach as well. The approach I took is just a work around for the corner case and I welcome better approaches and new insights. |
We did go a long path after you did MVP. Many things were changed and your
I know who he is. But why I said private boolean isVertxOrSystemClass(String name) {
return
name.startsWith("java.") ||
name.startsWith("javax.") ||
name.startsWith("sun.*") ||
name.startsWith("com.sun.") ||
name.startsWith("io.vertx.core") ||
name.startsWith("io.netty.") ||
name.startsWith("com.fasterxml.jackson");
}My clue is might be somehow conflict But in another view, I don't see benefit for isolating service for each deployment from However, I'm intending to merge among |
|
@Zero-88 Can you confirm if Also, what is the rationale behind merging |
|
I was able to replicate the issue in a module that is independent of Following error is produced. The Problem: The solution: This solution works for I will create a new pull request with necessary changes following this approach. |
The suggested review would not work. New pull request created.
|
The solution discussed above is implemented by #201 |
Issue #141: Bug related to dependency resolving.
io.vertxclasses are only loaded by main classloader not isolated classloader i.e. the verticles that are deployed dynamically using Maven verticle factory cannot findio.vertxclasses.Ideally, this module loads all required
io.vertxdependencies toedge-biosmodule main classpath (orserver-biosif required).Alternative is to use
compile "io.vertx:vertx-dependencies". However, there are many unnecessary dependencies.