java.lang.IllegalAccessError: class javax.xml.parsers.FactoryFinder
See original GitHub issueHi 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:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
Using JDK 8 instead of 11 fixed the issue for me.