Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Is it acceptable to have two com.google.common.collect providers?

Hi

I raised this issue somewhat speculatively before.

I now raise this as a real problem on 3.8M5.

Xtext gives me a dependency that loads com.google.guava_10.0.1.1.jar.
Acceleo gives me a dependency that loads com.google.collect_1.0.0.v201105210816.jar

Both provide com.google.common.collect.SetMultimap so I'm not surprised that Hudson gives me:
java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated
loading for a different type with name "com/google/common/collect/SetMultimap"

Surely one of com.google.collect or com.google.guava must be changed?

Even if Acceleo migrates to guava, this problem will still occur for any other plugin that continues to use the Indigo libraries.

I see the problem in an JUnit test run as a plugin test. The same JUnit test run as an ordinary test has no problem, so perhaps there is a relative loading order of com.google.guava and com.google.collect that can be enforced to avoid the problem.

    Regards

        Ed Willink

On 16/12/2011 15:11, Stéphane Bégaudeau wrote:
Hi,

I have already encountered some problems with several providers of a same package. If a project "A" uses "com.google.guava" and if a project "B" uses and reexports "com.google.collect", a plugin "C" depending on both projects can be crippled by ClassLoader issues. If the plugin "C" does not have any dependencies with guava or google.collect but if it is extending a class of the plugin "A" that is using some elements of Google Collection from guava then when you will manipulate the class from the plugin "C" linkage errors will appear.

As for Acceleo, we were waiting for the release of com.google.guava 10 to start a switch from "com.google.collect" to "com.google.guava". We will do it in the weeks to come (maybe for M5) and we will make sure not to reexport it :)

Regards,

Stephane Begaudeau

Le 16/12/2011 15:46, Sven Efftinge a écrit :
On Dec 16, 2011, at 3:42 PM, Ed Willink wrote:

Hi John, Sven

Thanks. It appears the double package provider is not a major concern, so I've done my job by raising the possible issue.
Great!

OCL was easily fixed by changing the require bundle from com.google.collect to com.google.guava.
I think that even shouldn't be necessary as long as you have com.google.collect installed.
I suspect it didn't work in your case, since the old bundle is no longer there, because it's no longer shipped with Xtext.

Sven
_______________________________________________
cross-project-issues-dev mailing list
cross-project-issues-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cross-project-issues-dev




_______________________________________________
cross-project-issues-dev mailing list
cross-project-issues-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cross-project-issues-dev


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4735 - Release Date: 01/10/12


Back to the top