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

SecurityException during native image compilation #1589

Open
BoykoAlex opened this issue Oct 13, 2023 · 1 comment
Open

SecurityException during native image compilation #1589

BoykoAlex opened this issue Oct 13, 2023 · 1 comment

Comments

@BoykoAlex
Copy link
Contributor

I'm trying to native compile a language server app (Boot LS) that depends on lemminx jar. The error is below:

Caused by: java.lang.SecurityException: class "com.thaiopensource.relaxng.pattern.MySchemaPatternBuilder"'s signer information does not match signer information of other classes in the same package
	at java.base/java.lang.ClassLoader.checkCerts(ClassLoader.java:1158)
	at java.base/java.lang.ClassLoader.preDefineClass(ClassLoader.java:902)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1010)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVM.resolveTypeInPool(Native Method)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotConstantPool.loadReferencedType(HotSpotConstantPool.java:773)
	at java.base/jdk.internal.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.WrappedConstantPool.loadReferencedType(WrappedConstantPool.java:152)

The issue is that com.thaiopensource.relaxng.pattern package is contained in 2 different JARs: lemminx and jing (dependency)

I noticed that there is a native-image folder contained the project which means this project likely was attempted to be compiled into a native image. Wonder if this compilation has succeeded and if yes how did you get around the error above? Has there been a way to suppress the SecurityException in the analysis stage?

If this was an issue previously as well wonder how hard it would be renaming com.thaiopensource.relaxng.pattern package in lemminx code base?

@angelozerr
Copy link
Contributor

If this was an issue previously as well wonder how hard it would be renaming com.thaiopensource.relaxng.pattern package in lemminx code base?

It is a problem with jing, See relaxng/jing-trang#271

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