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.

Error in Spring Data Reactive Neo4j test

mburbidg1
Node Clone

I'm trying to create and run a simple test against my graph model using Spring Data Reactive Neo4j. But I'm getting the following exception.

 

2023-01-09 13:46:16.106  WARN 41050 --- [o4jDriverIO-2-4] .n.c.Neo4jPersistenceExceptionTranslator : Don't know how to translate exception of type class java.lang.RuntimeException
2023-01-09 13:46:16.109 ERROR 41050 --- [o4jDriverIO-2-4] reactor.core.publisher.Operators         : Operator called default onErrorDropped

reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.RuntimeException: Async resource cleanup failed after onError
Caused by: java.lang.RuntimeException: Async resource cleanup failed after onError
	at reactor.core.publisher.FluxUsingWhen$RollbackInner.onError(FluxUsingWhen.java:468) ~[reactor-core-3.4.26.jar:3.4.26]
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.26.jar:3.4.26]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.StrictSubscriber.onError(StrictSubscriber.java:106) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:201) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.reactive.InternalRxResult.lambda$null$5(InternalRxResult.java:126) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:143) ~[na:na]
	at org.neo4j.driver.internal.reactive.InternalRxResult.lambda$consume$6(InternalRxResult.java:114) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:58) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.Mono.subscribe(Mono.java:4490) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at reactor.core.publisher.FluxSource.subscribe(FluxSource.java:67) ~[reactor-core-3.4.26.jar:3.4.26]
	at reactor.core.publisher.Flux.subscribe(Flux.java:8642) ~[reactor-core-3.4.26.jar:3.4.26]
	at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364) ~[reactor-core-3.4.26.jar:3.4.26]
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:210) ~[reactor-core-3.4.26.jar:3.4.26]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.StrictSubscriber.onError(StrictSubscriber.java:106) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.FluxCreate$BaseSink.error(FluxCreate.java:474) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.FluxCreate$SerializedFluxSink.drainLoop(FluxCreate.java:237) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.FluxCreate$SerializedFluxSink.drain(FluxCreate.java:213) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.reactor.core.publisher.FluxCreate$SerializedFluxSink.error(FluxCreate.java:189) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.reactive.InternalRxResult.lambda$null$1(InternalRxResult.java:67) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) ~[na:na]
	at org.neo4j.driver.internal.reactive.InternalRxSession.lambda$releaseConnectionBeforeReturning$12(InternalRxSession.java:169) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:143) ~[na:na]
	at org.neo4j.driver.internal.reactive.InternalRxSession.releaseConnectionBeforeReturning(InternalRxSession.java:168) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.reactive.InternalRxSession.lambda$null$10(InternalRxSession.java:149) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) ~[na:na]
	at org.neo4j.driver.internal.util.Futures.lambda$asCompletionStage$0(Futures.java:75) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:557) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.DefaultPromise.access$200(DefaultPromise.java:35) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:503) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[neo4j-java-driver-4.4.11.jar:4.4.11-7d3fdc18543dae49c0c337b2885771b4f38a288d]
	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
	Suppressed: org.neo4j.driver.exceptions.ServiceUnavailableException: Connection pool for server localhost:7687 is closed while acquiring a connection.
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]
	... 12 common frames omitted

 

Here's the code to the 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();
	}
}

Here's the repo containing the entire sample: https://github.com/mburbidg/sample

 

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