Skip to content

Class org.mozilla.javascript.MemberBox cannot access class sun.net.www.protocol.http.HttpURLConnection #6273

Answered by rjkroll
Coooz asked this question in Q&A
Discussion options

You must be logged in to vote

Because of Java 9 and its access restrictions, and the fact Mirth uses Rhino, there are issues when trying to access an internal Java class that is not meant to be directly access by external code. Java recommends that you try using java.net.HttpUrlConnection and its API to get around this.

EDIT: This solution was generated by AI after I ran through the function and error: https://www.perplexity.ai/search/here-is-my-code-in-mirth-conne-MWZBQtutR4O6K2Upzf6NfQ

You could maybe try this:

function check_http(url, timeout) {
    var url_check = new java.net.URL(url);
    var conn = null;
    
    try {
        conn = url_check.openConnection();
        
        if (conn instanceof java.net.Http…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@pacmano1
Comment options

@rjkroll
Comment options

@pacmano1
Comment options

@Coooz
Comment options

Answer selected by Coooz
Comment options

You must be logged in to vote
3 replies
@Coooz
Comment options

@pacmano1
Comment options

@Coooz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants