在Ubuntu 18.04上安装WildFly 18并连接到Eclipse IDE

在开发Java EE / Jakarta EE项目时,您会知道需要一台Java服务器,其中一些使用最广泛的Java Enterprise服务器包括Apache Tomcat,Glassfish,Jetty和WildFly / JBoss服务器。它们提供了所需的大多数企业功能。Glassfish和WildFly / JBoss提供了完整的功能集,并且大多数由企业使用。

对于CentOS:在CentOS 8 / CentOS 7上安装WildFly(JBoss)服务器

在本文中,我将向您展示如何安装WildFly18。但是首先,Wildfly和JBoss AS有什么区别?Wildfly是Java EE服务器的社区版本,而JBoss As是企业的企业版本。 JBoss AS简单地说就是WildFly的安全版本。

因此,显然要做的第一件事是安装Java。

$ java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)

在Ubuntu 18.04上安装WildFly 18

我们将下载WildFly 18并选择安装位置。我正在〜/ eclipse / servers /下安装我的

mkdir -p ~/eclipse/servers
cd ~/eclipse/servers
wget https://download.jboss.org/wildfly/18.0.1.Final/wildfly-18.0.1.Final.zip
unzip wildfly-18.0.0.Final.zip

之后,我们添加管理员来管理某些数据源,例如数据源。

cd wildfly-18.0.0.Final/bin/
./add-user.sh

按照如下所示的说明填写问题:

配置管理员时的说明

配置完成后,如下所示独立启动WildFly服务器实例:

$ ./standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/eugene/eclipse/servers/wildfly-18.0.1.Final

  JAVA: 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  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

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

09:56:39,410 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final
09:56:40,063 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
09:56:40,074 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
09:56:40,248 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) starting
09:56:41,485 INFO  [org.wildfly.security] (ServerService Thread Pool -- 26) ELY00001: WildFly Elytron version 1.10.4.Final
09:56:42,239 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
09:56:42,334 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 36) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
09:56:42,401 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
09:56:42,440 INFO  [org.xnio] (MSC service thread 1-4) XNIO version 3.7.3.Final
09:56:42,455 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.7.3.Final
09:56:42,554 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 43) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
09:56:42,566 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 51) WFLYCLINF0001: Activating Infinispan subsystem.
09:56:42,613 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 60) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
09:56:42,614 INFO  [org.jboss.remoting] (MSC service thread 1-6) JBoss Remoting version 5.0.15.Final
09:56:42,590 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 53) WFLYRS0016: RESTEasy version 3.9.1.Final
09:56:42,612 INFO  [org.jboss.as.connector] (MSC service thread 1-5) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.17.Final)
09:56:42,620 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2
09:56:42,621 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58) WFLYJSF0007: Activated the following JSF Implementations: [main]
09:56:42,659 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 61) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
09:56:42,662 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 64) WFLYNAM0001: Activating Naming Subsystem
09:56:42,677 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 62) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
09:56:42,714 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 63) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
09:56:42,686 INFO  [org.jboss.as.naming] (MSC service thread 1-7) WFLYNAM0003: Starting Naming Service
09:56:42,739 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 70) WFLYSEC0002: Activating Security Subsystem
09:56:42,785 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 74) WFLYWS0002: Activating WebServices Extension
09:56:42,777 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 52) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
09:56:42,771 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-7) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
09:56:42,771 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=5.0.3.Final
09:56:42,760 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 72) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
09:56:42,939 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0003: Undertow 2.0.27.Final starting
09:56:43,085 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0014: Creating file handler for path '/home/eugene/eclipse/servers/wildfly-18.0.1.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
09:56:43,100 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0012: Started server default-server.
09:56:43,102 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting
09:56:43,113 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
09:56:43,113 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
09:56:43,286 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
09:56:43,488 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0493: EJB subsystem suspension complete
09:56:43,574 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
09:56:43,763 INFO  [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
09:56:43,795 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore /home/eugene/eclipse/servers/wildfly-18.0.1.Final/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
09:56:43,828 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /home/eugene/eclipse/servers/wildfly-18.0.1.Final/standalone/deployments
09:56:43,920 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
09:56:44,010 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3) 
09:56:44,207 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:56:44,210 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:56:44,211 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:56:44,211 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) started in 5378ms - Started 315 of 577 services (369 services are lazy, passive or on-demand)

服务器运行时,可以在以下位置访问Web管理界面 http://本地主机:9990 /控制台您可以使用Web管理界面来创建数据源,管理部署和配置服务器。

在Ubuntu 18.04上安装WildFly 18并连接到Eclipse IDEWildFly管理控制台

将WildFly 18添加到Eclipse IDE

调出Eclipse IDE,然后转到 帮忙 > 安装新软件…>使用:

单击添加以添加JBoss工具插件:

名称: JBoss工具

地点: http://download.jboss.org/jbosstools/photon/development/updates/

选择所需的功能,然后单击 完成 然后重启

重新启动后,单击服务器选项卡,通常将是空白的带有创建服务器的链接。单击该链接将弹出一个用于配置服务器的窗口。

从Jboss Community列表中选择WildFly18,单击Next然后设置已安装WildFly的主目录,其余的将为您配置,单击Finish。

测试WildFly 18与Eclipse IDE的集成

创建一个简单的项目来测试您的服务器,它现在应该可以工作了!

测试WildFly 18服务器

谢谢,祝你有美好的一天!

查看我们博客中其他与Dev相关的指南。

在RHEL 8 / CentOS 8上安装GCC和开发工具

如何在Ubuntu 18.04上安装Chef Development Kit / Workstation

如何使用Terraform在oVirt / RHEV上配置VM

Sidebar