Hi Team,
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.