How to install JBoss Native components in EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
- EAP installed with zip or installer (not RPMs)
Issue
- How to install JBoss Native components in EAP 6 installed on RHEL6
- How to install and configure Apache Portability Runtime (
APR) in EAP6? - What is the standard and supported way to enable Apache Portable Runtime (
APR) native connector protocol in EAP6? - Cannot download Native components for EAP 6.
- I'm looking for installing native libs (at least Tomcat's) on my JBoss install. The following error is seen :
2015-07-11 18:55:30,149 INFO [org.apache.catalina.core] (MSC service thread 1-95) : JBWEB001065: The native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
What files are needed for JBoss to load ?
Resolution
This article is for JBoss EAP installed through the zip or installer. Installation of native components in an RPM installation differ.
For RPM installations, see JBoss EAP 6.4 Installation Guide - 2.9.2. Install Native Components and Native Utilities (RPM Installation).
Follow the steps below:
-
Download the Native Components:
Download the Application Platform 6 Native Components as per your EAP 6 version, Operating System and Architecture using url This content is not included.Application Platform 6 Native Components.
For example for RHEL6 , You would have downloaded thejboss-eap-native-6.x.x-RHEL6-x86_64.zip -
Install dependencies
The zip native distribution installed on RHEL just uses symlinks to point to theAPRandopenssllibraries needed. Those dependencies must be installed from RHN through yum:yum install apr openssl -
Install the Native Components
Unzip the Native Components file. You would see the directoryjboss-eap-6.x.xnow. Open a terminal and traverse tilljboss-eap-6.x.xand run the below command on the terminal:cp -r $MODULE_PATH$/org/jboss/as/web/main/lib /$EAP_HOME$/$MODULE_PATH$/org/jboss/as/web/mainThe above step place the native components of web in the respective directories of JBoss EAP 6 Installation. Default module path
EAP 6.0.x: MODULE_PATH=$JBOSS_HOME/modulesEAP 6.1+: MODULE_PATH=$JBOSS_HOME/modules/system/layers/base
Similarly, copy
HornetQlibAIO(applicable for RHEL).cp -r $MODULE_PATH$/org/hornetq/main/lib /$EAP_HOME$/$MODULE_PATH$/org/hornetq/main -
Enable the native components
Using a CLI command:/subsystem=web:write-attribute(name=native,value=true)OR
Editing configuration file e.g.
standalone.xml/standalone-ha.xml/standalone-full.xml/standalone-full-ha.xmlORdomain.xmlbased on mode running standalone or domain and enable thenative="true"in the "Web" Subsystem as following.<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="true"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem> -
Restart EAP 6
Restart the JBoss EAP 6 server.
Recommendations
- If using
httpswith nativeAPRconnectors, the certs must be in.pemformat per EAP 6 "JBWEB003043: ... No Certificate file specified or invalid file format" when using native libraries..jkscannot be used. - To enable HornetQ libAIO, see How to configure HornetQ to use the native AIO libraries in JBoss EAP 6.
Diagnostic Steps
How to confirm that JBoss EAP is using Apache Portable Runtime ?
First, in logging subsystem enable org.apache.catalina.core category to DEBUG as below:
<logger category="org.apache.catalina.core">
<level name="DEBUG"/>
</logger>
Secondly, restart your JBoss EAP 6 server and check the server.log for below entries.
DEBUG [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) Loaded: apr-1
DEBUG [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) Loaded: ssl
DEBUG [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) Loaded: tcnative-1
DEBUG [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) Loaded Apache Tomcat Native library 1.1.23.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.