尝试连接到 neo4j 因果集群时出现错误
I am getting error when trying to connect to neo4j causal cluster
这是我的配置
org.neo4j.ogm.config.Configuration.Builder builder = new Builder();
org.neo4j.ogm.config.Configuration configuration = builder.
credentials("neo4j","neo").connectionPoolSize(20).verifyConnection(true).uri("bolt+routing://10.1.2.12:7687")
.uris(new String[]{
"bolt+routing://10.1.2.14:7687",
"bolt+routing://10.1.2.15:7687"
}).build();
return configuration;
这是我使用的错误日志中显示的内容 spring-data-neo4j 5.0.5 版本:-
2018-03-05 22:58:42.596 INFO 20927 --- [ main] Driver
: Driver instance org.neo4j.driver.internal.InternalDriver@71a9b4c7 created
2018-03-05 22:58:42.597 INFO 20927 --- [ main] LoadBalancer
: Routing table is stale. Ttl 1520270922589, currentTime
1520270922596, routers AddressSet=[10.1.2.12:7687], writers
AddressSet=[], readers AddressSet=[]
2018-03-05 22:58:43.236 INFO 20927 --- [o4jDriverIO-2-2]
ConnectionPool : Closing connection pool
towards 127.0.0.1:8000, it has no active connections and is not in the
routing table
2018-03-05 22:58:43.237 INFO 20927 --- [o4jDriverIO-2-2] LoadBalancer
: Updated routing table. Ttl 1520271223234, currentTime 1520270923237,
routers AddressSet=[localhost:7687], writers AddressSet=
[localhost:7687], readers AddressSet=[localhost:7687]
2018-03-05 22:58:43.259 INFO 20927 --- [ main]
trationDelegate$BeanPostProcessorChecker : Bean 'getSessionFactory' of
type [org.neo4j.ogm.session.SessionFactory] is not eligible for getting
processed by all BeanPostProcessors (for example: not eligible for
auto-proxying)
我在配置中遗漏了什么吗
如果您指的是日志中的最后一行,则无需担心。如果您积极想对 sessionFactory
bean 进行一些 post 处理,这可能更相关。
出现此消息的一个原因是您以急切的(正常)方式自动装配依赖项,但这根本不是问题,例如
class MyClass {
@Autowired
public MyClass(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
即使我重复一遍:这对你的应用程序来说根本不是问题,因为 class 不在你的控制之下,不需要任何 post 处理,因为它甚至不知道关于 Spring.
的存在
这是我的配置
org.neo4j.ogm.config.Configuration.Builder builder = new Builder();
org.neo4j.ogm.config.Configuration configuration = builder.
credentials("neo4j","neo").connectionPoolSize(20).verifyConnection(true).uri("bolt+routing://10.1.2.12:7687")
.uris(new String[]{
"bolt+routing://10.1.2.14:7687",
"bolt+routing://10.1.2.15:7687"
}).build();
return configuration;
这是我使用的错误日志中显示的内容 spring-data-neo4j 5.0.5 版本:-
2018-03-05 22:58:42.596 INFO 20927 --- [ main] Driver
: Driver instance org.neo4j.driver.internal.InternalDriver@71a9b4c7 created
2018-03-05 22:58:42.597 INFO 20927 --- [ main] LoadBalancer
: Routing table is stale. Ttl 1520270922589, currentTime
1520270922596, routers AddressSet=[10.1.2.12:7687], writers
AddressSet=[], readers AddressSet=[]
2018-03-05 22:58:43.236 INFO 20927 --- [o4jDriverIO-2-2]
ConnectionPool : Closing connection pool
towards 127.0.0.1:8000, it has no active connections and is not in the
routing table
2018-03-05 22:58:43.237 INFO 20927 --- [o4jDriverIO-2-2] LoadBalancer
: Updated routing table. Ttl 1520271223234, currentTime 1520270923237,
routers AddressSet=[localhost:7687], writers AddressSet=
[localhost:7687], readers AddressSet=[localhost:7687]
2018-03-05 22:58:43.259 INFO 20927 --- [ main]
trationDelegate$BeanPostProcessorChecker : Bean 'getSessionFactory' of
type [org.neo4j.ogm.session.SessionFactory] is not eligible for getting
processed by all BeanPostProcessors (for example: not eligible for
auto-proxying)
我在配置中遗漏了什么吗
如果您指的是日志中的最后一行,则无需担心。如果您积极想对 sessionFactory
bean 进行一些 post 处理,这可能更相关。
出现此消息的一个原因是您以急切的(正常)方式自动装配依赖项,但这根本不是问题,例如
class MyClass {
@Autowired
public MyClass(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
即使我重复一遍:这对你的应用程序来说根本不是问题,因为 class 不在你的控制之下,不需要任何 post 处理,因为它甚至不知道关于 Spring.
的存在