Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.che
ckState(ZLjava/lang/String;I)V

问题原因:guava版本冲突导致的

项目中引用了google的collectors (已经废弃)还有goneCP数据库连接池(依赖了collector项目),guava

解决办法:

排除掉google的collectors ,发现goneCP报错,再升级bonecp的驱动为

<dependency>
<groupId>com.jolbox</groupId>
<artifactId>bonecp-spring</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>

注:boneCP中旧版本0.7.1中依赖google-collector,新版本0.8.0中已经移除

异常内容:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseAspect' defined in URL [jar:file:/data/work/up-pk/WEB-INF/lib/protobuf-uplive-java-3.4-
SNAPSHOT.jar!/com/asiainno/uplive/aspect/BaseAspect.class]: Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.che
ckState(ZLjava/lang/String;I)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1055)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:70)
at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1357)
at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1205)
at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:232)
at com.caucho.server.webapp.WebApp.start(WebApp.java:3574)
at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:680)
at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)
at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:530)
at com.caucho.env.deploy.DeployContainer.start(DeployContainer.java:170)
at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:728)
at com.caucho.server.host.Host.start(Host.java:677)
at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:680)
at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)

原因版本问题:

异常:Instantiation of bean failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.che ckState(ZLjava/lang/String;I)V的更多相关文章

  1. Idea运行时Scala报错Exception in thread "main" java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

    一.情况描述 使用idea +scala+spark,运行程序代码如下: package cn.idcast.hello import org.apache.spark.rdd.RDD import ...

  2. 项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError

    https://www.cnblogs.com/liuyp-ken/p/7911536.html 解决过程: 1.检查配置,反反复复看了很多遍,确认没有问题. 2. 网上找了很多资料,类似的问题很多, ...

  3. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined ...

  4. Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException

    错误提示: defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean ...

  5. Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework

    昨晚在 使用spring aop, 然后Tomcat启动的时候, 报了这么个错: Caused by: org.springframework.beans.factory.BeanCreationEx ...

  6. Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep

    body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...

  7. Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/jms/JMSContext

    参考链接 : https://blog.csdn.net/angus_Lucky/article/details/82811946?utm_source=blogxgwz7 org.springfra ...

  8. QA:Initialization of bean failed; nested exception is java.lang.AbstractMethodError

    Q: <hibernate.version>5.2.10.Final</hibernate.version><dependency> <groupId> ...

  9. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

随机推荐

  1. 链路聚合trunk实现

    用户需求 1,在原有网络基础上实现用户接入Internet 2,监控摄像头不改变原有功能 配置思路 1,首先确定接入交换机是否为管理型交换机 2, 确认接入交换机管理IP 3,划分Vlan  创建tr ...

  2. java web(三):ServletContext、session、ServletConfig、request、response对象

    上一篇讲了Servlet: 1)什么是Servlet[servlet本身就是一种Java类,这种Java类提供了web形式的方法,只要实现了servlet接口的类,都是一种servlet资源.] 2) ...

  3. PythonStudy——装饰器 Decorator

    def outer(func): def inner(): print("新增功能1") func() print("新增功能2") return inner ...

  4. redis五种数据类型和常用命令及适用场景

    一.redis的5种数据类型: 1.基础理解: string 字符串(可以为整形.浮点型和字符串,统称为元素) list 列表(实现队列,元素不唯一,先入先出原则) set 集合(各不相同的元素) h ...

  5. Centos7下使用yum源安装zabbix Server

    系统:Centos7 zabbix版本:4.2   一.Zabbix Server端   1.安装仓库 rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel ...

  6. 两个Integer变量a和b,值相等,a==b等于多少?

    Integer a = Integer.valueOf(127); Integer b = Integer.valueOf(127);   Integer c = Integer.valueOf(12 ...

  7. Python开发工程师技术手记

    Python基础篇 PythonPEP8规范 Python历史与安装 Python注释 Python变量以及类型 Python标识符和关键字 Python输出 Python输入 Python运算符 P ...

  8. TypeScript安装备忘:npm proxy设置

    如果使用了代理网络,因为npm无法自动识别Internet代理,则需要手动设置npm代理才能下载包. 设置命令:    npm config set proxy http://proxyhost:pr ...

  9. C# 导出Excel Table td 样式

    <td style="vnd.ms-excel.numberformat:@;"><s:property value="accountCode" ...

  10. [UE4]引用Grabbable接口

    一.当前:可抓取对象的类型是GrabTargetActor 二.修改目标:可抓取对象的类型改成Grabbable. 1.Fand Grab Target的返回值改成Grabbale(变量的数据类型可以 ...