Friday 12 May 2017

Installing Wildfly 10.0.0 on ubuntu 16.04

#1 Directory to download wildfly

#root@mayank-VirtualBox:~# cd /opt
#root@mayank-VirtualBox:/opt# ls
#root@mayank-VirtualBox:/opt# wget http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.tar.gz

Downloading the wildfly latest version from official site using wget command



#2 Once download is completed check #ls ,then extract the tar file by using the command.
tar -xvzf wildfly-10.0.0.Final.tar.gz

#root@mayank-VirtualBox:/opt# ls
wildfly-10.0.0.Final.tar.gz
#root@mayank-VirtualBox:/opt# tar -xvzf wildfly-10.0.0.Final.tar.gz






#3 Rename that extracted directory and then change permission.

#root@mayank-VirtualBox:/opt# ls
wildfly-10.0.0.Final wildfly-10.0.0.Final.tar.gz
#root@mayank-VirtualBox:/opt# mv wildfly-10.0.0.Final wildfly
#root@mayank-VirtualBox:/opt# ls
wildfly wildfly-10.0.0.Final.tar.gz



#root@mayank-VirtualBox:/opt#
#root@mayank-VirtualBox:/opt# chmod -R 755 wildfly
#root@mayank-VirtualBox:/opt# ls
wildfly wildfly-10.0.0.Final.tar.gz



#4 Next go to “wildfly/bin/” directory and list the files.

#root@mayank-VirtualBox:/opt# ls
wildfly wildfly-10.0.0.Final.tar.gz
#root@mayank-VirtualBox:/opt# cd wildfly/
#root@mayank-VirtualBox:/opt/wildfly# ls
appclient copyright.txt domain LICENSE.txt README.txt welcome-content
bin docs jboss-modules.jar modules standalone
#root@mayank-VirtualBox:/opt/wildfly# cd bin
#root@mayank-VirtualBox:/opt/wildfly/bin# ls



#root@mayank-VirtualBox:/opt/wildfly/bin# 

#5 Next execute the “standalone.sh” script

#root@mayank-VirtualBox:/opt/wildfly/bin# ./standalone.sh




Use jdk 1.8 instead of jdk 1.7. MetaspaceSize is a new flag added for Metaspace in jdk 1.8.
MetaspaceSize option is introduced in JDK 8.As mentioned in release notes, JDK8 is required for wildfly10, it wont run on JDK7.



/usr/lib/jvm/java-8-oracle/
#root@mayank-VirtualBox:/opt/wildfly/bin# cd
#root@mayank-VirtualBox:~# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)
#root@mayank-VirtualBox:~# source /etc/environment
#root@mayank-VirtualBox:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle
#root@mayank-VirtualBox:~# update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1082 auto mode
1 /usr/lib/jvm/java-7-oracle/jre/bin/java 1082 manual mode
2 /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java 1081 manual mode
* 3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode

Press <enter> to keep the current choice[*], or type selection number: 3
#root@mayank-VirtualBox:~# JAVA_HOME="/usr/lib/jvm/java-8-oracle/" export JAVA_HOME
#root@mayank-VirtualBox:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle/
#root@mayank-VirtualBox:/opt/wildfly/bin# cd
#root@mayank-VirtualBox:~# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)
#root@mayank-VirtualBox:~# source /etc/environment
#root@mayank-VirtualBox:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle
#root@mayank-VirtualBox:~# update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1082 auto mode
1 /usr/lib/jvm/java-7-oracle/jre/bin/java 1082 manual mode
2 /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java 1081 manual mode
* 3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode

Press <enter> to keep the current choice[*], or type selection number: 3
#root@mayank-VirtualBox:~# JAVA_HOME="/usr/lib/jvm/java-8-oracle/" export JAVA_HOME
#root@mayank-VirtualBox:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle/
#root@mayank-VirtualBox:~# cd /opt
#root@mayank-VirtualBox:/opt# cd wildfly/
#root@mayank-VirtualBox:/opt/wildfly# cd bin/
#root@mayank-VirtualBox:/opt/wildfly/bin# ./standalone.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /opt/wildfly

JAVA: /usr/lib/jvm/java-8-oracle//bin/java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

00:23:20,509 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
00:23:23,929 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
00:23:24,585 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
00:23:35,905 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
00:23:36,398 INFO [org.xnio] (MSC service thread 1-2) XNIO version 3.3.4.Final
00:23:36,466 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.3.4.Final
00:23:37,252 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
00:23:37,491 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
00:23:37,949 INFO [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
00:23:37,427 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
00:23:38,155 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
00:23:38,172 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
00:23:38,313 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker 'default' has auto-configured to 2 core threads with 16 task threads based on your 1 available processors
00:23:38,955 INFO [org.jboss.as.connector] (MSC service thread 1-2) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.2.Final)
00:23:39,193 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.3.15.Final starting
00:23:39,845 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
00:23:40,192 INFO [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=4.9.4.Final
00:23:40,462 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.18.Final
00:23:40,583 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.3.15.Final starting
00:23:40,888 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2
00:23:41,791 INFO [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
00:23:41,986 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path '/opt/wildfly/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
00:23:42,251 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
00:23:42,803 INFO [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 16 (per class), which is derived from thread worker pool sizing.
00:23:42,805 INFO [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 4 (per class), which is derived from the number of CPUs on this host.
00:23:42,844 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
00:23:42,866 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
00:23:43,996 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
00:23:44,705 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/standalone/deployments
00:23:46,547 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)
00:23:47,861 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
00:23:47,869 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
00:23:48,216 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
00:23:49,436 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
00:23:49,449 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
00:23:49,451 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 32568ms - Started 267 of 553 services (371 services are lazy, passive or on-demand)


# Now the wildfly is running on port number 9990. We can access wildfly from browser by using following url.

http://127.0.0.1:9990




Add user for Wildfly
#Just open the terminal then kill the current process. Run “add-user.sh” script file
#root@mayank-VirtualBox:/opt/wildfly/bin# ./add-user.sh


# Now again run the “standalone.sh” script file.

#root@mayank-VirtualBox:/opt/wildfly/bin# ./standalone.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /opt/wildfly

JAVA: /usr/lib/jvm/java-8-oracle/bin/java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

# Open the browser and type the following http://127.0.0.1:9990/console.


Authentication Pop-up will open.


# Enter the added user :Username\Password 


# Now you will be directed to Home page




# For deploying click on deployments ,redirect to deployment page.



# Click on Add Button a pop-up will open ,asking for new deployment/creating an unmanaged deployment.



# Select New Deployment  then NEXT>> 



# Select the correct directory and chose the file to be deployed.


# LogOut