Skip to content

Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension #2447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aruffie opened this issue Sep 9, 2021 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@aruffie
Copy link

aruffie commented Sep 9, 2021

Hello,
I recently switch from CassandraRepository to ReactiveCassandraRepository, and trying yo change my code,

I get the following exception and I doesn't found any post or solution on internet ...
do you have a idea how I can fixe/workaround it plz ?

Bellow my code:

workOrderHistoryRepository.findByDiCode(diCode).doOnNext(workOrderHistoryList::add)
					.doOnComplete(() -> {
						log.info("{} workorder history to aggregate found in cassandra for {} workorder di code", workOrderHistoryList.size(), diCode);
						workOrderHistoryBatch.put(diCode, workOrderHistoryList);

						if (workOrderHistoryBatch.size() % 10 == 0) {
							log.debug("1000 work order history get from cassandra, so process the batch");
							// Provide another reference for processing, because
							// the batch map will be clean after this instruction
							// So new map must be create in order to multiple
							// thread which process the map, keep the batch
							// history elements.
							Map<String, List<WorkOrderHistory>> tempHashMap = new HashMap<>(workOrderHistoryBatch);
							customThreadPool.submit(() -> {
								tempHashMap.keySet().parallelStream().forEach(diCodeKey -> {
									int currentCounterValue = counter.incrementAndGet();
									log.info("Process {} workorder DICode", diCodeKey);
									try {
										process(new LinkedList<>(tempHashMap.get(diCodeKey)));
									} catch (Exception e) {
										log.warn("Error occurred when processing '{}' di code: {}", diCodeKey, e.getMessage());
										throw e;
									}
									log.info("Ending {} di code processing ({} on {} totally processed in {})", diCodeKey, currentCounterValue, totalDicodes, Duration
											.between(begin, Instant.now()));
								});
							});
							log.info("10 workorder history processed");
							workOrderHistoryBatch.clear();
						}
			}).subscribe();`

Bellow my repo:

public interface WorkOrderHistoryRepository extends ReactiveCassandraRepository<WorkOrderHistory, String> {

	Flux<WorkOrderHistory> findByWorkOrderId(String workOrderId);

	@Query("SELECT * FROM workorder_history WHERE di_code = ?0 ALLOW FILTERING")
	Flux<WorkOrderHistory> findByDiCode(String diCode);}

The stacktrace:

[2021-09-09 12:36:32.954]|ERROR|main|:||||||r.core.publisher.Operators:314|||Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalStateException: Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension@3952621d
Caused by: java.lang.IllegalStateException: Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension@3952621d
	at org.springframework.data.spel.ReactiveExtensionAwareEvaluationContextProvider.lambda$getExtensions$4(ReactiveExtensionAwareEvaluationContextProvider.java:149)
	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:374)
	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:218)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86)
	at reactor.core.publisher.FluxFromMonoOperator.subscribe(FluxFromMonoOperator.java:83)
	at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8235)
	at reactor.core.publisher.FluxUsingWhen.subscribe(FluxUsingWhen.java:93)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8235)
	at reactor.core.publisher.Flux.subscribeWith(Flux.java:8408)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8205)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8129)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8047)
	at fr.dalkia.workordercomputer.webinage.business.WorkOrderManager.processByDiCodes(WorkOrderManager.java:193)
	at fr.dalkia.workordercomputer.webinage.business.WorkOrderManagerCancelledStatusTest.processByDiCodesTestCase2A(WorkOrderManagerCancelledStatusTest.java:86)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)`

Thank a lot and best regards,

Adrien

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 9, 2021
@mp911de
Copy link
Member

mp911de commented Sep 9, 2021

This issue was fixed with #2392. Please upgrade to the newest Spring Data maintenance release.

@mp911de mp911de closed this as completed Sep 9, 2021
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants