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.

org.w3c.dom is accessible from more than one module: <unnamed>, java.xml during building

See original GitHub issue

TestNG Version

testng-7.6.2-20221104.005911-6.jar openjdk 17.0.1 2021-10-19 Apache Maven 3.6.3

Expected behavior

No error

Actual behavior

mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\apache-maven-3.6.3\bin\..
Java version: 17.0.1, vendor: Oracle Corporation, runtime: C:\Program Files (x86)\Java\jdk-17.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
[ERROR] Failed to execute goal dev.aspectj:aspectj-maven-plugin:1.13.1:compile (compile_with_aspectj) on project: AJC compiler errors:

[ERROR] error at import javax.xml.parsers.DocumentBuilder;
[ERROR]        ^^^^^^^^^^^^^^^^
[ERROR] /src/main/java/com/LogHandler.java:7:0::0 The package javax.xml.parsers is accessible from more than one module: <unnamed>, java.xml
[ERROR] error at import javax.xml.parsers.DocumentBuilderFactory;
[ERROR]        ^^^^^^^^^^^^^^^^
[ERROR] /src/main/java/com/LogHandler.java:8:0::0 The package javax.xml.parsers is accessible from more than one module: <unnamed>, java.xml
[ERROR] error at import org.w3c.dom.Document;
[ERROR]        ^^^^^^^^^^

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

Please, share the test case (as small as possible) which shows the issue None

Contribution guidelines

Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.

####
new testng involved com.github.spotbugs:spotbugs:jar:4.7.1:compile that dependent on jaxen and saxon, that depend on xml-apis

      jaxen:jaxen:jar:1.2.0:test
         xml-apis:xml-apis:jar:1.3.02:provided
      net.sf.saxon:Saxon-HE:jar:11.3:provided
          org.xmlresolver:xmlresolver:jar:4.2.0:provided
          org.xmlresolver:xmlresolver:jar:data:4.2.0:provided

in xml-apis, there are org.w3c and javax.xml in jar file. so there is conflict:

image

ref: https://support.tibco.com/s/article/Upgrading-Streaming-projects-to-use-Java-11-package-is-accessible-from-more-than-one-module https://stackoverflow.com/questions/68839894/java-11-migration-package-is-accessible-from-more-than-one-module-issue https://stackoverflow.com/questions/57286825/the-package-org-w3c-dom-is-accessible-from-more-than-one-module-unnamed-java

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bobshiecommented, Nov 9, 2022

@krmahadevan , I can try to fix it in next week.

0reactions
krmahadevancommented, Nov 14, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

The package org.w3c.dom is accessible from more than one ...
The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml. I wanted to migrate a project from Java 8 to Java...
Read more >
Solved: Eclipse JDK8 to JDK11 Issue: Package is accessible...
Solved: When trying to compile the Windchill Customizations (developed ... Eclipse JDK8 to JDK11 Issue: Package is accessible from more than one module....
Read more >
The package {package} is accessible from more than one ...
When migrating from Java 8 to Java 17 I began getting errors like this. “The package org.w3c.dom.html is accessible from more than one...
Read more >
The package org.w3c.dom is accessible from more than one ...
[Solved]-The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml-eclipse ... If you are in a simple Java Project, not Maven....
Read more >
Need help with plugin transition to Java11 - KNIME Forum
The package org.w3c.dom is accessible from more than one module: , java.xml. I tried several things but nothing seems to work.
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