You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/12/15 01:32:36 UTC

[GitHub] [daffodil-vscode] Shanedell opened a new issue, #386: DISCUSSION: Issue with Java in Mac CI

Shanedell opened a new issue, #386:
URL: https://github.com/apache/daffodil-vscode/issues/386

   I am working on a PR for getting the daffodil-debugger to run in CI for tests. I am able to do it fine locally using macos with java 11.0.17+8. However, using this same version in CI fails for macos, but not the others for some reason. I added some debug statements to the CI for macos and it prints this out
   
   ```java
   Error: A JNI error has occurred, please check your installation and try again
   Error: Exception in thread "main" java.lang.UnsupportedClassVersionError: com/microsoft/java/debug/core/protocol
   /Messages$Request has been compiled by a more recent version of the Java Runtime (class file version 55.0), this
   version of the Java Runtime only recognizes class file versions up to 52.0
   	at java.lang.ClassLoader.defineClass1(Native Method)
   	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
   	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
   	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   	at java.lang.Class.getDeclaredMethods0(Native Method)
   	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
   	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
   	at java.lang.Class.getMethod0(Class.java:3018)
   	at java.lang.Class.getMethod(Class.java:1784)
   	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
   	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
   ```
   
   this makes it seem like it isn't using java 11 correct?
   
   @stevedlawrence @arosien @mbeckerle @tuxji 
   
   CI workflow being referred to can be found at: https://github.com/Shanedell/daffodil-vscode/actions/runs/3700068215


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353272195

   @mbeckerle, the [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) extension has an embedded Java 17 JDK that it can use internally without having to worry about whatever is installed on the OS, but it can be [configured to use different runtimes](https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements), to include Java 19.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] mbeckerle commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353208074

   Open JDK 8 is supported until Nov 2026, so there is no issue with sticking with it. 
   
   But... I definitely want to run my Daffodil VSCode, and point it at my development version of Daffodil, which I build locally, and where I am currently using Java 19 (latest and greatest right now).  
   
   So I would very much like to avoid tying Daffodil VSCode Extension to Java 8, or 11, or any older Java, just due to some dependency. 
   
   Why do we need this microsoft com.microsoft.java.debug.core library (which implements the Java Debug Protocol) anyway? I thought we had our own protocol for talking to Daffodil as a server from the VSCode GUI. (DAP)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] mbeckerle commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353478182

   @Shanedell yes. This sounds like the right fix.  Java 17 required us to upgrade to Scala 2.12.15+ libraries, but those are compatible backward to Java 8. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353069368

   We should go back to using Java 8 anyway, see: https://github.com/apache/daffodil-vscode/issues/337.  The Java 8 jars will work on Java 11, but not necessarily the other way around.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1352470828

   Looks like it is in fact trying to use java 8 by default. I took a look at these documents:
   
   - https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md
   - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
   - https://github.com/actions/runner-images/blob/main/images/win/Windows2019-Readme.md
   - https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md
   
   Looking at these documents java 8 is the default on mac and windows but not linux. So, possibly Windows set java home as 11 properly but macos is having an issue with it? Or something with running the sbt command through yarn is causing issues, but I would expect that to happen on all 3 then. I tried it with macos-12, to see if it was only an issue with macos-11, but it got the same error. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353296756

   @scholarsmate ah gotcha. But still based on what @mbeckerle stated, I think we do want to use whatever runtime is installed and set as the default on the host. As if he is using JDK 19 testing a local daffodil version it would probably be easier that the debugger is compiled using his hosts default JDK. As using this Red Hat extension to be able to do that he would then need to go through and specify settings for where the JDK is at and make sure it is the one that is going to be used.
   
   But to that same point I am unaware of how we would be able to use the extensions provided JDK to run our Scala servers. This is because the scripts for running the servers are based on what the value of `bundled_jvm` and/or `JAVA_HOME` are set to. So, to be able to use this extension we would need to find the path to the extensions provided JDK and make sure to set one of those ENV's to that value or if they specify an alternative runtime, as mentioned in the doc linked, we would need to read in those settings, grab the version desired then pass into the script. So, I believe trying to do this will cause more work to be able to get the servers to run for both a developer and a regular user.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1385696877

   This issue was resolved closing this item


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353206517

   Confirmed that the [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug) is using [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353223710

   [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) embeds JDK 17 per their [documentation](https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353204297

   That extension is a language server, I believe you still need to set a setting for the extension to find the JDK to use. I don't think it has an embedded jdk that would be difficult to do. It looks like to be able to support Java 8 we would need to downgrade the `com.microsoft.java.debug.core` to `v0.34.0` as that is the last version built using java 8.
   
   @mbeckerle @stevedlawrence @tuxji Do you think we would want to downgrade this version to get support of Java 8 or what would your recommendations be?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353262770

   @Shanedell, I'm not advocating for us to embed a JDK.  What I'm advocating for is using the [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) extension to run our language server and not rely on the OS-installed one.  This is what the Microsoft Java debugger is doing and I think we should be doing the same, even if it turns out we don't _need_ the Microsoft Java debugger, we still want the Language Support for Java by Red Hat to provide the JDK/JRE to run our Scala servers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353190744

   Doing a bit more digging I found [this](https://github.com/microsoft/java-debug/pull/393), so it appears the Java debugger is using an embedded JDK that comes from another extension that provides Java language support in VS Code.  The extension they mention hasn't been updated in many years, so I think they're really referring to [this one](https://marketplace.visualstudio.com/items?itemName=redhat.java) which is actively maintained by Red Hat.  Since the Java debugger, uses a Java Language Support extension, then we ought to be using the same embedded JDK rather than the OS provided one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell closed issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell closed issue #386: DISCUSSION: Issue with Java in Mac CI
URL: https://github.com/apache/daffodil-vscode/issues/386


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353224562

   I believe it is used to get support of events, messages, request, responses, etc. @arosien Could probably better explain its usefulness better than I can. It is mostly used in three files:
   
   ```scala
   server/core/src/main/scala/org.apache.daffodil.debugger.dap/DAPodil.scala
   server/core/src/main/scala/org.apache.daffodil.debugger.dap/logging.scala
   server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala
   ```
   
   Also if you are worried about it being tied to that specific version that I believe that won't happen. I believe, it would mostly be what is the oldest version of Java supported to run the debugger. If the oldest is 8 it should work on all other versions greater than 8.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353819072

   This update should also close https://github.com/apache/daffodil-vscode/issues/337.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] scholarsmate commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
scholarsmate commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353151109

   The current version is actually v0.43.0 as of November 2022.  They had to move to Java 17 in June because one of their dependencies moved to Java 17 (see: https://github.com/microsoft/java-debug/issues/419).  Here is the PR where they made that move (https://github.com/microsoft/java-debug/pull/420/files).
   
   If we're going to be forced to upgrade our Java build anytime one of our dependencies upgrades their builds, then we'll continue to struggle with compatibility issues on our supported operating systems.  In my opinion, we should strive to maintain Java 8 compatibility for as long as we can, even if that means pinning down some of our dependencies.  If we can manage this, then OSes running Java 8+ will work, otherwise we're forcing users to upgrade their JVMs which could be a bridge too far for some users.
   
   To get around version issues like this, some projects instead opt to package a JDK with their product.  Im not advocating for this, but it is another solution to the problem we're facing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353074445

   Well with the current version of `com.microsoft.java.debug.core` (v0.38.0) it is compiled for Java 11 and up. So, we either can only support Java 11+ if we want to keep that the same or we need to downgrade `com.microsoft.java.debug.core` to a version compiled again Java 8. I had tried downgrading this to `v0.37.0` and there were a bunch of errors in the scala code that would need fixed. @mbeckerle @stevedlawrence Any thoughts on what would be best, do you think we should downgrade that package, fix the issues and make scala-steward ignore it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353226128

   > [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) embeds JDK 17 per their [documentation](https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements).
   
   I believe based on @mbeckerle response I don't think we want to embed a JDK into the extension.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil-vscode] Shanedell commented on issue #386: DISCUSSION: Issue with Java in Mac CI

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #386:
URL: https://github.com/apache/daffodil-vscode/issues/386#issuecomment-1353310485

   @mbeckerle To get this to support Java 8, tested locally, I downgraded the `com.microsoft.java.debug.core` to `v0.34.0` and had to remove one line of Scala code and it worked. I then remade the debugger using Java 11, 17 and 19 and they all worked as well. Would this be okay to add into my PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org