Net2Plan is a free and open-source Java tool devoted to the planning, optimization and evaluation of communication networks. It has been originally thought as a tool to assist the teaching of communication networks courses. Eventually it has converted into a powerful network optimization and planning tool for the academia and industry, together with a growing repository of network planning resources.
BSD 2-Clause "Simplified" License
85
stars
38
forks
source link
“NoSuchMethodErrors” due to multiple versions of org.codehaus.woodstox:stax2-api:jar #252
Hi, there are multiple versions of org.codehaus.woodstox:stax2-api in Net2Plan\Net2Plan-Core. As shown in the following dependency tree, according to Maven's “nearest wins” strategy, only org.codehaus.woodstox:stax2-api:4.0.0 can be loaded, and org.codehaus.woodstox:stax2-api:3.1.4 will be shadowed.
However, one method defined in shadowed version org.codehaus.woodstox:stax2-api:3.1.4 is referenced by client project via com.fasterxml.woodstox:woodstox-core:5.0.1, but missing in the actually loaded version org.codehaus.woodstox:stax2-api:4.0.0.
For instance, the following missing method(defined in org.codehaus.woodstox:stax2-api:3.1.4) is actually referenced by Net2Plan\Net2Plan-Core, which will introduce a runtime error(i.e., "NoSuchMethodErrors") into Net2Plan\Net2Plan-Core.
Missing method: org.codehaus.stax2.ri.EmptyIterator: org.codehaus.stax2.ri.EmptyIterator getInstance() is invoked by Net2Plan\Net2Plan-Core via the following path:
Upgrade dependency com.fasterxml.woodstox:woodstox-core from 5.0.1 to 5.0.2. Because the newer version com.fasterxml.woodstox:woodstox-core:5.0.2 does not invoke the above missing method, such upgrading can solve the problem.
Change dependency org.codehaus.woodstox:stax2-api from 4.0.0 to 3.1.4. As such the above missing method will not be referenced by Net2Plan\Net2Plan-Core .
Please let me know which solution do you prefer? I can submit a PR to fix it.
Thank you very much for your attention.
Best regards,
Issue description
Hi, there are multiple versions of org.codehaus.woodstox:stax2-api in Net2Plan\Net2Plan-Core. As shown in the following dependency tree, according to Maven's “nearest wins” strategy, only org.codehaus.woodstox:stax2-api:4.0.0 can be loaded, and org.codehaus.woodstox:stax2-api:3.1.4 will be shadowed.
However, one method defined in shadowed version org.codehaus.woodstox:stax2-api:3.1.4 is referenced by client project via com.fasterxml.woodstox:woodstox-core:5.0.1, but missing in the actually loaded version org.codehaus.woodstox:stax2-api:4.0.0.
For instance, the following missing method(defined in org.codehaus.woodstox:stax2-api:3.1.4) is actually referenced by Net2Plan\Net2Plan-Core, which will introduce a runtime error(i.e., "NoSuchMethodErrors") into Net2Plan\Net2Plan-Core. Missing method: org.codehaus.stax2.ri.EmptyIterator: org.codehaus.stax2.ri.EmptyIterator getInstance() is invoked by Net2Plan\Net2Plan-Core via the following path:
Suggested fixing solutions
Please let me know which solution do you prefer? I can submit a PR to fix it.
Thank you very much for your attention. Best regards,
Dependency tree----