Skip to content

ServiceLocator can't find an implementation in common-pool workers #568

@timsazon

Description

@timsazon

Hi, I've noticed that we can't read/create a token in a worker from ForkJoinPool.commonPool() in Spring's uber-jar application because ServiceLocator can't find an implementation for that (looks like there is a problem with context class loader related to the thread).

Example (it will throw UnavailableImplementationException for Serializer.class):

ForkJoinPool.commonPool()
        .execute(() -> Jwts.builder()
                .setClaims(Map.of(Claims.SUBJECT, "subject"))
                .compact());

Currently, I have a workaround to that by providing my own serializer (like this https://github.com/jwtk/jjwt#jackson-json-processor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions