Guava 31.1 released

72 views
Skip to first unread message

Chris Povirk

unread,
Feb 28, 2022, 5:00:47 PM2/28/22
to guava-discuss
Guava 31.1 was released February 28, 2022.

See the release notes for more information.

Rakesh Singh

unread,
Apr 12, 2024, 9:43:33 AMApr 12
to guava-discuss

  Hi Team,

I am upgrading FCM sdk at backend  and using  implementation 'com.google.firebase:firebase-admin:9.2.0' 
as per support team link shared (https://firebase.google.com/docs/admin/setup).
 firebase-admin jar  is having multiple jar dependency and one of them is guava-31.1-jre.jar which is creating issue as given below..


[ERROR   ] SRVE0271E: Uncaught init() exception created by servlet [context] in application [XYZ-1.0.0-SNAPSHOT]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fcm.firebase.app' defined in ServletContext resource [/WEB-INF/applicationServicesContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ecarey.fcm.init.FirebaseInitializeApp]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com/google/common/base/Preconditions.checkArgument(ZLjava/lang/String;C)V (loaded from file:/opt/ibm/wlp/usr/servers/defaultServer/apps/expanded/ XYZ  -1.0.0-SNAPSHOT.ear/ces-twoway-web.war/WEB-INF/lib/google-collections.jar by com.ibm.ws.classloading.internal.AppClassLoader@b8877f0f) called from class com.google.common.io.BaseEncoding$Alphabet (loaded from file:/opt/ibm/wlp/usr/servers/defaultServer/apps/expanded/ces-int-twoway-1.0.0-SNAPSHOT.ear/ces-twoway-web.war/WEB-INF/lib/guava-31.1-jre.jar by com.ibm.ws.classloading.internal.AppClassLoader@b8877f0f).
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:917)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:873)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:514)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
        at java.security.AccessController.doPrivileged(AccessController.java:691)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
        at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
        at javax.servlet.GenericServlet.init(GenericServlet.java:161)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:299)
        at [internal classes] 


code snapshot: We are getting above error while nisializing the app.

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(new ClassPathResource(firebaseAppSdkPath).getInputStream())).build();
if (FirebaseApp.getApps().isEmpty()) {
firebaseApp= FirebaseApp.initializeApp(options);
logger.info(">>>>>Firebase application initialized ends<<<<<");
}


Could you please suggest the required guava jar version to make it fix.

Chris Povirk

unread,
Apr 12, 2024, 9:48:47 AMApr 12
to Rakesh Singh, guava-discuss
It sounds like you have a copy of the very old google-collections artifact on your classpath. Some of its classes conflict with the clases from guava.

You'll need to exclude google-collections from your build. The exact way to do that will depend on how your build is configured. I suggest posting what information you can to Stack Overflow.

Rakesh Singh

unread,
Apr 22, 2024, 7:24:33 AMApr 22
to Chris Povirk, guava-discuss
Hi Chris, 

Thanks for the reply. It is working now. 
How would we implement the retry?? 

Chris Povirk

unread,
Apr 24, 2024, 1:01:08 PMApr 24
to Rakesh Singh, guava-discuss
I'm not sure what you need to do with retry, but that sounds like it may be more of a question for a Firebase group.
Reply all
Reply to author
Forward
0 new messages