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

netty-transport-native-epoll-*-linux-x86_64.jar is not OSGi bundle #5119

Closed
MilosFabian opened this issue Apr 11, 2016 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@MilosFabian
Copy link

Hello,
basically, reopening #3781
I am working on OpenDaylight project and we would like use netty-transport-native-epoll due to the TCP MD5 signature support. Currently we are using Netty version 4.0.33.Final and bumping to 4.0.36.Final right now.
Unfortunately, netty-transport-native-epoll-*-linux-x86_64.jar is not a bundle and since the OpenDaylight is running in OSGi container (Apache Karaf) we are not able use it directly as a bundle (like other Netty artifacts).
It would be great for us if the jar is packed as a bundle as well.

Thanks,
Milos Fabian

@normanmaurer
Copy link
Member

@MilosFabian we love PRs.. so maybe you can provide one as I don't have any good OSGI knowledge :(

@MilosFabian
Copy link
Author

Alright, I will work on it :)

@normanmaurer
Copy link
Member

Thanks ❤️!

Am 12.04.2016 um 09:33 schrieb MilosFabian notifications@github.com:

Alright, I will work on it :)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@MilosFabian
Copy link
Author

I am sorry for a delay...finally I found some time take a look at it.
I managed produce bundle (include manifest in jar) for netty-transport-native-epoll-*-linux-x86_64
However, when I was trying to use the bundle in OSGi (Apache Karaf) I hit a problem when loading native library.
The Epoll.isAvailable() returns false with following unavailability cause.

java.lang.ClassNotFoundException: io.netty.channel.epoll.NativeStaticallyReferencedJniMethods
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_45]
at java.lang.ClassLoader$NativeLibrary.load(Native Method)[:1.8.0_45]
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)[:1.8.0_45]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)[:1.8.0_45]
at java.lang.Runtime.load0(Runtime.java:809)[:1.8.0_45]
at java.lang.System.load(System.java:1086)[:1.8.0_45]
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:214)
at io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:261)
at io.netty.channel.epoll.Native.(Native.java:62)
at io.netty.channel.epoll.Epoll.(Epoll.java:33)

More investigation needed.

MilosFabian pushed a commit to MilosFabian/netty that referenced this issue May 29, 2016
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to to attach manifest to jar with native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing netty#5119
MilosFabian pushed a commit to MilosFabian/netty that referenced this issue May 30, 2016
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to attach manifest to the jar with a native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing netty#5119
normanmaurer pushed a commit that referenced this issue May 30, 2016
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to attach manifest to the jar with a native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing #5119
normanmaurer pushed a commit that referenced this issue May 30, 2016
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to attach manifest to the jar with a native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing #5119
@normanmaurer
Copy link
Member

Fixed by #5326

@normanmaurer normanmaurer self-assigned this May 30, 2016
@normanmaurer normanmaurer added this to the 4.0.37.Final milestone May 30, 2016
JeremiahDJordan pushed a commit to riptano/netty that referenced this issue Jul 1, 2016
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to attach manifest to the jar with a native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing netty#5119
onlab-gerrit pushed a commit to opennetworkinglab/onos that referenced this issue Aug 16, 2016
- After updating Netty 4.0 version,
  we sometimes see java.lang.NoClassDefFoundError: io/netty/util/internal/TypeParameterMatcher
  with backtrace insisting there's some dynamic class resolution inside Netty.

  It might be side-effect of recent native-epoll support inside karaf?
   netty/netty#5119

- Add DynamicImport-Package for io.netty to allow deferred wiring
  http://felix.apache.org/documentation/tutorials-examples-and-presentations/apache-felix-osgi-faq.html#how-to-provide-optional-services
- Add a way to pass DynamicImport-Package on BUCK build

Change-Id: I50ec3400e940c56fb52563d84659ebb30c302235
pulllock pushed a commit to pulllock/netty that referenced this issue Oct 19, 2023
Motivation:

Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle
and thus not working in OSGi environment.

Modifications:

In netty-transport-native-epoll's pom.xml added configuration
to attach manifest to the jar with a native library.
In netty-common's pom.xml added configuration instruction (DynamicImport-Package)
to maven bnd plugin to make sure the native code is loaded from
netty-transport-native-epoll bundle.

Result:

The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached)
and the inluced native library can be successfuly loaded in OSGi environment.
Fixing netty#5119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants