TimurMahammadov / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

google-collections conflict with guava library #113

Closed HeliosPip closed 2 years ago

HeliosPip commented 2 years ago

When I use in the same project guava and google-collections (indirectly, so I use dependency from another dependencies in my maven) I have in WAR libs both google-collections and guava. As a result I have exceptions like this

Caused by: java.lang.NoSuchMethodError: com.google.common.base.Platform.stringIsNullOrEmpty(Ljava/lang/String;)Z
    at com.google.common.base.Strings.isNullOrEmpty(Strings.java:73)
    at org.richfaces.application.configuration.ConfigurationServiceImpl.getInitParameterValue(ConfigurationServiceImpl.java:96)
    at org.richfaces.application.configuration.ConfigurationServiceImpl.createContextValueExpression(ConfigurationServiceImpl.java:154)
    at org.richfaces.application.configuration.ConfigurationServiceImpl.getValue(ConfigurationServiceImpl.java:176)
    at org.richfaces.application.configuration.ConfigurationServiceImpl.getIntValue(ConfigurationServiceImpl.java:263)
    at org.richfaces.application.configuration.ConfigurationServiceHelper.getIntConfigurationValue(ConfigurationServiceHelper.java:41)
    at org.richfaces.cache.lru.LRUMapCacheFactory.createCache(LRUMapCacheFactory.java:45)
    at org.richfaces.cache.CacheManager.createCache(CacheManager.java:54)
    at org.richfaces.application.CacheProvider.init(CacheProvider.java:108)
    at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:32)
    at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:130)
    at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:68)
    at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)
    at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
    at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2187)
    at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2163)
    at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303)
    at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:691)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:253)
    ... 41 more

I spent some time for investigation and found that google-collections have the same Platform class in the same package com.google.common.base as original guava. Why you cannot use dependency to original guava library? How can I avoid this issue when I need both libraries one of them depends on guava, another depend on google-collections.

Sincerely