Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two versions of Netty listed as dependencies -- deployment errors #404

Closed
TheGeekPharaoh opened this issue Sep 21, 2013 · 6 comments
Closed
Milestone

Comments

@TheGeekPharaoh
Copy link

When using Maven to manage dependencies for Kundera with Cassandra as a datastore, it appears to be pulling down two separate versions of the Netty library. These, consequently, end up imported into an EAR and cause deployment errors on JBoss EAP 6.1. Here's what I see during the Maven build:

...
[INFO] Copying artifact[jar:com.github.stephenc:jamm:0.2.5] to[lib/jamm-0.2.5.jar]
[INFO] Copying artifact[jar:io.netty:netty:3.5.9.Final] to[lib/netty-3.5.9.Final.jar]
[INFO] Copying artifact[jar:org.apache.cassandra:cassandra-clientutil:1.2.4] to[lib/cassandra-clientutil-1.2.4.jar]
[INFO] Copying artifact[jar:org.jboss.netty:netty:3.2.8.Final] to[lib/netty-3.2.8.Final.jar]
[INFO] Copying artifact[jar:org.slf4j:slf4j-api:1.7.2] to[lib/slf4j-api-1.7.2.jar]
...

And the subsequent error during deployment:

Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.pojo."org.jboss.netty.internal.LoggerConfigurator".DESCRIBED is already registered

@kkmishra
Copy link
Contributor

Hi,
Do one thing, exclude netty jar from kundera-cassandra, and then try, let
me know if it works for you.

    <dependency>
        <groupId>com.impetus.client</groupId>
        <artifactId>kundera-cassandra</artifactId>
        <version>${kundera.version}</version>
                    <exclusions>
            <exclusion>
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

you can refer following pom.xml for dependency exclusion:

https://github.com/impetus-opensource/Kundera/blob/kundera-structure/container/jboss/data-keeper/pom.xml

Thanks
KK

On Sun, Sep 22, 2013 at 1:54 AM, sdnakhla notifications@github.com wrote:

When using Maven to manage dependencies for Kundera with Cassandra as a
datastore, it appears to be pulling down two separate versions of the Netty
library. These, consequently, end up imported into an EAR and cause
deployment errors on JBoss EAP 6.1. Here's what I see during the Maven
build:

...
[INFO] Copying artifact[jar:com.github.stephenc:jamm:0.2.5]
to[lib/jamm-0.2.5.jar]
[INFO] Copying artifact[jar:io.netty:netty:3.5.9.Final]
to[lib/netty-3.5.9.Final.jar]
[INFO] Copying
artifact[jar:org.apache.cassandra:cassandra-clientutil:1.2.4]
to[lib/cassandra-clientutil-1.2.4.jar]
[INFO] Copying artifact[jar:org.jboss.netty:netty:3.2.8.Final]
to[lib/netty-3.2.8.Final.jar]
[INFO] Copying artifact[jar:org.slf4j:slf4j-api:1.7.2]
to[lib/slf4j-api-1.7.2.jar]
...

And the subsequent error during deployment:

Caused by: org.jboss.msc.service.DuplicateServiceException: Service
jboss.pojo."org.jboss.netty.internal.LoggerConfigurator".DESCRIBED is
already registered


Reply to this email directly or view it on GitHubhttps://github.com//issues/404
.

Thanks and Regards
Kuldeep Kumar Mishra
+919540965199

@TheGeekPharaoh
Copy link
Author

Yes, if I manually exclude the Netty libraries it deploys fine. However, this is a less-than-ideal situation.

@mevivs
Copy link
Collaborator

mevivs commented Sep 23, 2013

No need to manually exclude jars,
As @kkmishra mentioned, If you exclude

<dependency>
            <groupId>com.impetus.client</groupId>
            <artifactId>kundera-cassandra</artifactId>
            <version>${kundera.version}</version>
                        <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

from pom.xml. It should work for you.

-Vivek

@pires
Copy link
Contributor

pires commented Sep 25, 2013

I agree with @sdnakhla. Working with exclusions is not the ideal solution! When using a library, I expect it to hide details such as circular or repeated dependencies.

In this particular case, who's importing different versions of Netty.IO? Different Kundera modules or some dependencies of Kundera modules?

@mevivs
Copy link
Collaborator

mevivs commented Sep 25, 2013

This version of netty is bought in by apache Cassandra jar. I assume it might be used for running daemon threads?

@pires
Copy link
Contributor

pires commented Sep 25, 2013

The thing is with JBoss that already includes Netty.IO, right @sdnakhla? If it is, then kundera-cassandra should stay as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants