Quick Start for Wildfly (JBoss AS) Application Server

Source: Internet
Author: User
Keywords learn jboss application server wildfly application server jboss as vs wildfly
What is wildfly
JBoss AS is named wildfly since version 8. Wildfly is an open source JavaEE-based lightweight application server. It can be used for free in any commercial application.

WildFly is a flexible, lightweight, and powerful application server with management capabilities. Wildfly is a container and server that manages EJBs, but JBoss core services do not include WEB containers that support servlet/JSP, and are generally used in conjunction with Tomcat or Jetty.

Features
Unparalleled speed: fast startup, unlimited network performance and scalability.
Very lightweight: thin memory management, runtime can be customized.
Powerful management functions: unified configuration and management.
For more features of Wildfly and comparison with common web services on the market, please refer to "Comparison of Popular WEB Containers TOMCAT, JETTY, GLASSFISH, WILDFLY".

Download and install
wildfly download address: https://wildfly.org/downloads/

Currently, the latest version is 18.0.0.Final, select the ZIP version corresponding to the "Java EE Full & Web Distribution" item, and click to download. If the download on the official website is slow, you can follow the WeChat official account "New Vision of Program" and reply to "wildfly" to get the download link.

Java 8 or higher is required to install the java environment.

The so-called installation is just decompression. Let's take a look at the directory structure of this version:
├── LICENSE.txt
├── README.txt
├── appclient
├── bin
├── copyright.txt
├── docs
├── domain
├── jboss-modules.jar
├── modules
├── standalone
└── welcome-content

The applications stored in the standalone directory will occupy the process separately, and can be started and shut down separately, with no correlation between them. There are many xml files to choose at startup.

There is a correlation between applications in the domain directory, managing multiple servers from a single control point.

Module directory, jboss uses module to load the driver.

readme and start command
Focus on the content in the readme and provide guidance on startup.

Key features:

Key Features
------------
* Jakarta EE 8 support
* Fast Startup
* Small Footprint
* Modular Design
* Unified Configuration and Management
* Distributed Domain Management

Obtain the document, and it can also be seen that the default is to monitor port 8080 at startup.
Also, once WildFly is started you can go to http://localhost:8080/
for additional information.

Start command:
Starting a Standalone Server
----------------------------
A WildFly standalone server runs a single instance.

<JBOSS_HOME>/bin/standalone.sh (Unix / Linux)

<JBOSS_HOME>\bin\standalone.bat (Windows)

The startup script is located in the root directory/bin directory. Windows is standalone.bat and Linux is standalone.sh.

Wildfly can also start a management background to manage the service.
Starting a Managed Domain
-------------------------
A WildFly managed domain allows you to control and configure multiple instances,
potentially across several physical (or virtual) machines. The default
configuration includes a domain controller and a single server group with three
servers (two of which start automatically), all running on the localhost.

<JBOSS_HOME>/bin/domain.sh (Unix / Linux)

<JBOSS_HOME>\bin\domain.bat (Windows)

The startup script is located in the root directory/bin directory. Windows is domain.bat and Linux is domain.sh.

To stop the service, you can enter the Ctrl c command through the console to operate. If the service is running in the background, you can execute the following command to stop it.
<JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown (Unix / Linux)

<JBOSS_HOME>\bin\jboss-cli.bat --connect --command=:shutdown (Windows)

Start operation
Now start the project standalone to see the effect.
19:48:11,234 INFO [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
19:48:11,234 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
19:48:11,296 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
19:48:11,409 INFO [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: EJB subsystem suspension complete
19:48:11,479 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
19:48:11,579 INFO [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
19:48:11,596 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore /Users/zzs/tools/wildfly18/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
19:48:11,606 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) WFLYDS0013: Started FileSystemDeploymentService for directory /Users/zzs/tools/wildfly18/standalone/deployments
19:48:11,746 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
19:48:11,846 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
19:48:11,963 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started in 3880ms-Started 315 of 577 services (369 services are lazy , passive or on-demand)

It can be seen from the above log that wildfly listened to ports 8080, 8443 and 9990.

The url for accessing the server is 127.0.0.1:8080, and the url for accessing the management background is: http://127.0.0.1:9990/.

Visit the server to see the following page:

image

The page contains links to documents, quick start, management background, etc.

At this time, access to the background management will prompt the following:
Welcome to WildFly
Your WildFly Application Server is running.
However you have not yet added any users to b
e able to access the admin console.

To add a new user execute the add-user.sh script within the bin folder of your WildFly installation and enter the requested information.

By default the realm name used by WildFly is "ManagementRealm" this is already selected by default.

After you have added the user follow this link to Try Again.

In other words, the startup was successful, but no user was configured. Like tomcat, wildfly also has its own service management page, which can manage applications uniformly and set permissions for users. Execute the add-user script to add the administrator user.

bin zzs$ ./add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
 # Enter a to add an administrative user
(a): a
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.