You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
org.mozilla.javascript.MemberBox should reference java.net.HttpURLConnection instead of sun.net.www.protocol.http.HttpURLConnection as that is the official API and accessible under all Java versions.
Actual behavior
It throws the following error under Java versions 9+:
java.lang.IllegalAccessException: class org.mozilla.javascript.MemberBox cannot access class sun.net.www.protocol.http.HttpURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.http to unnamed module @1d3021e4
Environment (please complete the following information):
Mirth version 4.5.0
Java 21
Microsoft Windows Server 2022 Standard
Workarounds
Do not use the java implementation for java versions > 8 (but apache or others)
Add a VM flag: --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED (this, however, causes other risks as no offical API)
Make required classes visible via reflections
The text was updated successfully, but these errors were encountered:
I had to add a protocol to the url and actually call a method on the connection to get it to error.
varurl=newjava.net.URL('http://www.google.com');varconnection=url.openConnection();varinputStream=connection.getInputStream();// this is what threw the exception
This issue has already been resolved in the upstream Rhino project. I ran this code with the latest snapshot release of Rhino with java 17, and it produced the expected output.
I recently ran into this bug (again) with a customer of ours. When I tried to reproduce the bug on my own machine (Mirth Connect 4.4.2, OpenJDK 11.0.2) with your above code, everything seemed to work fine. So apparently my machine already had the latest snapshot release of Rhino, and the customer did not have that.
Can you explain to me:
how I can see that I'm working with the right version of Rhino?
how to obtain and install the right version in case I don't have it?
Describe the bug
The rhino-layer accesses an underlying Java Class that is private in Java 9+.
To Reproduce
create and execute the following code in any javascript scope:
Expected behavior
org.mozilla.javascript.MemberBox should reference java.net.HttpURLConnection instead of sun.net.www.protocol.http.HttpURLConnection as that is the official API and accessible under all Java versions.
Actual behavior
It throws the following error under Java versions 9+:
java.lang.IllegalAccessException: class org.mozilla.javascript.MemberBox cannot access class sun.net.www.protocol.http.HttpURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.http to unnamed module @1d3021e4
Environment (please complete the following information):
Workarounds
The text was updated successfully, but these errors were encountered: