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

Consider all output lines of java -version when determining the version of GraalVM #1182

Open
vatbub opened this issue Oct 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@vatbub
Copy link

vatbub commented Oct 13, 2022

I am facing an issue where my anti virus program injects a java agent into any java process (c.f. this question on StackOverflow). The result is that any executions of the java command emit the following output first:

[0.038s][warning][jni,resolve] Re-registering of platform native method: java.lang.PanwHooks.NativeMethodEntry(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang
/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V from code in a different classloader

The output of java -version therefore looks like so:

[0.059s][warning][jni,resolve] Re-registering of platform native method: java.lang.PanwHooks.NativeMethodEntry(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V from code in a different classloader
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06)
OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)

The result is that Substrate fails to determine the version of the GraalVM as it gets tripped by the first line in output.

Expected Behavior

Substrate should ignore any lines it can't parse and determine the version of GraalVM correctly.

Current Behavior

The following IOException is thrown:

java.io.IOException: Couldn't determine GraalVM's Java version for [0.067s][warning][jni,resolve] Re-registering of platform native method: java.lang.PanwHooks.NativeMethodEntry(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Obje
ct;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V from code in a different classloader
        at com.gluonhq.substrate.model.InternalProjectConfiguration.getGraalVMJavaVersion(InternalProjectConfiguration.java:662)
        at com.gluonhq.substrate.model.InternalProjectConfiguration.checkGraalVMJavaVersion(InternalProjectConfiguration.java:480)
        at com.gluonhq.substrate.SubstrateDispatcher.<init>(SubstrateDispatcher.java:382)
        at com.gluonhq.NativeBaseMojo.createSubstrateDispatcher(NativeBaseMojo.java:159)
        at com.gluonhq.NativePackageMojo.execute(NativePackageMojo.java:47)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
...

Steps to Reproduce

  1. Run mvn gluonfx-maven-plugin:package

Your Environment

The anti virus that my company is using is Cortex by Palo Alto Networks

Rest of my environment:

  • Windows 10
  • Java version under which Maven is executed: Temurin-17.0.4.1+1
  • GraalVM version as described above
  • gluonfx-maven-plugin version 1.0.15
    If you need any help with testing, let me know.
@vatbub vatbub added the bug Something isn't working label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant