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

Problem: netty-all doesn't work in OSGi environment #286

Merged
merged 1 commit into from Nov 15, 2016

Conversation

yrashk
Copy link
Contributor

@yrashk yrashk commented Oct 10, 2016

In pgjdbc-ng, Import-Package is defined as:

io.netty.*;version="[4.0,4.1)",

However, netty-all's MANIFEST.MF does not contain any OSGi
information:

Manifest-Version: 1.0
Implementation-Vendor: The Netty Project
Implementation-Title: Netty/All-in-One
Implementation-Version: 4.0.40.Final
Implementation-Vendor-Id: io.netty
Built-By: norman
Build-Jdk: 1.7.0_85
Created-By: Apache Maven 3.3.3
Implementation-URL: http://netty.io/netty-all/

When installed, it exports packages without version information:

eid@eid> install -s wrap:mvn:io.netty/netty-all/4.0.40.Final
Bundle ID: 61
eid@eid> headers 61

wrap_mvn_io.netty_netty-all_4.0.40.Final (61)
...
Export-Package =
    io.netty.bootstrap;uses:="io.netty.channel,io.netty.util",
...

And therefore fails pgjdbc-ng's requirement:

Unsatisfied Requirements:
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.bootstrap)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.buffer)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.nio)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.socket)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.socket.nio)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.handler.codec)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.handler.ssl)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.util)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.util.concurrent)(version>=4.0.0)(!(version>=4.1.0)))

Solution: use individual netty-* components

Unlike netty-all, they do have OSGi-compatible manifests that expose package
version information.

This way, manual addition of these dependencies will not be required when Karaf
features or equivalent packages are built off the list of Maven
dependencies.

@jesperpedersen
Copy link
Contributor

Please, update your PR to use a property such that we only need to set the version identifier in one place.

Then rebase, and squash.

Thanks in advance !

In pgjdbc-ng, Import-Package is defined as:

```
io.netty.*;version="[4.0,4.1)",
```

However, netty-all's MANIFEST.MF does not contain any OSGi
information:

```
Manifest-Version: 1.0
Implementation-Vendor: The Netty Project
Implementation-Title: Netty/All-in-One
Implementation-Version: 4.0.40.Final
Implementation-Vendor-Id: io.netty
Built-By: norman
Build-Jdk: 1.7.0_85
Created-By: Apache Maven 3.3.3
Implementation-URL: http://netty.io/netty-all/
```

When installed, it exports packages without version information:

```
eid@eid> install -s wrap:mvn:io.netty/netty-all/4.0.40.Final
Bundle ID: 61
eid@eid> headers 61

wrap_mvn_io.netty_netty-all_4.0.40.Final (61)
...
Export-Package =
	io.netty.bootstrap;uses:="io.netty.channel,io.netty.util",
...
```

And therefore fails pgjdbc-ng's requirement:

```
Unsatisfied Requirements:
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.bootstrap)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.buffer)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.nio)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.socket)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.channel.socket.nio)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.handler.codec)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.handler.ssl)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.util)(version>=4.0.0)(!(version>=4.1.0)))
[pgjdbc-ng [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=io.netty.util.concurrent)(version>=4.0.0)(!(version>=4.1.0)))
```

Solution: use individual netty-* components

Unlike netty-all, they do have OSGi-compatible manifests that expose package
version information.

This way, manual addition of these dependencies will not be required when Karaf
features or equivalent packages are built off the list of Maven
dependencies.
@yrashk
Copy link
Contributor Author

yrashk commented Nov 15, 2016

@jesperpedersen updated

@jesperpedersen jesperpedersen merged commit 7d595ca into impossibl:develop Nov 15, 2016
@jesperpedersen
Copy link
Contributor

Merged.

Thanks for your contribution !

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

Successfully merging this pull request may close these issues.

None yet

2 participants