question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalAccessError: class javax.xml.parsers.FactoryFinder

See original GitHub issue

Hi All,

I am trying to run my Junit test but getting the below error. Any help would be really appreciated.

I am using PowerMockRunner in my test cases.

java.lang.IllegalAccessError: class javax.xml.parsers.FactoryFinder (in unnamed module @0x6dd79214) cannot access class jdk.xml.internal.SecuritySupport (in module java.xml) because module java.xml does not export jdk.xml.internal to unnamed module @0x6dd79214 at javax.xml.parsers.FactoryFinder.<clinit>(FactoryFinder.java:69) at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:140)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

57reactions
bharukaRupeshcommented, Apr 9, 2019

@hiteshbargujar I can’t exactly recollect the solution as there were lot of such errors which I have resolved in one go.

could you please try adding @PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"}) at class level?

Probably this shall resolve your issue.

5reactions
joriouxcommented, May 5, 2021

Using JDK 8 instead of 11 fixed the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

spring - java.lang.IllegalAccessError: class javax.xml.parsers ...
All of a sudden when I try to run my application I am geeting the following error. INFO: Starting Servlet Engine: Apache Tomcat/7.0.16...
Read more >
java.lang.IllegalAccessError: class javax.xml.parsers.Securi
Hi, I am in the process of migrating my application from 4.0.3SP1 to 5.0.0.CR1, on Win XP SP1, and am receiving the following...
Read more >
Jonathan LALOU on Twitter: "While upgrading from Java 8 to ...
While upgrading from Java 8 to Java 11, I got this error with #Powermock: ``` java.lang.IllegalAccessError: class javax.xml.parsers.
Read more >
PowerMockRule problem when used with XML parsing code
if the newInstance() call specifies the XML impl class and the ... javax.xml.parsers.DocumentBuilderFactory. ... at java.lang.reflect.
Read more >
JDK-4633368 javax.xml.parsers.FactoryFinder ... - Bug ID
java ', followed by the error output given below. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.lang.reflect.InvocationTargetException: javax.xml.parsers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found