-
Notifications
You must be signed in to change notification settings - Fork 210
Eclipse Language Server cannot be resolved because of a uses constraint violation #325
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It installs and works fine for me. Whenever we get errors from osgi like this, it's usually a good idea to try and start STS/eclipse with the '-clean' option. If osgi is in a confused state this often resolves the issue, so can you give that a try. If that doesn't resolve the issue we will have to take a deeper look. But please give the |
Did take a quick look and the error suggests that livexp bundle is picking up a newer version of guava while xtext.base is explicitly requesting an older one. The way I understand it, osgi should be able to resolve this issue by resolving the older bundle also for livexp (since livexp bundle doesn't explicitly require the newer version). So all the more reason to give the '-clean' option a try as this will make osgi re-resolve all dependencies. I beleave often times this kind of issue is the result of osgi caching bits of old bundle resolutions and not considering all of the possibilities. |
Thank you @kdvolder for the hint. I gave |
The error itself is actually fairly precise as to what the problem is. Not so clear as to why it arises. We could probably just 'solve it' right now by adding an explicit version constraint in livexp bundle so that it explicitly requests the same version as xtext.base. I'll probably do that anyway... The only potential problem I anticipate with doing that right now would be that it is likely to break again in the future (when xtext.base upgrades their guava bundle to the newer version). So before moving on doing this I'd like to figure out why it is a problem for you and not for me. In my STS installation which I created by using "Eclipse for Java Developers" and then installing STS 4 from marketplace... In the result of that... I only see one guava bundle (we can find all the installed plugins from "Help >> About Eclipse >> Installation Details >> Plugins") . I would like to figure out somehow what it is that you installed exactly that pulled in the newer guava. So... questions...
|
I played around with the plugins to trigger the resolution error and found a small set that triggers it. These are the steps to reproduce it on my machine:
I think only a subset of the JBoss features is the culprit but I couldn't figure out which. |
Reproduced it using the last set of instructions. Thanks! |
I added the extra version constraint to our livexp bundle pinning it to guava version 21.x.x and that indeed seems to 'solve' the issue. I am actually a bit confused as to how that's really possible. As far as I know it is not possible to add more contraints to an already overconstrained problem and thereby make it solvable. Yet that seems to be what's happening. What I was expecting instead was that adding the explicit constraint would give me a different error. I was hoping that error would explain why it couldn't explicitly bind to that older version (i.e. something else explicitly forcing the newer version to be used). |
Since I am suspecting this might be a bug in Eclipse OSGI implementation, I raised this Eclipse bug here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=549431 Before adding a version contraint to our bundle, let's wait and see what they say. |
(comment in Pivotal Tracker added by Kris De Volder:) Adding Martin as owner of this ticket. When he is back from vacation he can have a look and provide some much needed expertise around OSGI related problems. I am not convinced just adding a bundle constraint is the right solution. |
(comment in Pivotal Tracker added by Martin Lippert:) I looked into this and removed the require-bundle dependency on the xtext.lib bundle, that causes too tight coupling to a specific version of guava. Then I also changed our dependencies on guava towards proper import-package definitions in the That solves the issue and allows the OSGi resolver to find a wiring that fits all the needs here. I checked this by following the steps to reproduce the issue described in the issue, with the exception of using the nightly CI p2 repo for the STS4 bits in order to get by fixes instead of the latest release on the marketplace. Works now. |
Thanks @martinlippert great you found a better solution to this. I am wondering, what is your opinion on the Eclipse bugzilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=549431)? Do you think it is a bug in osgi? Haven't had any response/feedback on the ticket since I raised it. |
I've come across a wide variety of those OSGi resolving issues in the past and there was always a good reason for the resolver to wire the bundles in the way it happened. Sometimes it is hard to find out why that specific wiring was chosen and this is the most complicated part for me when investigating those issues. I wish there would be some interactive way to talk to the resolver and ask questions like: "if you would wire this bundle is this specific way, what would happen?" The diag command gives you a good first indication where to look for the issues and running a runtime workbench might help, too, where you can easily experiment with certain bundles in certain versions being there or not. But beyond that, I would have no idea what to do about the bug item that you raised at Eclipse, to be honest... ;-) |
Well, TBH, I am also not certain its a bug. I really don't understand enough about how it is supposed to work to be able assert that the actual observed behavior is a bug or just 'normal'. |
After installing STS4 from the Eclipse Market Place I run into the following FrameworkEvent error on startup:
I am using
Eclipse IDE for Enterprise Java Developers.
Version: 2019-06 (4.12.0)
Build id: 20190614-1200
With a jdk1.8.0_192.
The text was updated successfully, but these errors were encountered: