2012-04-19 93 views
7

我试图在JBoss 7.1.1中启用JBoss Web Native libraries。我已经阅读了this的问题和答案,并尝试了以下步骤来启用JBoss中的本地库,但目前为止它并没有工作。我在OS X:JBoss 7.1.1和JBoss Web Native

  • 下载MacOSX的存档从http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10
  • 它解压到JBoss的目录,所以存档的内容是bin/native可用。
  • 更新bin/standalone.conf包括库路径:JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/path/to/jboss-as-7.1.1.Final-native/bin/native:$PATH"

开始JBoss的,我仍然可以看到在日志文件中的以下内容:

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

,而不是预期Http11AprProtocol

我错过了什么?

回答

15

原来JBoss 7.1.1不再需要上述步骤,因为原生库现在捆绑在modules/org/jboss/as/web/main/lib之下。

为了使它们的用法,我不得不把本地属性设置为网络子系统standalone.xml。出于某种原因,它被设置为在默认配置:

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

+1到目前为止最符合目标和最正确的解决方案! – Nikhil 2012-06-01 11:29:35

2

JBOSS EAP 6.0

检查,如果你有模块/组织/ JBoss的/因为/网络/主/在JBOSS_HOME LIB 。 如果不是在我的JBoss EAP 6.0版本中。

第一:yum install tomcat-native.x86_64

现在你的系统已经得到了tomcat的本地库在/ usr/lib64下通常是在的java.library.path 然后设置本地=真正的子系统网络作为nwinkler商建议:

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

现在重新启动JBOSS。

没有安装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 

和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 

备选

1)下载本机库JBoss网站:

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

2)解压

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

3)为您的本机库的文件夹:在你的新文件夹

mkdir -p tomcat-native 

4)移动斌/本地

mv bin/native tomcat-native 

5)让你的文件夹可见的Java。将其添加到standalone.conf或domain.conf中

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

嗨nwinkler。对不起,但这个问题被标记为jboss,这是谷歌搜索的第一个登陆页面之一,使用关键字如JBoss和Native。我试图改变问题/答案。 – 2013-03-05 09:31:22

+0

@nwinkler我认为JBoss EAP的答案就在这里。 EAP 6.0在JBoss AS 7.1.1上只是一个很小的变化。 – 2013-07-25 10:21:11