Problems with JARs

1

I'm running a Spring application that uses Maven. All dependencies are in the pom.xml file or the JARs are in my% repository% local. Every time I try to run the application the following messages appear:

The Class-Path manifest attribute in 
C:\Users\mamorim\.m2\repository\com\sun\xml\bind\jaxb-impl.2.3\jaxb-impl-
2.2.3.jar referenced one or more files that do not exist: 
C:\Users\mamorim\.m2\repository\com\sun\xml\bind\jaxb-impl.2.3\jaxb-
api.jar,C:\Users\mamorim\.m2\repository\com\sun\xml\bind\jaxb-
impl.2.3\jaxb1-impl.jar
The Class-Path manifest attribute in 
C:\Users\mamorim\.m2\repository\xalan\xalan.7.2\xalan-2.7.2.jar referenced 
one or more files that do not exist: 
C:\Users\mamorim\.m2\repository\xalan\serializer.7.2\xml-apis.jar

As I add the JARs manually, these errors are decreasing, but I have not yet found all the JARs for download. Any additional configuration to the project could solve this?

    
asked by anonymous 23.02.2018 / 15:41

2 answers

0

Within content of MANIFEST.MF of jaxb-impl-2.2.3.jar there is this:

Class-Path: jaxb-api.jar activation.jar jsr173_1.0_api.jar jaxb1-impl.
 jar

If you look at the jaxb-impl-2.2.11 or the jaxb-impl-2.3.0.jar :

Class-Path: jaxb-core.jar

So, I suggest upgrading and changing the jaxb-impl version. Maybe that's enough to solve the xalan problem as well.

If the problem with xalan-2.7.2.jar persists, this is a little more difficult. In MANIFEST.MF of it there is this:

Class-Path: xercesImpl.jar xml-apis.jar serializer.jar

There is no newer version of it.

The solution then is simply to exclude the problematic JAR:

<dependency>
  <groupId>xalan</groupId>
  <artifactId>xalan</artifactId>
  <version>2.7.2</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
    </exclusion>
  </exclusions> 
</dependency>

And if you need xml-apis anyway, never use a 2.0.x version, since 2.0.x versions are older and The newest is 1.4.01 (look at the dates of the JARs), however bizarre and idiotic this may be. This JAR is a major cause of dependency problems , which although they were supposedly fixed in 2013, still cause a lot of problems by allow the wrong versions of these JAR files to appear in your classpath. Use version 1.4.01:

<dependency>
    <groupId>xml-apis</groupId>
    <artifactId>xml-apis</artifactId>
    <version>1.4.01</version>
</dependency>

I also recommend explicitly banishing bad dependencies that might cause you problems, just like in that old answer in SOen (it is outdated / obsolete, but should not be too difficult to update).

    
23.02.2018 / 18:28
0

Remove the .m2 folder, as you use the mavem, drop all dependencies again, checking the force update option. After downloading all dependencies, validate the program, and try to run again. It usually works for min ...

    
23.02.2018 / 19:32