java.lang.IllegalArgumentException: clusterListener can not be null
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: clusterListener can not be null
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
... 18 common frames omitted
Caused by: java.lang.IllegalArgumentException: clusterListener can not be null
at com.mongodb.assertions.Assertions.notNull(Assertions.java:37) ~[mongodb-driver-core-3.6.4.jar:na]
at com.mongodb.connection.ClusterSettings$Builder.addClusterListener(ClusterSettings.java:218) ~[mongodb-driver-core-3.6.4.jar:na]
at com.mongodb.connection.DefaultClusterFactory.getClusterSettings(DefaultClusterFactory.java:190) ~[mongodb-driver-core-3.6.4.jar:na]
at com.mongodb.connection.DefaultClusterFactory.create(DefaultClusterFactory.java:80) ~[mongodb-driver-core-3.6.4.jar:na]
at com.mongodb.Mongo.createCluster(Mongo.java:682) ~[mongodb-driver-3.2.2.jar:na]
at com.mongodb.Mongo.createCluster(Mongo.java:668) ~[mongodb-driver-3.2.2.jar:na]
at com.mongodb.Mongo.createCluster(Mongo.java:642) ~[mongodb-driver-3.2.2.jar:na]
at com.mongodb.Mongo.<init>(Mongo.java:289) ~[mongodb-driver-3.2.2.jar:na]
at com.mongodb.MongoClient.<init>(MongoClient.java:268) ~[mongodb-driver-3.2.2.jar:na]
at org.springframework.boot.autoconfigure.mongo.MongoClientFactory.createMongoClient(MongoClientFactory.java:111) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoClientFactory.createNetworkMongoClient(MongoClientFactory.java:107) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoClientFactory.createMongoClient(MongoClientFactory.java:67) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.mongo(MongoAutoConfiguration.java:70) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration$$EnhancerBySpringCGLIB$$634858fd.CGLIB$mongo$1(<generated>) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration$$EnhancerBySpringCGLIB$$634858fd$$FastClassBySpringCGLIB$$85823a2.invoke(<generated>) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration$$EnhancerBySpringCGLIB$$634858fd.mongo(<generated>) ~[spring-boot-autoconfigure-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
... 19 common frames omitted
查看 pom依赖
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.2.2</version>
</dependency>
将依赖改为3.6版本就解决Exception
java.lang.IllegalArgumentException: clusterListener can not be null的更多相关文章
- Java连接MongoDB报错“java.lang.IllegalArgumentException: clusterListener can not be null”的解决办法
我使用的MongoDB版本是3.6.9. 下面是一个很基础的示例代码,功能就是连接MongoDB: package com.zifeiy.snowflake.handle.etl.mongodb; i ...
- 严重: End event threw exception java.lang.IllegalArgumentException: Can't convert argument: null
堆栈信息: 2014-6-17 10:33:58 org.apache.tomcat.util.digester.Digester endElement 严重: End event threw exc ...
- eclipse maven构建的java web工程项目 在修改了工程项目名时,tomcat启动异常java.lang.IllegalArgumentException: Can't convert argument:null
问题 我修改了前一个项目的名称.重新启动该项目至tomcat,报错:Java.lang.IllegalArgumentException: Can't convert argument: null 因 ...
- 解决——》java.lang.IllegalArgumentException: Body parameter 0 was null
1.操作2.现象(错误信息)3.原因错误代码:4.解决1)方案一:@RequestBody(required=false)2)方案二:传参数时限制authSession不能为空ody paramete ...
- java.lang.IllegalArgumentException: Can't convert argument: null
出现这样的异常:: 这是由于eclipse在修改项目名的时候,eclipse自动更新部署了web.xml文件 并且重新生成了xml文件的头部声明. 新增了java的命名把这个javaee去掉就可以了. ...
- 安卓java.lang.IllegalArgumentException: The observer is null.解决方案
刚刚在调试自己的APP项目的时候报错java.lang.IllegalArgumentException: The observer is null.,而之前是可以运行通过,所以百思不得其解,后来在网 ...
- java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"报错
出现问题的原因: 内存用户验证时,Spring boot 2.0.1引用的security 依赖是 spring security 5.X版本,此版本需要提供一个PasswordEncorder的实例 ...
- 异常java.lang.IllegalArgumentException:attempt to create delete event with null entity
异常java.lang.IllegalArgumentException:attempt to create delete event with null entity解决:路径问题,前台jsp和ja ...
- java.lang.IllegalArgumentException: name MUST NOT NULL! at org.nutz.dao.impl.NutDao.fetch
Nutz传值报错问题 作者:Vashon 时间:20150902 平台:Nutz框架 Java后台方法中拿值时报的错 报错信息: java.lang.IllegalArgumentException: ...
随机推荐
- node第一个参数必须是err
Node.js 约定回调函数第一个参数必须是错误对象err: 问题:Node.js约定回调函数第一个参数必须是错误对象err,如果没有错误该参数就是null 原因:异步执行分成两段,在两段之间抛出异常 ...
- H3C生成树的不足
- linux 运行处理者
如同前面建议的, 当内核收到一个中断, 所有的注册的处理者被调用. 一个共享的处理者 必须能够在它需要的处理的中断和其他设备产生的中断之间区分. 使用 shared=1 选项来加载 short 安装了 ...
- 2019-5-21-win10-uwp-商业游戏-1.1.5
title author date CreateTime categories win10 uwp 商业游戏 1.1.5 lindexi 2019-05-21 11:38:20 +0800 2018- ...
- java反射小实例
利用反射实现 对配置文件的更改达到更改方法的目的 文件夹目录 首先Student类中有个sleep方法 pro.properties定义了参数 最后是RelectTestMain. package c ...
- 【18.69%】【codeforces 672C】Recycling Bottles
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Python安装jpype调用java,安装jaydebeapi通过jdbc连接数据库
pip install JPype1或下载JPype1-0.7.0.tar.gz包 经常出现需要安装VC++服务等 测试代码如下: # Author: zfh import jpype,os,time ...
- python基础[18]——使用django创建一个简易的博客网站
一.页面实现 index.html base.html post.html header.html footer.html <!-- index.html--> {% extends 'b ...
- 大白话讲解Spring的@bean注解
1.Spring注解分类 从广义上Spring注解可以分为两类: 一类注解是用于注册Bean 假如IOC容器就是一间空屋子,首先这间空屋子啥都没有,我们要吃大餐,我们就要从外部搬运食材和餐具进来.这里 ...
- C++简单实现Log日志类轻量级支持格式化输出变量
CLog 头 代码很简单 如果需要的直接Ctrl+C ----Ctrl+V 即可 #ifndef __CLOG__ #define __CLOG__ #include <windows.h&g ...