-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception since release 3.1.0: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
#322
Comments
I'm having a very similar problem. Same thing happened, worked on 3.0.0 and stopped working on 3.1.0 I created a test project to see if I could find the bug and it seems it happens when adding a dependency which has a lot of (very old) transitive dependencies
UPDATE: I managed to replicate the bug with the attached files and running I can seem to make it work running mvn exec:exec instead as a workaround |
@rmannibucau could this be related to class loading? @cbismuth did you upgrade your java version recently? Saw the same issue after I updated from Java 8 to 11. Could you try to use an updated xerces library as a exec-mvn-plugin dependency? |
Still with Java 8 and silent upgrade as we did not specify plugin version at first. |
Can be worth checking https://github.com/mojohaus/exec-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/exec/URLClassLoaderBuilder.java#L519, in particular if on windows (case). |
Looked quickly the sample, the issue is |
We've seen this exception with 3.1.0; that worked with 3.0.0 as we did not pin the version too. We're on Java8 with this, otherwise no changes.
|
@marcellanz was likely a bug it worked in 3.0.0 since your dependency (xml-apis) was not taken into account, now it is fixed it highlights it misses an impl. The fat it works with |
I'm also seeing a similar issue after upgrading from version 3.0.0 to version 3.1.0 when starting my app:
|
@rmannibucau interesting, thanks. |
@marcellanz @msglifeIberia can we close this issue? Could not reproduce using your zip:
Same with 3.1.0:
|
@bmarwell I still face a similar issue. Here are the logs when I run the
Not sure if this helps but here are the contents of the
|
Did you try cleaning the dependencies? I recall spring leaks some undesired xml libraries easily so can be the very same issue. |
No I have not. I can try doing that but I would prefer not to as in 3.0.0 it works with the same dependencies |
@msglifeIberia it was a bug of 3.0.0 as explained earlier, tolerating wrong classpath and leaking too much libs. 3.1.0 fixed it showing it on your stack. If keeping the classpath issue is desired, exec.exec is a better choice since thz fork enables to keep conflicts as before silently. |
Ok then I will try to fix my dependencies |
fine with me. |
Encountered the issue today.
Excluding Just in case small reproducer: pom.xml<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>exec-test</artifactId>
<groupId>com.test</groupId>
<version>0.1</version>
<name>exec-test</name>
<dependencies>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>run</id>
<phase>install</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.test.Test</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project> com.test.Testpackage com.test;
import javax.xml.transform.sax.SAXTransformerFactory;
public class Test {
public static void main(String[] args) {
System.out.println(SAXTransformerFactory.class.getProtectionDomain().getCodeSource() != null ? SAXTransformerFactory.class.getProtectionDomain().getCodeSource().getLocation() : null);
}
} Output with
Output with "equivalent" manual invocation
I would expect both to be |
…assloader more finely
Proposing #337, do you want to give a try with this patch? |
@rmannibucau thanks. Confirmed that #337 fixes my issue. |
…assloader more finely
Is there any mitigation? |
@sonnyhcl most of the time cleaning transitive deps which are actually unexpected, else i guess using a version with the fix |
…r more finely (#337) Co-authored-by: Slawomir Jaranowski <s.jaranowski@gmail.com>
Works with:
org.codehaus.mojo:exec-maven-plugin:3.0.0:java
Does not Work with:
org.codehaus.mojo:exec-maven-plugin:3.1.0:java
No code change on our side.
Thanks a lot,
Christophe
The text was updated successfully, but these errors were encountered: