You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jack Orenstein <ja...@akiban.com> on 2010/05/24 22:35:55 UTC

Zookeeper, Maven and dependencies on javax jar files

I'm working on a project in the maven framework and have added a dependency on zookeeper. When I try to install:

     mvn clean install -Dmaven.test.skip=true
     ...
     [INFO] Compilation failure

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

The named jar files contain some HTML (!), e.g.

     <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
     <html><head>
     <title>301 Moved Permanently</title>
     </head><body>
     <h1>Moved Permanently</h1>
     <p>The document has moved <a href="http://download.java.net/maven/1/javax.jms/jars/jms-1.1.jar">here</a>.</p>
     <hr>
     <address>Apache Server at maven-repository.dev.java.net Port 443</address>
     </body></html>

Has anyone succeeded in following this advice and getting it to work?

I found this maven page: http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html, but just getting the jar files from Oracle is a pain.

Any advice on how to get zookeeper and maven to coexist would be welcome. Thanks.

Jack

Re: Zookeeper, Maven and dependencies on javax jar files

Posted by Ted Dunning <te...@gmail.com>.
The only one that I think is important is the jmx which enables monitoring
of the servers.

On Mon, May 24, 2010 at 2:51 PM, Jack Orenstein <ja...@akiban.com> wrote:

> This at least gets me through the build/install phase. My usage of
> zookeeper is pretty minimal right now -- just one a single node. What
> features of zookeeper depend on the excluded jar files?
>
> Thanks very much for your quick response.
>

Re: Zookeeper, Maven and dependencies on javax jar files

Posted by Ted Dunning <te...@gmail.com>.
Same version I use.

On Mon, May 24, 2010 at 2:51 PM, Jack Orenstein <ja...@akiban.com> wrote:

> Ted Dunning wrote:
>
>> Which version of maven do you have?
>>
>
> 2.2.1.

Re: Zookeeper, Maven and dependencies on javax jar files

Posted by Jack Orenstein <ja...@akiban.com>.
Ted Dunning wrote:
> Which version of maven do you have?

2.2.1.

> 
> I have heard some versions don't follow redirects well.  You can try
> deleting these defective files in your local repository under .m2 and try
> again.  You may need to try with a newer maven to get things right.

I tried deleting them manually before trying various other repositories, (including the one mentioned in the "jar" file).

> 
> Another option is to explicitly remove those dependencies since they are
> optional anyway.  This sort of trick is commonly necessary with log4j.  Try
> something like this (suitably adjusted, of course):
> 
>        <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>             <version>1.2.15</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>com.sun.jmx</groupId>
>                     <artifactId>jmxri</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>com.sun.jdmk</groupId>
>                     <artifactId>jmxtools</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.jms</groupId>
>                     <artifactId>jms</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.mail</groupId>
>                     <artifactId>mail</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>

This at least gets me through the build/install phase. My usage of zookeeper is pretty minimal right now -- just one a single node. What features of zookeeper depend on the excluded jar files?

Thanks very much for your quick response.

Jack


> 
> 
> 
> 
> See here for possible related issue:
> http://jira.codehaus.org/browse/MREPOSITORY-20?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
> 
> On Mon, May 24, 2010 at 1:35 PM, Jack Orenstein <ja...@akiban.com> wrote:
> 
>> I'm working on a project in the maven framework and have added a dependency
>> on zookeeper. When I try to install:
>>
>>    mvn clean install -Dmaven.test.skip=true
>>    ...
>>    [INFO] Compilation failure
>>
>>    error: error reading
>> /home/jao/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar; error in opening zip
>> file
>>    error: error reading
>> /home/jao/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar;
>> error in opening zip file
>>    error: error reading
>> /home/jao/.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar; error in
>> opening zip file
>>
>> The named jar files contain some HTML (!), e.g.
>>
>>    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>    <html><head>
>>    <title>301 Moved Permanently</title>
>>    </head><body>
>>    <h1>Moved Permanently</h1>
>>    <p>The document has moved <a href="
>> http://download.java.net/maven/1/javax.jms/jars/jms-1.1.jar">here</a>.</p>
>>    <hr>
>>    <address>Apache Server at maven-repository.dev.java.net Port
>> 443</address>
>>    </body></html>
>>
>> Has anyone succeeded in following this advice and getting it to work?
>>
>> I found this maven page:
>> http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html, but
>> just getting the jar files from Oracle is a pain.
>>
>> Any advice on how to get zookeeper and maven to coexist would be welcome.
>> Thanks.
>>
>> Jack
>>

Re: Zookeeper, Maven and dependencies on javax jar files

Posted by Ted Dunning <te...@gmail.com>.
Which version of maven do you have?

I have heard some versions don't follow redirects well.  You can try
deleting these defective files in your local repository under .m2 and try
again.  You may need to try with a newer maven to get things right.

Another option is to explicitly remove those dependencies since they are
optional anyway.  This sort of trick is commonly necessary with log4j.  Try
something like this (suitably adjusted, of course):

       <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
            </exclusions>
        </dependency>




See here for possible related issue:
http://jira.codehaus.org/browse/MREPOSITORY-20?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab

On Mon, May 24, 2010 at 1:35 PM, Jack Orenstein <ja...@akiban.com> wrote:

> I'm working on a project in the maven framework and have added a dependency
> on zookeeper. When I try to install:
>
>    mvn clean install -Dmaven.test.skip=true
>    ...
>    [INFO] Compilation failure
>
>    error: error reading
> /home/jao/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar; error in opening zip
> file
>    error: error reading
> /home/jao/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar;
> error in opening zip file
>    error: error reading
> /home/jao/.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar; error in
> opening zip file
>
> The named jar files contain some HTML (!), e.g.
>
>    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>    <html><head>
>    <title>301 Moved Permanently</title>
>    </head><body>
>    <h1>Moved Permanently</h1>
>    <p>The document has moved <a href="
> http://download.java.net/maven/1/javax.jms/jars/jms-1.1.jar">here</a>.</p>
>    <hr>
>    <address>Apache Server at maven-repository.dev.java.net Port
> 443</address>
>    </body></html>
>
> Has anyone succeeded in following this advice and getting it to work?
>
> I found this maven page:
> http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html, but
> just getting the jar files from Oracle is a pain.
>
> Any advice on how to get zookeeper and maven to coexist would be welcome.
> Thanks.
>
> Jack
>