Skip to content

jvm and thread safety #72

@SeeRich

Description

@SeeRich

I am working on a rust application with a REST API. Some of the REST endpoints need to make java function calls. I am using the Rust GUI framework Tauri. My managed state for the REST API endpoints is:

struct AppJvm(Mutex<Option<Jvm>>);

And the error I am getting is:

 `*mut *const JNINativeInterface_` cannot be sent between threads safely

Is there a way to handle this? I am essentially using this crate to create the JVM and then create a databases connection object (by called Java methods) and finally sharing this connection between REST endpoints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions