Problems with Jars

Asked

Viewed 470 times

1

I have a Spring application that uses Maven. All the dependencies are in the file pom.xml or the Jars are in my repository .m2 local. Every time I try to run the application the following messages appear:

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

As I add the Jars manually these errors will decrease but I have not found all the Jars to download yet. Some additional configuration to the project could solve this?

  • 1

    Are you using any Maven plugin for packaging? Put your pom.xml here.

  • I’m trying to write an answer, but it started to get complicated the part about solving Xalan. I could post your pom.xml? Or else, at least say what dependency you use Xalan?

  • Removes the . m2 folder, as Voce uses mavem, downloads all dependencies again, checking the force update option. After downloading all dependencies, validate the program, and try to run again. Usually it works for min...

1 answer

1


Within the content of MANIFEST.MF of jaxb-impl-2.2.3.jar there’s that:

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 that of jaxb-impl-2.3.0.jar:

Class-Path: jaxb-core.jar

So I suggest you upgrade and change the version of jaxb-impl. Maybe that’s enough to solve Xalan’s problem as well.

If the problem of xalan-2.7.2.jar persist, this is a little more difficult. In MANIFEST.MF of him there is that:

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

There is no latest version of it.

The solution then is to simply delete 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 the xml-apis even so, never use a version 2.0.x, as versions 2.0.x are older and the youngest is 1.4.01 (look at the Jars' dates), as bizarre and idiotic as that may be. This JAR is a major cause of dependency problems, which although were supposedly fixed in 2013, still cause a lot of problems by allowing 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 you explicitly ban bad dependencies that might cause you problems, just like I did in that old answer in Soen (it is outdated/obsolete, but it shouldn’t be too difficult to update it).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.