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
Fixed service loading of VerticleFactory from mvn exec java #1438
Conversation
Signed-off-by: paulmiddelkoop <paul@pamisoft.nl>
@cescoffier thoughts ? |
@vietj Let me have a look once I'm back from my trip. I don't understand why we need explicit delegation in this case, and why the class cannot be loaded from the regular classpath (I also remember having fixed something quite similar in 3.2.1). |
@cescoffier this is indeed similar to the fix you made in io.vertx.core.ServiceHelper. When dealing with different classloading mechanisms like OSGI and Maven plugin's, the current thread class loader will not work. I suspect that the Vert.x Service Factory will not be loaded correctly in the DeploymentManager when using OSGI in combination with the current thread class loader. A similar problem is discussed here: http://stackoverflow.com/questions/36161795/how-to-register-a-spi-implementation-when-running-execjava. |
Hi, Do you have a quick reproducer of the issue. I tried with:
and it works for me (service loaded correctly) for a service defined in the project and a service loaded from a dependency. That's said, I do agree with your fix, something is wrong here. However, I think it would be better to rely to the |
Hi @cescoffier, I added a reproduction project here: https://github.com/paulmiddelkoop/vertx-issue-1438. I think ServiceHelper will be a good place to centralize service loading. At the moment this helper only returns the first factory. In the DeploymentManager case it should return all factories. |
Thanks, for the reproducer, gonna have a look to it tomorrow. |
…eHelper` class. Also add test to check the behavior of the `ServiceHelper` when using different classloaders. Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
…ading-issue Use Service Helper to avoid classloading issue
@cescoffier I'm assuming we should close this one, right ? |
I tested @cescoffier's fix and it works correctly, so this one can be closed. |
great |
Thanks @cescoffier ! |
Also add test to check the behavior of the `ServiceHelper` when using different classloaders. Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
Fixes #1437.