liupc opened a new pull request #10269: [FLINK-14876]Putting xercesImpl related 
classes into alwaysParentFirstLoaderPatterns to avoid conflicts
URL: https://github.com/apache/flink/pull/10269
 
 
   
   ## What is the purpose of the change
   
   There is a issue when running jobs when including flink-shaded-hadoop-2 
package while changing the `hadoop.version` to our cluster hadoop version(2.6), 
more details see https://issues.apache.org/jira/browse/FLINK-14876 
   
   ```
   javax.xml.parsers.FactoryConfigurationError: Provider for class 
javax.xml.parsers.DocumentBuilderFactory cannot be 
createdjavax.xml.parsers.FactoryConfigurationError: Provider for class 
javax.xml.parsers.DocumentBuilderFactory cannot be created at 
javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:311) at 
javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267) at 
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:120)
 at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2412) 
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2375) 
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2285) at 
org.apache.hadoop.conf.Configuration.get(Configuration.java:892) at 
org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:2010) at 
org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:449) at 
org.apache.hadoop.mapreduce.Job.getInstance(Job.java:186) at 
org.apache.hadoop.mapreduce.Job.getInstance(Job.java:167) at 
org.apache.flink.hadoopcompatibility.scala.HadoopInputs$.readHadoopFile(HadoopInputs.scala:127)
 at 
com.github.ehiggs.spark.terasort.FlinkTeraSort$.main(FlinkTeraSort.scala:76) at 
com.github.ehiggs.spark.terasort.FlinkTeraSort.main(FlinkTeraSort.scala) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:586)
 at 
org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:448)
 at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:274) 
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:746) 
at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:273) at 
org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:205) at 
org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1009) 
at 
org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1082) 
at java.security.AccessController.doPrivileged(Native Method) at 
javax.security.auth.Subject.doAs(Subject.java:422) at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1886)
 at 
org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
 at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1082)Caused 
by: java.lang.RuntimeException: Provider for class 
javax.xml.parsers.DocumentBuilderFactory cannot be created at 
javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:308) ... 
30 moreCaused by: java.util.ServiceConfigurationError: 
javax.xml.parsers.DocumentBuilderFactory: Provider 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not a subtype at 
java.util.ServiceLoader.fail(ServiceLoader.java:239) at 
java.util.ServiceLoader.access$300(ServiceLoader.java:185) at 
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376) at 
java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at 
java.util.ServiceLoader$1.next(ServiceLoader.java:480) at 
javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:294) at 
java.security.AccessController.doPrivileged(Native Method) at 
javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289) ... 
30 more
   ```
   This PR is to fix this problem by adding xercesImpl related classes into 
alwaysParentFirstLoaderPatterns.
   
   
   ## Brief change log
   
     - Add xercesImpl related classes into alwaysParentFirstLoaderPatterns.
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - Manually verified the change by running app in yarn-cluster mode
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to