Hvordan fikser jeg JBoss AS som sitter fast ved oppstart i Linux?

I helgen lekte jeg med JBoss Application Server på CentOS 7. Jeg installerte 7.1.1, og da jeg prøvde å starte, ble den hengt ved start.

[[email protected] bin]# ./standalone.sh
=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: /home/chandan/Downloads/jboss-as-7.1.1.Final
  JAVA: 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
=========================================================================
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
13:39:15,689 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
13:39:16,236 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
13:39:16,346 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

Jeg ventet i noen minutter, men uten hell.

Er du i samme situasjon? Ikke få panikk!

Det ser ut til at det er et kjent problem med JBoss 7 med Java 8 og løsningen er å bruke Java 7. Det første du vil bekrefte om du bruker Java 8.

[[email protected] bin]# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)
[[email protected] bin]#

Som du kan se ovenfor, har jeg Java 8 og må bruke Java 7.

Hvis du er på CentOS, kan du bruke den lavere versjonen av Java med følgende kommando.

update-alternatives --config java

Det vil gi deg muligheten til å velge java-versjonen

[[email protected] bin]# update-alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
   1           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.x86_64/jre/bin/java)
*+ 2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number:

Skriv inn 1, og du er klar.

  Hvordan installere Gnome 40 på Linux tidlig

Hvis du bruker RHEL eller ikke har Java 7, må du først installere og sette i PATH.

Når jeg har satt Java 7, kunne JBoss 7 starte med suksess.

[[email protected] bin]# ./standalone.sh
=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: /home/chandan/Downloads/jboss-as-7.1.1.Final
  JAVA: 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
========================================================================
13:46:04,337 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
13:46:04,622 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
13:46:04,661 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
13:46:05,552 INFO  [org.xnio] XNIO Version 3.0.3.GA
13:46:05,568 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
13:46:05,584 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
13:46:05,621 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
13:46:05,643 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 3.2.3.GA
13:46:05,651 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
13:46:05,722 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
13:46:05,734 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
13:46:05,778 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
13:46:05,871 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
13:46:05,884 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
13:46:05,901 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
13:46:05,983 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
13:46:06,001 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
13:46:06,002 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.7.Final
13:46:06,104 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
13:46:06,440 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.2.GA
13:46:06,522 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
13:46:06,746 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /home/chandan/Downloads/jboss-as-7.1.1.Final/standalone/deployments
13:46:06,747 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /127.0.0.1:9999
13:46:06,796 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447
13:46:06,883 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
13:46:07,003 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:46:07,004 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 3468ms - Started 133 of 208 services (74 services are passive or on-demand)

Jeg håper dette hjelper. Lære mer om JBoss EAP administrasjon og konfigurasjon her.

  Hvordan spille Age of Empires IV på Linux

Likte du å lese artikkelen? Hva med å dele med verden?

x