Repository: netty/netty
Issue: Use correct name alias for processor in OSGi Bundle Manifests

https://github.com/netty/netty/blob/f43a9dd0a384eb6226e31648b7168e4fa241527d/transport-native-epoll/pom.xml#L342

**processor** directive value should be "AArch64", not "aarch_64" according to: 
http://docs.osgi.org/reference/osnames.html

See also:
https://github.com/netty/netty-tcnative/pull/547

Otherwise you get this error: 

```
[2022-06-10 09:50:41,357] ERROR {Framework} - FrameworkEvent ERROR org.osgi.framework.BundleException: Could not resolve module: io.netty.tcnative-boringssl-static [73]
  Unresolved requirement: Require-Capability: osgi.native; native.paths.0:List<String>="META-INF/native/libnetty_tcnative_osx_x86_64.jnilib"; native.paths.2:List<String>="META-INF/native/libnetty_tcnative_linux_x86_64.so"; native.paths.1:List<String>="META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib"; native.paths.4:List<String>="META-INF/native/netty_tcnative_windows_x86_64.dll"; native.paths.3:List<String>="META-INF/native/libnetty_tcnative_linux_aarch_64.so"; filter:="(|(&(|(osgi.native.osname~=macos)(osgi.native.osname~=macosx))(osgi.native.processor~=x86_64))(&(|(osgi.native.osname~=macos)(osgi.native.osname~=macosx))(osgi.native.processor~=aarch_64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x86_64))(&(osgi.native.osname~=linux)(osgi.native.processor~=aarch_64))(&(osgi.native.osname~=win32)(osgi.native.processor~=x86_64)))"

 at org.eclipse.osgi.container.Module.start(Module.java:457)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
 at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
 at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
 at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
 at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
 ```
when running on a container based on the public.ecr.aws/docker/library/openjdk:11-jdk-slim base image for ARM64 architecture.


Issue comments:
@gspadotto Are you able to make a build with this and give it a try on your system? https://github.com/netty/netty/pull/12498
> @gspadotto Are you able to make a build with this and give it a try on your system? #12498

Hi @chrisvest  
I'll give it a try even though it's a bit complex for me. 
I'll explain what the set-up is to reproduce the issue and then I'll ask you some guidance on the "correct" way for me to test your patch. 

I have an instance of [this](https://github.com/wso2/micro-integrator/releases/tag/v4.1.0), running inside a [Docker container](https://github.com/wso2/docker-ei/blob/4.1.x/dockerfiles/alpine/micro-integrator/Dockerfile), where [this row](https://github.com/wso2/docker-ei/blob/4.1.x/dockerfiles/alpine/micro-integrator/Dockerfile#L20) has been changed to "FROM arm64v8/openjdk:11-jdk-slim".

These are the runtime dependencies that refer to Netty: 

```
wso2/components/plugins/io.netty.buffer_4.1.73.Final.jar
wso2/components/plugins/io.netty.codec-http2_4.1.73.Final.jar
wso2/components/plugins/io.netty.codec-http_4.1.73.Final.jar
wso2/components/plugins/io.netty.codec-socks_4.1.73.Final.jar
wso2/components/plugins/io.netty.codec_4.1.73.Final.jar
wso2/components/plugins/io.netty.common_4.1.73.Final.jar
wso2/components/plugins/io.netty.handler-proxy_4.1.73.Final.jar
wso2/components/plugins/io.netty.handler_4.1.73.Final.jar
wso2/components/plugins/io.netty.resolver_4.1.73.Final.jar
wso2/components/plugins/io.netty.tcnative-boringssl-static_2.0.47.Final.jar
wso2/components/plugins/io.netty.tcnative-classes_2.0.47.Final.jar
wso2/components/plugins/io.netty.tcnative_2.0.47.Final.jar
wso2/components/plugins/io.netty.transport_4.1.73.Final.jar
```

My plan for testing is to overwrite only the io.netty.tcnative* jars with the patched ones and see if the OSGi bundles are activated without issues. 

My questions for you are: 
1) Do you think it's ok to "mix & match" different versions of netty dependencies?
2) Which components am I supposed to build and embed/overwrite?
3) Can I build netty components for an architecture (arm64) that is different than the one the host that builds the code is running (i.e. "cross-compiling")?

As a side note, simply editing the manifest file inside the io.netty.tcnative-boringssl-static_2.0.47.Final.jar to read **processor=aarch64** rather than **processor=aarch_64** already fixes the issue: I don't know if this can be considered as a "successful test" or not. 

Please let me know.


Pull request review comments:

Patch that resolved the issue:
diff --git a/resolver-dns-native-macos/pom.xml b/resolver-dns-native-macos/pom.xml
index 40452e4afba..9c27e028344 100644
--- a/resolver-dns-native-macos/pom.xml
+++ b/resolver-dns-native-macos/pom.xml
@@ -214,7 +214,7 @@
                       <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                     </manifest>
                     <manifestEntries>
-                      <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_aarch_64.jnilib; osname=MacOSX; processor=aarch_64</Bundle-NativeCode>
+                      <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_aarch_64.jnilib; osname=MacOSX; processor=aarch64</Bundle-NativeCode>
                       <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
                       <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                     </manifestEntries>
diff --git a/transport-native-epoll/pom.xml b/transport-native-epoll/pom.xml
index 1d3404aae7c..08fe2511130 100644
--- a/transport-native-epoll/pom.xml
+++ b/transport-native-epoll/pom.xml
@@ -339,7 +339,7 @@
                       <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                     </manifest>
                     <manifestEntries>
-                      <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_aarch_64.so; osname=Linux; processor=aarch_64,*</Bundle-NativeCode>
+                      <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_aarch_64.so; osname=Linux; processor=aarch64,*</Bundle-NativeCode>
                       <Fragment-Host>io.netty.transport-classes-epoll</Fragment-Host>
                       <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                     </manifestEntries>
diff --git a/transport-native-kqueue/pom.xml b/transport-native-kqueue/pom.xml
index ae16c5d4ad8..0deb193e273 100644
--- a/transport-native-kqueue/pom.xml
+++ b/transport-native-kqueue/pom.xml
@@ -217,7 +217,7 @@
                       <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                     </manifest>
                     <manifestEntries>
-                      <Bundle-NativeCode>META-INF/native/libnetty_transport_native_kqueue_aarch_64.jnilib; osname=MacOSX; processor=aarch_64</Bundle-NativeCode>
+                      <Bundle-NativeCode>META-INF/native/libnetty_transport_native_kqueue_aarch_64.jnilib; osname=MacOSX; processor=aarch64</Bundle-NativeCode>
                       <Fragment-Host>io.netty.transport-classes-kqueue</Fragment-Host>
                       <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                     </manifestEntries>


Test patch: