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

Illegal reflective access warnings when doing through the default steps in readme with java11 #19

Closed
kulminaator opened this issue Dec 8, 2018 · 7 comments
Labels
bug Something isn't working http-client

Comments

@kulminaator
Copy link

Environment Ubuntu 18.10 box:

$ uname -a
Linux martin-nitro 4.18.0-12-generic #13-Ubuntu SMP Wed Nov 14 15:17:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)

$ lein --version
Leiningen 2.8.1 on Java 11.0.1 OpenJDK 64-Bit Server VM

#obviously keeping dummy usernames in default aws config for start
$ cat ~/.aws/credentials 
[default]
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY
region=eu-west-1

Steps followed :
Creating a new app with leiningen
lein new app aws-api-testbed

Modifying only the dependencies in project file to contain the latest versions, after edit looks like this

$ cat project.clj 
(defproject aws-api-testbed "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
 :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
    [org.clojure/clojure "1.10.0-RC4"]
    [org.clojure/core.async "0.4.490"]
    [com.cognitect.aws/api "0.8.122"]
    [com.cognitect.aws/endpoints "1.1.11.462"]
    [com.cognitect.aws/s3 "680.2.370.0"]
    ]
  :main ^:skip-aot aws-api-testbed.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Now executing with lein repl:

$ lein repl
nREPL server started on port 43883 on host 127.0.0.1 - nrepl://127.0.0.1:43883
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.10.0-RC4
OpenJDK 64-Bit Server VM 11.0.1+13-Ubuntu-2ubuntu1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

aws-api-testbed.core=> (require '[cognitect.aws.client.api :as aws])
nil
aws-api-testbed.core=> (def s3-client (aws/client {:api :s3}))
2018-12-08 18:27:08.035:INFO::async-dispatch-1: Logging initialized @12589ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.jetty.util.BufferUtil (file:/home/martin/.m2/repository/org/eclipse/jetty/jetty-util/9.3.7.v20160115/jetty-util-9.3.7.v20160115.jar) to field java.nio.MappedByteBuffer.fd
WARNING: Please consider reporting this to the maintainers of org.eclipse.jetty.util.BufferUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Syntax error (ExceptionInfo) compiling at (form-init14772803263696788523.clj:1:16).
No region found by any region provider.
aws-api-testbed.core=> 

Just maybe the final error has some reason for the illegal reflective access ?

@dchelimsky
Copy link
Contributor

Thanks for this report. We're using an older version of jetty (transitive dep), so this may just be a matter of upgrading.

@dchelimsky dchelimsky added the bug Something isn't working label Dec 11, 2018
@ghost
Copy link

ghost commented May 2, 2019

Can confirm, on openjdk11 updating the jetty dependencies resolves this issue. It did bring up another illegal access at https://github.com/cognitect-labs/aws-api/blob/master/src/cognitect/aws/util.clj#L137, but could be unrelated.

@dchelimsky
Copy link
Contributor

dchelimsky commented May 17, 2019

d4d9870 resolves the xml parse warning, but now seeing the following with jetty 9.4.18.v20190429 and java 11.0.2.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson049.orchard.v0v4v0.dynapath.v0v2v5.dynapath.defaults$eval2067$fn__2068 to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of mranderson049.orchard.v0v4v0.dynapath.v0v2v5.dynapath.defaults$eval2067$fn__2068
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@dchelimsky
Copy link
Contributor

This new illegal reflective access issue is coming from cider-nrepl's dependency on mranderson and is not related to jetty, xml, or aws-api. The next release will, however, fix the issues related to jetty and xml.

@dchelimsky
Copy link
Contributor

Fixed in 0.8.335.

@payneio
Copy link

payneio commented Jul 26, 2019

Can confirm, on openjdk11 updating the jetty dependencies resolves this issue. It did bring up another illegal access at https://github.com/cognitect-labs/aws-api/blob/master/src/cognitect/aws/util.clj#L137, but could be unrelated.

How does one "update ... jetty dependencies"?

@dchelimsky
Copy link
Contributor

How does one "update ... jetty dependencies"?

If you're using tools.deps, use :override-deps (see https://clojure.org/reference/deps_and_cli#_resolve_deps). AFAIK, Leiningen and Boot each offer ways to override transitive dependencies as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working http-client
Projects
None yet
Development

No branches or pull requests

3 participants