Skip to content
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

DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value. #3031

Closed
wang-sheng-pu1002 opened this issue Oct 28, 2024 · 5 comments

Comments

@wang-sheng-pu1002
Copy link

The mapper [org.springframework.data.redis.core.DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value.
java.lang.NullPointerException: The mapper [org.springframework.data.redis.core.DefaultReactiveHashOperations$$Lambda$1949/0x0000000801666b30] returned a null value.
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

The above is my error message

My partial code

private Mono<Boolean> getExpertSystemFlag(String key) {
    return reactiveRedisTemplate.opsForHash().get(key, "sessionAttr:AAA")
            .flatMap(systemFlag -> {
                return Mono.just(systemFlagList.contains(systemFlag));
            })
            .switchIfEmpty(Mono.defer(() -> {
                return Mono.just(false);
            }));
}

When I confirm the existence of this key primary key in Redis, but there is no sessionAttr: AAA object in it, I occasionally encounter an error

@wang-sheng-pu1002
Copy link
Author

  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
    <version>3.0.13</version>
  </dependency>

@wang-sheng-pu1002
Copy link
Author

@Bean(name = "reactiveRedisTemplate")
public ReactiveRedisTemplate<String, Object> reactiveRedisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
    StringRedisSerializer stringSerializer = new StringRedisSerializer();
    JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer();
    RedisSerializationContext<String, Object> serializationContext = RedisSerializationContext.<String, Object>newSerializationContext(stringSerializer)
            .key(stringSerializer)
            .hashKey(stringSerializer)
            .value(jdkSerializer)
            .hashValue(jdkSerializer)
            .build();
    return new ReactiveRedisTemplate<>(lettuceConnectionFactory, serializationContext);
}

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

mp911de commented Oct 28, 2024

If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem.
You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Please also note that the version 3.0 (and 3.1) are no longer maintained. Please consider upgrading to 3.2.x or 3.3.x

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Oct 28, 2024
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Nov 4, 2024
@spring-projects-issues
Copy link

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2024
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants