Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Java EE 7 Development with WildFly
Java EE 7 Development with WildFly

Java EE 7 Development with WildFly: Leverage the power of the WildFly application server from JBoss to develop modern Java EE 7 applications

eBook
$9.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Java EE 7 Development with WildFly

Chapter 2. Your First Java EE Application on WildFly

This chapter will provide you with a crash course in the new application server so that you will be able to create a deployable skeleton of our first Java EE 7 application in the next chapter. More specifically, we will cover the following topics:

  • An introduction to the WildFly 8 core concepts
  • The anatomy of the WildFly 8 filesystem
  • An introduction to the available management instruments
  • Deploying your first Hello World application

WildFly 8 core concepts

Now that we have downloaded and installed WildFly 8, it is worth spending a few minutes familiarizing ourselves with some basic concepts. The architecture and most of the core ideas are taken straight from JBoss AS 7; although, there are some new mechanisms that were introduced with the newest version (for example, role-based security for the management system, reduced number of used ports, and a new patching system). Just like JBoss AS 7, WildFly can be run in two modes: the standalone mode and domain mode.

In the standalone mode, each WildFly instance is an independent process (similar to the previous JBoss AS versions, such as Version 4, Version 5, Version 6, and the standalone mode in Version 7). The standalone configuration files are located under the standalone/configuration directory of the application server.

In the domain mode, you can run multiple application servers and manage them from a central point. A domain can span multiple physical (or virtual) machines...

The WildFly 8 directory layout

The difference between standalone and domain reflects in the directory layout of the application server is shown in the following diagram:

The WildFly 8 directory layout

As you can see in the preceding diagram, the WildFly directory layout is divided into two main parts: the first one is pertinent to a standalone server mode and the other is dedicated to a domain server mode. Common to both server modes is the modules directory, which is the heart of the application server.

WildFly is based on the JBoss Modules project, which provides an implementation of a modular (nonhierarchical) class loading and an execution environment for Java. In other words, rather than a single class loader that loads all JARs into a flat class path, each library becomes a module, which only links to the exact modules it depends on and nothing more. It implements a thread safe, fast, and highly concurrent delegating class loader model, coupled with an extensible module resolution system. This combines to form a...

Managing the application server

WildFly provides three different means to configure and manage servers: a web interface, a command-line client, and a set of XML configuration files. No matter what approach you choose, the configuration is always synchronized across the different views and finally persisted to the XML files. After saving the changes using the web interface, you will instantly see an updated XML file in your server's configuration directory.

Managing WildFly 8 with the web interface

The web interface is a Google Web Toolkit (GWT) application, which can be used to manage a standalone or domain WildFly distribution. The GWT application known in JBoss AS 7 has been updated to match the new visual theme. It was also extended with new features, such as role-based security and patching support. By default, it is deployed on a localhost on the 9990 port; the property that controls the port socket binding is jboss.management.http.port, as specified in the server configuration...

Launching the web console

Now that we have added at least one user, we can launch the web console at the default address, http://<host>:9990/console (keep in mind that you have to start the server first, for example, with standalone.bat or standalone.sh).

The login screen will be prompted. Enter data into the User Name and Password fields, which we had formerly created. This is shown in the following screenshot:

Launching the web console

Once logged in, you will be redirected to the web administration main screen. The web console, when running in the standalone mode, will be divided into three main tabs: Configuration, Runtime, and Administration. This is shown in the following screenshot:

Launching the web console

The Configuration tab contains all the single subsystems that are part of a server profile. So, once you select the Configuration tab on the left frame, you can access all the subsystems and edit their configurations (in the previous screenshot, we saw the Data Sources subsystem).

The other tab named Runtime can be used for...

Deploying your first application to WildFly 8

In order to test launch our first application, we will create a HelloWorld web project using Eclipse. The main part will be a servlet class, used to generate HTML markup. So, launch Eclipse and choose to create a new web project by navigating to File | New | Dynamic Web Project. This is shown in the following screenshot:

Deploying your first application to WildFly 8

Choose a name for your application and check the Use default location box if you want to create your project within the same location of your Eclipse workspace. If you have correctly configured a new WildFly server in Eclipse, you should see the WildFly 8.0 Runtime option selected by default, and Target Runtime and Default Configuration for WildFly 8.0 Runtime preselected in the Configuration box.

Select 3.1 as the Dynamic web module version, which makes development easy by using the Servlet 3.1 specifications, and also leave the EAR membership and Add project to working sets checkboxes unselected.

Click on Finish to continue.

Now...

WildFly 8 core concepts


Now that we have downloaded and installed WildFly 8, it is worth spending a few minutes familiarizing ourselves with some basic concepts. The architecture and most of the core ideas are taken straight from JBoss AS 7; although, there are some new mechanisms that were introduced with the newest version (for example, role-based security for the management system, reduced number of used ports, and a new patching system). Just like JBoss AS 7, WildFly can be run in two modes: the standalone mode and domain mode.

In the standalone mode, each WildFly instance is an independent process (similar to the previous JBoss AS versions, such as Version 4, Version 5, Version 6, and the standalone mode in Version 7). The standalone configuration files are located under the standalone/configuration directory of the application server.

In the domain mode, you can run multiple application servers and manage them from a central point. A domain can span multiple physical (or virtual) machines...

Left arrow icon Right arrow icon

Description

If you are a Java developer who wants to learn about Java EE, this is the book for you. It's also ideal for developers who already have experience with the Java EE platform but would like to learn more about the new Java EE 7 features by analyzing fully functional sample applications using the new application server WildFly.

What you will learn

  • Design reliable and efficient applications based on Enterprise Java Beans and Context and Dependency Injection
  • Set up and manage your own WildFly application server for different development scenarios
  • Store your data without binding yourself to a specific database provider using the Java Persistence API
  • Create messagebased applications using Java Messaging System and integrate thirdparty systems into them using Java Connector Architecture
  • Distribute and secure your enterprise applications by using builtin mechanisms from WildFly and Java EE 7
  • Decide between using SOAP and JAXRS web services to create your external API
  • Discover the new side of web applications by exploring WebSockets and their usage scenarios
  • Test your application using a real environment with Arquillian

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 31, 2014
Length: 434 pages
Edition : 1st
Language : English
ISBN-13 : 9781782171997
Vendor :
Red Hat
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 31, 2014
Length: 434 pages
Edition : 1st
Language : English
ISBN-13 : 9781782171997
Vendor :
Red Hat
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 164.97
Java EE 7 Development with WildFly
$54.99
WildFly Performance Tuning
$54.99
WildFly Configuration, Deployment, and Administration - Second Edition
$54.99
Total $ 164.97 Stars icon
Banner background image

Table of Contents

15 Chapters
1. Getting Started with WildFly Chevron down icon Chevron up icon
2. Your First Java EE Application on WildFly Chevron down icon Chevron up icon
3. Introducing Java EE 7 – EJBs Chevron down icon Chevron up icon
4. Learning Context and Dependency Injection Chevron down icon Chevron up icon
5. Combining Persistence with CDI Chevron down icon Chevron up icon
6. Developing Applications with JBoss JMS Provider Chevron down icon Chevron up icon
7. Adding Web Services to Your Applications Chevron down icon Chevron up icon
8. Adding WebSockets Chevron down icon Chevron up icon
9. Managing the Application Server Chevron down icon Chevron up icon
10. Securing WildFly Applications Chevron down icon Chevron up icon
11. Clustering WildFly Applications Chevron down icon Chevron up icon
12. Long-term Tasks' Execution Chevron down icon Chevron up icon
13. Testing Your Applications Chevron down icon Chevron up icon
A. Rapid Development Using JBoss Forge Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(7 Ratings)
5 star 71.4%
4 star 14.3%
3 star 14.3%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Swerts Dec 21, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Easy to read, this book is very helpful for those who have a previous knowledge of Java language, and wants to start developing a complete enterprise application.
Amazon Verified review Amazon
Nikolas Jan 22, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Ich habe das Buch als Hilfestellung zu einem Studienprojekt gekauft und als ich auf meine Kosten gekommen bin, war noch viel Buch übrig!Allerdings behandelt das Buch nicht die aktuelle Version von Wildfly, sondern 8.0. In meinem Fall war es aber die Richtige.Es wäre vielleicht noch anzumerken, dass das Buch ziemlich schlecht gebunden ist; bei meinem Exemplar fingen schon nach 10 Tagen an, einzelne Seite herunterzufallen. Ich habe den Kauf trotzdem nicht bereut.
Amazon Verified review Amazon
Nubye Oct 25, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I recommend it. Be carefull dont lost yourself when read Java implentations (1st chapters), they are enabled capabilites on Java EE.
Amazon Verified review Amazon
Lorenzo Bettini Feb 27, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book not only explains the features of Wildfly: it also introduces J2EE main concepts and it does so in all the chapters. Indeed each chapter starts with a description of the functionality, and then proceeds with an example of such functionality.I had never used J2EE technlogies before, and this book surely helped me started with web application development with J2EE and Wildfly.What I appreciated most is the chapter on testing; it's only unfortunate that it comes really too late in the book (it's the last chapter); I would have preferred to see that chapter quite early in the book, and then see tests in all the chapters.I found the chapter about "Securing Wildfly Applications" a little bit confusing in many parts... I had the overall pictures but it probably tries to give too many details in the space of a single chapter, and most of such details are rather confusing.All in all, I think this is a nice book and I suggest it to anyone who's willing to start developing with Wildfly.
Amazon Verified review Amazon
joedayz Mar 15, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice Introduction about JAVA EE 7 APIs.Starts with the installation of tools in the chapter 01.Ideal for have a successful experience with the source code of each chapter.The chapter 2 explains how to use the wildfly web console and command line interface, configure anddeploy your applications. That's is a crash course of wildfly administration that sometimes appears in other book.Good idea for me.I enjoy find a book that explains step by step some topic. The creation of the lab using EJBs and Maven is amazing.CDI is not a easy topic. The explanation is simple and enables to understand the dependency injection in a JAVA EE 7 context.Configure and use Richfaces permit to understand how to use a MVC framework like JSF.The book continues with the Persistency and how to configure JPA, reverse engineered, use producers, servicesand controllers. Thats pretty cool for have the whole figure.The chapter 6 is my favorite because you can learn to use messaging with wildfly or external message brokers likeactivemq and hornetQ.If you are interestd in learn to configure and createweb services SOAP and REST the chapter 7 explains with granular detail these topics.If you are tired of see the chat demo with websockets. That's a great demo aboutpush notification of seats free or busy.Finally if you want to administrate your wildfly like a boss and monitor the health of it. The chapternine will be very util for you, because if you are a good programmer, you must to do control of your Java EE stack.I love PicketBox thanks to it chapter. Put secure to your applications of a easy way.I didn't find a chapter about Clustering in other books. This is a topic that many beginners doesn't know.For this reason, I enjoyed this chapter and learned new features.Create Batch applications is fundamental for long tasks in the enterprise world. Very nice tofind this lab in the chapter 12.I used Junit long time ago, but the testing chapter about arquillian shows me a great way for dointegral test. No more mocks.Finally the appendix about Jboss Forge similar to ROO but with focus to JAVA EE 7. Pretty cool.In general, I recommend this book if you think to develop Java EE applications seriously.Regards from PERU JUG.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.