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

Crash issue with GraalVM #93

Open
stef-pellegrino opened this issue May 20, 2024 · 1 comment
Open

Crash issue with GraalVM #93

stef-pellegrino opened this issue May 20, 2024 · 1 comment
Assignees

Comments

@stef-pellegrino
Copy link

The "Port forwarding" sample does not work with this configuration:

  • Java 22
  • Windows 11
  • Last release of GraalVM (java 22.0.1-graal)

Works perfectly with fat .jar (JVM), but crashes badly when compiling against "native-image"

@brett-smith
Copy link
Contributor

Synergy has a few features that are currently using reflection. This means those particular features will not work with native image without some extra meta-data.

You can either run the example once with the native image tracing agent enabled, or you can hand-craft a META-INF/native-image/synergy/reflect-config.json resource and bundle it inside your jar before native compilation.

I just gave the example a quick try, and can confirm this is needed in this case. Add the following to reflect-config.json.

[
{
  "name":"com.sshtools.common.events.EventCodes",
  "allPublicFields":true
},
{
  "name":"com.sshtools.common.forwarding.ForwardingPolicy",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"com.sshtools.common.permissions.IPPolicy",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"com.sshtools.common.policy.AuthenticationPolicy",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"com.sshtools.common.policy.FileSystemPolicy",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"com.sshtools.common.publickey.bc.OpenSSHPrivateKeyFileBC"
},
{
  "name":"com.sshtools.common.shell.ShellPolicy",
  "methods":[{"name":"<init>","parameterTypes":[] }]
}
]

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

2 participants