简体   繁体   English

JBoss 7.1.1 和 JBoss Web Native

[英]JBoss 7.1.1 and JBoss Web Native

I'm trying to enable the JBoss Web Native libraries in JBoss 7.1.1.我正在尝试在 JBoss 7.1.1 中启用JBoss Web Native 库 I have read this question and the answers and have tried the following steps to enable the native libraries in JBoss, but it didn't work so far.我已经阅读了这个问题和答案,并尝试了以下步骤来启用 JBoss 中的本机库,但到目前为止还没有奏效。 I'm on OS X:我在 OS X 上:

  • Downloaded the macosx archive from http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10下载了macosx档案
  • Unzipped it into the JBoss directory, so the contents of the archive are available in bin/native .将其解压缩到 JBoss 目录中,以便存档的内容在bin/native中可用。
  • Updated bin/standalone.conf to include the library path: JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/path/to/jboss-as-7.1.1.Final-native/bin/native:$PATH"更新bin/standalone.conf以包含库路径: JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/path/to/jboss-as-7.1.1.Final-native/bin/native:$PATH"

Starting JBoss, I can still see the following in the log file:启动 JBoss,我仍然可以在日志文件中看到以下内容:

[org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080

instead of the expected Http11AprProtocol .而不是预期的Http11AprProtocol

What am I missing?我错过了什么?

Turns out the above steps are no longer necessary for JBoss 7.1.1, as the native libraries are now bundled under modules/org/jboss/as/web/main/lib .事实证明,JBoss 7.1.1 不再需要上述步骤,因为本机库现在捆绑在modules/org/jboss/as/web/main/lib

To enable their usage, I had to set the native attribute to true in the web subsystem in standalone.xml .为了启用它们,我必须在standalone.xmlweb子系统中将native属性设置为true For some reason it was set to false in the default configuration:出于某种原因,它在默认配置中设置为false

<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>

JBOSS EAP 6.0 JBOSS EAP 6.0

Check if you have modules/org/jboss/as/web/main/lib in JBOSS_HOME.检查 JBOSS_HOME 中是否有 modules/org/jboss/as/web/main/lib。 If not as it is in my version of JBoss EAP 6.0.如果不是我的 JBoss EAP 6.0 版本。

first: yum install tomcat-native.x86_64第一: yum install tomcat-native.x86_64

Now your system has got tomcat native library under /usr/lib64 that is generally in the java.library.path then set native=true in subsystem web as nwinkler's suggested:现在您的系统在 /usr/lib64 下有 tomcat 本机库,通常在 java.library.path 中,然后按照 nwinkler 的建议在子系统 web 中设置 native=true:

<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>

and now restart JBOSS.现在重新启动 JBOSS。

Without tomcat native libraries installed you have in log:如果未安装 tomcat 本机库,您将在日志中看到:

10:12:31,700 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_37/jre/lib/amd64/server:/usr/java/jdk1.6.0_37/jre/lib/amd64:/usr/java/jdk1.6.0_37/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
10:12:32,203 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http-/127.0.0.1:8080

With tomcat native libraries installed your log writes:安装了 tomcat 本机库后,您的日志会写入:

10:22:56,147 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-5) Starting Coyote HTTP/1.1 on http-/127.0.0.1:8080

ALTERNATIVE选择

1) Download native library from JBoss web sites: 1) 从 JBoss 网站下载原生库:

wget http://downloads.jboss.org/jbossnative/2.0.10.GA/jboss-native-2.0.10-linux2-x64-ssl.tar.gz

2) untar 2)解压

tar xvzf jboss-native-2.0.10-linux2-x64-ssl.tar.gz

3) Create a folder for your native-libraries: 3)为您的本地库创建一个文件夹:

 mkdir -p tomcat-native

4) Move bin/native in your new folder 4) 在新文件夹中移动 bin/native

 mv bin/native tomcat-native

5) Make your folder visible by java. 5)让你的文件夹被java可见。 Add this in standalone.conf or domain.conf在 standalone.conf 或 domain.conf 添加这个

 JAVA_OPTS="$JAVA_OPTS -Djava.library.path=[the tomcat-native's folder path]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM