Skip to content

Conversation

@cloojure
Copy link

@cloojure cloojure commented Mar 2, 2019

Upgrading from Clojure 1.9 to 1.10, I am getting a new warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by clojure.lang.InjectedInvoker/0x0000000800231c40 (file:/home/alan/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar) to method com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(org.xml.sax.InputSource,org.xml.sax.HandlerBase)
WARNING: Please consider reporting this to the maintainers of clojure.lang.InjectedInvoker/0x0000000800231c40
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

Using Java 11 on Ubuntu 16.04.

This can be fixed by type hints on the net.cgrand.xml/startparse-sax method. I also upgraded the project.clj to current versions of lein and jsoup. Tests are clean:

~/gh/enlive > lein clean ; lein test

lein test net.cgrand.enlive-html.test

lein test tst.net.cgrand.xml

Ran 31 tests containing 105 assertions.
0 failures, 0 errors.

~/gh/enlive > java --version ; lein --version
java 11 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Leiningen 2.9.0 on Java 11 Java HotSpot(TM) 64-Bit Server VM

@pbwolf
Copy link

pbwolf commented Mar 2, 2019

Uh oh, does the 1st argument have to be nailed down? The docstring (of a function that calls this one in the same file) says s may be "a File, InputStream or String naming a URI". That docstring matches clojure.xml/parse, and both of those functions actually also accept InputSource (which was suggested to be documented in Clojure here (https://dev.clojure.org/jira/browse/CLJ-1290)), which in turn accepts a Reader, which is the most direct way to parse XML content of a string... a StringReader in an InputSource. In short, the new constraint to just accept nothing but InputStream should be documented or, better yet, an alternative found without such a constraint.

@gloorfindel
Copy link

This error was resolved by updating from clojure version from 1.10 to 1.10.1 for me.

tomoharu-fujita added a commit to Connecty/enlive that referenced this pull request Jan 28, 2026
Major changes:
- Fix all reflection warnings for modern JVM compatibility (cgrand#158, PR cgrand#152)
- Update jsoup from 1.7.2 to 1.18.3
- Add missing HTML5 void elements: col, embed, keygen, param, source, track, wbr (cgrand#140)
- JSoup parser now supports Reader input (enables html-snippet) (cgrand#90)
- Improve error message for missing resources with MissingResourceException (cgrand#154, PR cgrand#155)
- Migrate from Leiningen to tools.deps (deps.edn)
- Replace Travis CI with GitHub Actions (Java 11/17/21 matrix)
- Remove obsolete build.xml (Ant)

See CHANGELOG.md for full details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants