views:

675

answers:

2

Hello everyone I have error which breaks up my build for no reason, here is the error message :

error: error reading
/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar;
error in opening zip file error: error
reading
/.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar;
error in opening zip file

I'm using this dependency :

<dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.15</version>
  <scope>provided</scope>
</dependency>

How can I fix this ?

+7  A: 

You most likely don't need jmxtools or jmxri, so you can probably exclude them from your dependencies:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.15</version>
    <scope>provided</scope>
    <exclusions>
        <exclusion>
          <groupId>com.sun.jdmk</groupId>
          <artifactId>jmxtools</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jmx</groupId>
          <artifactId>jmxri</artifactId>
        </exclusion>
    </exclusions>
</dependency>
Martin
(+1) add an exclucion for jmxri as well.
Bozho
As Pascal said add exclusions for Java Mail and JMS too. Scope provided? Sometimes is better use own logging library (as Pascal said too) over from provided environment one.
cetnar
+3  A: 

Seriously, these dependencies on JMX, JMS, Java Mail are ridiculous and having to deal with exclusions to do some logging makes me speechless. So, I'd rather use the previous version of log4j (1.2.14) or just switch to logback.

Pascal Thivent