JBoss AS 安裝配置部署報錯以及使用wildfly替換
jboss-as-7.1.1.
修改配置檔案 vim /data/tools/jboss/standalone/configuration/standalone.xml
修改監聽地址,有127.0.0.1 修改成0.0.0.0
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> <!-- TODO - only show this if the jacorb subsystem is added --> <interface name="unsecure"> <!-- ~ Used for IIOP sockets in the standard configuration.~ To secure JacORB you need to setup SSL --> <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}"/> </interface>
修改http啟動埠
vim /data/tools/jboss/standalone/configuration/standalone.xml
<socket-binding name="http" port="80"/>
修改jvm
[root@jboss1 bin]# vim /data/tools/jboss/bin/standalone.conf
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms1024m -Xmx1024m -Xmn256m -Xss228k -XX:+UseG1GC -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:+DisableExplicitGC -Djava.net.prefe
rIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi
[root@jboss1 bin]# ./standalone.sh ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /data/tools/jboss-as-7.1.1.Final JAVA: /data/jdk/bin/java JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml ========================================================================= Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 Exception in thread "main" javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__SAXParserFactory could not be instantiated: java.lang.NullPointerException at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:204) at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:152) at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:232) at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:127) at jdk.xml.internal.JdkXmlUtils.getSAXFactory(JdkXmlUtils.java:235) at jdk.xml.internal.JdkXmlUtils.<clinit>(JdkXmlUtils.java:78) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.<init>(SchemaParsingConfig.java:319) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.<init>(SchemaParsingConfig.java:254) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.<init>(XSDHandler.java:480) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.<init>(XSDHandler.java:487) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.<init>(XMLSchemaLoader.java:357) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.<init>(XMLSchemaLoader.java:292) at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.<init>(XMLSchemaFactory.java:97) at javax.xml.validation.SchemaFactoryFinder._newFactory(SchemaFactoryFinder.java:232) at javax.xml.validation.SchemaFactoryFinder.newFactory(SchemaFactoryFinder.java:146) at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:213) at __redirected.__SchemaFactory.<clinit>(__SchemaFactory.java:66) at __redirected.__JAXPRedirected.initAll(__JAXPRedirected.java:88) at org.jboss.modules.Module$1.run(Module.java:85) at org.jboss.modules.Module$1.run(Module.java:72) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.modules.Module.<clinit>(Module.java:72) at org.jboss.modules.Main.main(Main.java:255) Caused by: java.lang.NullPointerException at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:94) at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:87) at __redirected.__SAXParserFactory.<init>(__SAXParserFactory.java:102) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:192)
解決辦法
將JBoss主目錄下的jboss-modules.jar替換為jboss-modules-1.1.5.GA.jar,並將其重新命名為jboss-modules.jar; [root@jboss1 jboss-as-7.1.1.Final]# unzip jboss-modules-1.1.5.ga.jar.zip [root@jboss1 jboss-as-7.1.1.Final]# mv jboss-modules-1.1.5.ga.jar jboss-modules.jar
下載地址 http://www.java2s.com/Code/JarDownload/jboss-modules/jboss-modules-1.1.5.ga.jar.zip
啟動
[root@jboss1 bin]# ./standalone.sh
[root@jboss1 log]# /data/tools/jboss/bin/standalone.sh
JBoss Bootstrap Environment
JBOSS_HOME: /data/tools/jboss
JAVA: /data/jdk/bin/java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms1024m -Xmx1024m -Xmn256m -Xss228k -XX:+UseG1GC -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:+DisableExplicitGC -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml
=========================================================================
18:40:25,718 INFO [org.jboss.modules] JBoss Modules version 1.1.5.GA
18:40:26,502 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
18:40:26,651 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
啟動不了,
原因: jdk用的是1.8版本
JDK8中有一些變化,阻止AS7和當前版本的EAP6在JDK8下啟動。我們在WildFly中有很多JDK8相關的修復程式,建議使用它。
可以更改jdk版本,但最好的辦法就是
下載widlfly
https://github.com/wildfly/wildfly/releases/download/26.0.1.Final/wildfly-26.0.1.Final.tar.gz
配置與jboss相同