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

Tika Metadata - HashMap Issue #24

Closed
wants to merge 1 commit into from

Conversation

s4zuk3
Copy link
Contributor

@s4zuk3 s4zuk3 commented Nov 12, 2024

Hello! I've been a bit busy, but now I have time to finish this. This Draft PR is mainly to ask for help, as after trying many different configurations, I still can't get Rust to read the Java HashMap. I suspect there might be some missing configuration in the native image, but I can't figure out what it is. Do you know what I'm missing? This draft PR contains a small portion of the final PR, with an example where it’s not working (extractous-core/src/tika/jni_utils.rs ln124).

Thank you very much!

@s4zuk3
Copy link
Contributor Author

s4zuk3 commented Nov 12, 2024

@nmammeri

@nmammeri
Copy link
Contributor

nmammeri commented Nov 12, 2024

Thanks again for you valuable contribution. Yes, indeed you need to have some entries in the graalVM reflection metada. We'll help you on this. @KapiWow is looking at integrating your pull request. I think he started rebasing your previous pull request. Let's wait for his commit.

@KapiWow
Copy link
Collaborator

KapiWow commented Nov 12, 2024

Hi @s4zuk3,
Jni config is missing some methods needed for HashMap. I updated config in separate branch, you can take a look.
e5afe08
I hope it will work for you, I only have tested it locally for now. Feel free to ask if you have any other questions.

Please let us know if you have enough time to finish the metadata ticket or if we should finish it ourselves.

@s4zuk3
Copy link
Contributor Author

s4zuk3 commented Nov 12, 2024

@KapiWow, thank you so much for the help! With those changes, everything works perfectly! I really appreciate your assistance. In a few hours, I’ll have the final PR ready for review. Thank you very much.

By the way, could you explain how you generated the changes for the JNI config files? I’ve tried using AgentNative but haven’t had any success.

@nmammeri
Copy link
Contributor

@s4zuk3 it's great to that @KapiWow changes worked for you. Most of reflection data is generated automatically using the tracing agent, but sometimes it's required to add manual entries to the jni_config.json.

We have a separate repo with a lot of data files that try to exercise the dynamic paths as much as possible. We decided to have it in a separate repo to not bloat the extractous repository with loads of data files. The reflection data is mostly static and doesn't change much.

I can grant you access to this repo if you want to.

@KapiWow
Copy link
Collaborator

KapiWow commented Nov 12, 2024

Actually I added it manually, for some reasons this is not captured by agent in config.

@s4zuk3 s4zuk3 closed this Nov 12, 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

Successfully merging this pull request may close these issues.

3 participants