cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Exception while connecting to Neo4j Desktop (Spring Data Reactive)

mburbidg1
Node Clone

I'm receiving the following exception while connecting to Neo4j Desktop.

 

 

Caused by: org.neo4j.driver.exceptions.ServiceUnavailableException: Connection pool for server localhost:7687 is closed while acquiring a connection.
	at org.neo4j.driver.internal.async.pool.ConnectionPoolImpl.processAcquisitionError(ConnectionPoolImpl.java:229) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.async.pool.ConnectionPoolImpl.lambda$acquire$0(ConnectionPoolImpl.java:130) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907) ~[na:na]
	... 15 common frames omitted
Caused by: java.lang.IllegalStateException: FixedChannelPool was closed
	at org.neo4j.driver.internal.shaded.io.netty.channel.pool.FixedChannelPool$AcquireListener.operationComplete(FixedChannelPool.java:419) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]

 

 

I'm doing this from a test. Here's the source to my test.

 

 

package com.adobe.cos.model.composite.sample;

import com.adobe.cos.model.composite.EntityNode;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.config.AbstractReactiveNeo4jConfig;
import org.springframework.data.neo4j.core.ReactiveNeo4jTemplate;
import org.springframework.data.neo4j.repository.config.EnableReactiveNeo4jRepositories;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import reactor.core.publisher.Mono;

import java.util.Collection;
import java.util.Collections;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {SampleApplicationTests.Config.class})
public class SampleApplicationTests {
	@Configuration
	@EnableReactiveNeo4jRepositories(considerNestedRepositories = true)
	@EnableTransactionManagement
	static class Config extends AbstractReactiveNeo4jConfig {
		@Bean
		public Driver driver() {
			return GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "password"));
		}

		@Override
		protected Collection<String> getMappingBasePackages() {
			return Collections.singletonList(EntityNode.class.getPackage().getName());
		}

	}

	@Test
	void templateTest(@Autowired ReactiveNeo4jTemplate reactiveNeo4jTemplate) {
		reactiveNeo4jTemplate.findAll(EntityNode.class)
				.flatMap(e -> {
					System.out.printf("entityId=%s\n", e.getAssetId());
					return Mono.just(e);
				})
				.subscribe();
	}
}

 

 

It's pretty straight forward. I have Neo4j Desktop running locally. Has anyone seen this or have any clues as to what might be going on?

I've set breakpoints in the test. It makes it to the first line. The driver appears to have been created.



0 REPLIES 0