Skip to content

Instantiating Cache in a custom system class loader leads to a recursive invocation exceptionΒ #6565

Closed

Description

@01es

Having a custom system class loader, which instantiates com.google.common.cache.Cache as part of its construction results in recursive invocation exception.

The error occurs in line 240 of com.google.common.cache.CacheBuilder. The code comment suggests that this situation was envisaged. This was working correctly in version 31.1-jre and the error started to manifest in version 32.0.0-jre.

image

Activity

  1. self-assigned this
    on Jun 20, 2023
  2. cpovirk commented on Jun 20, 2023

    @cpovirk
    Member

    Thanks.

    I can back out that change. In the abstract, I would say that "using Guava from a system class loader" is a use case that we wouldn't necessarily go to much effort to support, so no guarantees on future support for this in general. But please do let us know of other such problems, and if they're as easy to fix as this one, we can probably take care of them, too. (As you saw, we have at least one such class loader internally, so that code might continue to catch some problems that might otherwise affect you.)

  3. cpovirk commented on Jun 20, 2023

    @cpovirk
    Member

    If you're in a position to build your own copy of Guava with the fix and verify that this is the only problem lambda, that could help: The Guava release that fixes this will be the third release in about a month, so I'd love if we could avoid having to release a fourth with an additional fix :)

  4. 01es commented on Jun 21, 2023

    @01es
    Author

    @cpovirk, thank you for your comment re "using Guava from a system class loader" – something to keep in mind moving forward.

    I have checkout the source under tag v32.0.1, made the change (patch) as depicted below, and voila – everything works at our end. Thank you.
    image

  5. cpovirk commented on Jun 30, 2023

    @cpovirk
    Member

    The fix landed in 32.1.0, but because we got the Gradle metadata wrong in that release, I suggest going straight to 32.1.1, which also contains the fix for that problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions