Skip to content

Commit

Permalink
JBEAP-13958 part 2: Update quickstart README files - add content that…
Browse files Browse the repository at this point in the history
… disappeared during the Markdown to AsciiDoc conversion, fix formatting, make them more consistent with EAP docs
  • Loading branch information
sgilda committed Jan 2, 2018
1 parent 6a24d6a commit 02d5031
Show file tree
Hide file tree
Showing 85 changed files with 3,049 additions and 1,621 deletions.
98 changes: 61 additions & 37 deletions README.adoc

Large diffs are not rendered by default.

53 changes: 33 additions & 20 deletions app-client/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ The `app-client` quickstart demonstrates how to code and package a client app an

== What is it?

The `app-client` quickstart demonstrates how to use the {productName} client container to start the client `Main` program and provide Dependency Injections (DI) for client applications in {productNameFull}. It also shows you how to use Maven to package the application according to the JavaEE specification.
The `app-client` quickstart demonstrates how to use the {productName} client container to start the client `Main` program and provide Dependency Injections (DI) for client applications in {productNameFull}. It also shows you how to use Maven to package the application according to the Java EE specification.

This example consists of the following Maven projects, each with a shared parent:
This example consists of the following Maven projects, each with a shared parent.

[cols="30%,70%",options="headers"]
|===
|Sub-project |Description
|Project |Description

| `ejb`
| This project contains the EJB code that can be called by the client.

| `client-simple`
| This project contains a simple client application that runs in the application-client container to show the injection.

| `ear`
| This project builds the EAR artifact and pulls in the EJB and client artifacts.

|`ejb` |An application that can be called by the `client`.
|`ear` |The EAR packaging contains the server and client side.
|`client-simple` |A simple client application for running in the application-client container to show the injection
|===

The root `pom.xml` file builds each of the subprojects in the appropriate order.
Expand All @@ -41,9 +47,10 @@ All you need to build this project is {buildRequirements}. See link:{configureMa

In the following instructions, replace `__{jbossHomeName}__` with the actual path to your {productName} installation. The installation path is described in detail here: link:{useProductHomeDocUrl}[Use of {jbossHomeName} and JBOSS_HOME Variables].

[[add_the_application_users]]
== Add the Application Users

If the client and server are run on different hosts, you must add the following users to the {productName} server side application. Be sure to use the names and passwords specified in the table as they are required to run this example.
If the client and server are run on different hosts, you must add the following users to the {productName} server side application. Make sure you use the names and passwords specified in the table as they are required to run this example.

[cols="20%,20%,20%,40%",options="headers"]
|===
Expand All @@ -53,7 +60,7 @@ If the client and server are run on different hosts, you must add the following
|quickuser |ApplicationRealm |quick-123 |_leave blank for none_
|===

To add the users, open a terminal and type the following commands:
To add the users, open a terminal and type the following commands.

[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand All @@ -68,7 +75,7 @@ If you prefer, you can use the `add-user` utility interactively. For an example
== Start the Server

. Open a terminal and navigate to the root of the {productName} directory.
. Use the following command to start the server:
. Start the {productName} server with the default standalone profile by typing the following command.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand All @@ -81,7 +88,7 @@ NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script.

. Make sure you have started the {productName} server as described above.
. Open a terminal and navigate to the root directory of this quickstart.
. Type this command to build the artifacts:
. Type the following command to build the artifacts.
+
[source,options="nowrap"]
----
Expand All @@ -92,8 +99,8 @@ $ mvn clean install wildfly:deploy

This example shows how to invoke an EJB from a remote standalone application on the same machine. Both the client and server are on the same machine, so the defaults are sufficient and no authentication is necessary.

. Be sure the quickstart deployed successfully as described above.
. Navigate to the root directory of this quickstart and type the following command to run the application. Be sure to replace `__{jbossHomeName}__` with the path to your {productName} installation.
. Verify that the quickstart deployed successfully as described above.
. Navigate to the root directory of this quickstart and type the following command to run the application. Make sure you replace `__{jbossHomeName}__` with the path to your {productName} installation.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand All @@ -102,14 +109,16 @@ $ __{jbossHomeName}__/bin/appclient.sh ear/target/app-client.ear#simpleClient.ja
+
NOTE: For Windows, use the `__{jbossHomeName}__\bin\appclient.bat` script.

. Review the result. The client outputs the following information, which is provided by the server application:
. Review the result. The client outputs the following information, which is provided by the server application.
+
[source,options="nowrap"]
----
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-51) Main started with arguments
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-51) [Hello, from, command, line]
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-51) [Hello, from, command, line]
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-##) Hello from StatelessSessionBean@myhost
----
+
The client output shows that the `ServerApplication` is called at the jboss.node `myhost`. The application client connected automatically a server on the same machine.

. Review the server log files to see the bean invocations on the server.
+
Expand All @@ -125,8 +134,8 @@ This example shows how to invoke an EJB from a remote standalone Java EE applica
=== Configure Machine_1 (Remote Server Machine)

. Install {productName} on this machine.
. Add the application users to the {productName} server on this machine as described above.
. Start the {productName} server with the following command. Be sure to replace `__MACHINE_1_IP_ADDRESS__` with the IP address of this machine. These arguments make the server accessible to the network.
. xref:add_the_application_users[Add the application users] to the {productName} server on this machine as described above.
. Start the {productName} server with the following command, replacing `__MACHINE_1_IP_ADDRESS__` with the IP address of this machine. These arguments make the server accessible to the network.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand Down Expand Up @@ -155,15 +164,15 @@ remote.connection.default.password=quick-123

. Open a terminal and navigate to the root directory of the quickstart.

. Deploy the `app-client` quickstart to the remote machine using the following command:
. Deploy the `app-client` quickstart to the remote machine using the following command. Make sure you replace `__MACHINE_1_IP_ADDRESS__` with the IP address of `Machine_1`.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
$ mvn clean install wildfly:deploy -Dwildfly.hostname=__MACHINE_1_IP_ADDRESS__ [-Dwildfly.port=9099] -Dwildfly.username=admin -Dwildfly.password=admin-123
----

. Be sure that the quickstart deployed successfully and the server is running on `Machine_1` as described above.
. Type this command to run the `app-client` application:
. Verify that the quickstart deployed successfully and the server is running on `Machine_1` as described above.
. Type the following command to run the `app-client` application.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand All @@ -172,21 +181,25 @@ $ __{jbossHomeName}__/bin/appclient.sh --ejb-client-properties=ejb-client.proper
+
NOTE: For Windows, use the `__{jbossHomeName}__\bin\appclient.bat` script.

. Review the result. The client outputs the following information, which was provided by the application:
. Review the result. The client outputs the following information, which was provided by the application.
+
[source,options="nowrap"]
----
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-51) Main started with arguments
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-51) [Hello, from, command, line]
[org.jboss.as.quickstarts.appclient.acc.client.Main] (Thread-##) Hello from StatelessSessionBean@theOtherHOST
----
+
The client output shows that the `ServerApplication` is called at the jboss.node `theOtherHOST`.

. Review the server log files on the remote machine to see the bean invocations on the server.
+
[source,options="nowrap"]
----
ClientContext is here = {Client =dev84, jboss.source-address=localhost/127.0.0.1:45315}
----
+
As shown above, the connected servers can be configured using the properties file. It is also possible to connect multiple servers or a cluster using the same `jboss-ejb-client.properties` file.

== Undeploy the Archive from the Local Machine

Expand Down
1 change: 0 additions & 1 deletion attributes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@
:configureBytemanQuickstartDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts
:configureBytemanHaltDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#use_byteman_to_halt_the_application[
:configureBytemanQuickstartsDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#configure_byteman_for_use_with_the_quickstarts
>>>>>>> 3712738... JBEAP-13958 part 1: Update quickstart README files - replace shared doc links with new adoc versions, fix formatting up to ejb quickstarts
42 changes: 21 additions & 21 deletions batch-processing/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ In the following instructions, replace `__{jbossHomeName}__` with the actual pat
== Start the Server
. Open a command line and navigate to the root of the {productName} directory.
. The following shows the command line to start the server with the default profile:
. Open a terminal and navigate to the root of the {productName} directory.
. Start the {productName} server with the default standalone profile by typing the following command.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand All @@ -63,8 +63,8 @@ NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script.
== Build and Deploy the Quickstart
. Make sure you have started the {productName} server as described above.
. Open a command line and navigate to the root directory of this quickstart.
. Type this command to build and deploy the archive:
. Open a terminal and navigate to the root directory of this quickstart.
. Type the following command to build and deploy the archive.
+
[source,options="nowrap"]
----
Expand All @@ -81,14 +81,12 @@ You are presented with a simple form that allows you to generate sample files to
=== Usage 1: Import the file without any errors
Click on *Generate a new file and start import job* button. This will generate a new file with 10 unique records to be imported. After the file is generated, the import job will start.
You will see a table containing information about the task that was just started. You can click on *Update jobs list* button and verify that the job was completed.
==== Investigate the Console Output
. Click on *Generate a new file and start import job* button. This generates a new file with 10 unique records to be imported. The import job starts after the file is generated.
At the logs you will see that the files with 10 records were processed using 3 records at a time.
. A table is displayed containing information about the task that was started. Click on the *Update jobs list* button and verify that the job was completed.
. Investigate the console output. It shows that files with 10 records were processed, 3 records at a time.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.quickstarts.batch.controller.BatchController] (default task-3) Starting to generate 10 in file /var/folders/j8/63sgdmbn5tqdkyw0tz6df53r0000gn/T/temp-file.txt
Expand All @@ -106,7 +104,7 @@ INFO [org.jboss.as.quickstarts.batch.job.ContactsFormatter] (Batch Thread - 1)
INFO [org.jboss.as.quickstarts.batch.job.listener.PersistListener] (Batch Thread - 1) Preparing to persist 3 contacts
INFO [org.jboss.as.quickstarts.batch.job.listener.PersistListener] (Batch Thread - 1) Persisting 3 contacts
INFO [org.jboss.as.quickstarts.batch.job.ContactsFormatter] (Batch Thread - 1) Register #7 - Changing name niDXWwGJuQ -> Nidxwwgjuq | phone 949448390 -> (949)-448-390
15:57:40,850 INFO [org.jboss.as.quickstarts.batch.job.ContactsFormatter] (Batch Thread - 1) Register #8 - Changing name VZBArfowSe -> Vzbarfowse | phone 902370961 -> (902)-370-961
INFO [org.jboss.as.quickstarts.batch.job.ContactsFormatter] (Batch Thread - 1) Register #8 - Changing name VZBArfowSe -> Vzbarfowse | phone 902370961 -> (902)-370-961
INFO [org.jboss.as.quickstarts.batch.job.ContactsFormatter] (Batch Thread - 1) Register #9 - Changing name aSpyWCWwje -> Aspywcwwje | phone 246977695 -> (246)-977-695
INFO [org.jboss.as.quickstarts.batch.job.listener.PersistListener] (Batch Thread - 1) Preparing to persist 3 contacts
INFO [org.jboss.as.quickstarts.batch.job.listener.PersistListener] (Batch Thread - 1) Persisting 3 contacts
Expand All @@ -121,20 +119,22 @@ INFO [org.jboss.as.quickstarts.batch.job.listener.JobListener] (Batch Thread -
Now you will simulate a file with duplicate records. This will raise an exception and stop the processing. After that, you will fix the file and continue the importing where it stopped.
Mark the *Generate a duplicate record* checkbox and click on *Generate a new file and start import job* button. If you click on *Update jobs list* button, you will see that the job failed with the following Exit Status: `Error : org.hibernate.exception.ConstraintViolationException: could not execute statement`. This was caused because the job tried to insert a duplicate record at the Database. You will also see `org.h2.jdbc.JdbcSQLException: Unique index or primary key violation` exception stacktraces in the server log.
Next, you will fix the file and restart that job execution. Uncheck the *Generate a duplicate record* checkbox and click on *Generate a new file* button. This will generate file without errors.
. Mark the *Generate a duplicate record* checkbox and click on *Generate a new file and start import job* button. If you click on *Update jobs list* button, you will see that the job failed with the following Exit Status: `Error : org.hibernate.exception.ConstraintViolationException: could not execute statement`. This was caused because the job tried to insert a duplicate record at the Database. You will also see `org.h2.jdbc.JdbcSQLException: Unique index or primary key violation` exception stacktraces in the server log.
Click on *Restart* button in the last column for that job instance in the *List of Jobs* table. If you click on *Update jobs list* button, you will see that the job was completed.
. Next, you will fix the file and restart that job execution. Uncheck the *Generate a duplicate record* checkbox and click on *Generate a new file* button. This will generate the file without errors.
Analyze the logs and check that the job started from the last checkpoint.
. Click on *Restart* button in the last column for that job instance in the *List of Jobs* table. If you click on *Update jobs list* button, you will see that the job was completed.
. Review the server logs and verify that the job started from the last checkpoint.
+
[source,options="nowrap"]
----
16:08:56,323 INFO [org.jboss.as.quickstarts.batch.job.RecordsReader] (Batch Thread - 3) Skipping to line 3 as marked by previous checkpoint
INFO [org.jboss.as.quickstarts.batch.job.RecordsReader] (Batch Thread - 3) Skipping to line 3 as marked by previous checkpoint
----
==== Investigate the Console Output
. Investigate the console output.
+
[source,options="nowrap"]
----
INFO [org.jboss.as.quickstarts.batch.job.listener.JobListener] (Batch Thread - 3) Job import-file - Execution #3 starting.
INFO [org.jboss.as.quickstarts.batch.job.RecordsReader] (Batch Thread - 3) Skipping to line 3 as marked by previous checkpoint
Expand All @@ -158,9 +158,9 @@ INFO [org.jboss.as.quickstarts.batch.job.listener.JobListener] (Batch Thread -
=== Usage 3: Import an error file and do not fix the errors
Check the *Generate a duplicate record* checkbox and click on *Generate a new file ans start import job* button. If you click on *Update jobs list* button, you will see that the job failed with the following Exit Status: `Error : org.hibernate.exception.ConstraintViolationException: could not execute statement`. This was caused because you tried to insert a duplicate record at the Database.
. Check the *Generate a duplicate record* checkbox and click on *Generate a new file ans start import job* button. If you click on *Update jobs list* button, you will see that the job failed with the following Exit Status: `Error : org.hibernate.exception.ConstraintViolationException: could not execute statement`. This was caused because you tried to insert a duplicate record at the Database.
This time you will not fix the file. Just click on *Restart* button again. If you click on *Update jobs list* button, you will see that the job was marked as `ABANDONED` this time because it was restarted once. Notice that there is a new parameter: `restartedOnce=true`. This behavior was implemented at `JobListener` for demonstration purpose to avoid that a `FAILED` job that was already restarted once, to be restarted twice.
. This time you will not fix the file. Just click on *Restart* button again. If you click on *Update jobs list* button, you will see that the job was marked as `ABANDONED` this time because it was restarted once. Notice that there is a new parameter: `restartedOnce=true`. This behavior was implemented in `JobListener` for demonstration purposes, to prevent a `FAILED` job from being restarted twice.
== Server Log: Expected Warnings and Errors
Expand Down
2 changes: 1 addition & 1 deletion bean-validation-custom-constraint/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ In the following instructions, replace `__{jbossHomeName}__` with the actual pat
== Start the Server
. Open a terminal and navigate to the root of the {productName} directory.
. The following shows the command line to start the server:
. Start the {productName} server with the default standalone profile by typing the following command.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand Down
2 changes: 1 addition & 1 deletion bean-validation/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In the following instructions, replace `__{jbossHomeName}__` with the actual pat
== Start the Server
. Open a terminal and navigate to the root of the {productName} directory.
. The following shows the command line to start the server:
. Start the {productName} server with the default standalone profile by typing the following command.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand Down
5 changes: 3 additions & 2 deletions bmt/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ The `bmt` quickstart demonstrates how to manually manage transaction demarcation

On occasion, the application developer requires finer grained control over the lifecycle of JTA transactions and JPA Entity Managers than the defaults provided by the Java EE container. This example shows how the developer can override these defaults and take control of aspects of the lifecycle of JPA and transactions.

When you run this example, you will be provided with a `Use bean managed Entity Managers` checkbox.
When you run this example, you are presented with a *Use bean managed Entity Managers* checkbox.

* If you check the checkbox, it shows the developer responsibilities when injecting an Entity Manager into a managed (stateless) bean.
* If you uncheck the checkbox, shows the developer responsibilities when using JPA and transactions with an unmanaged component.

Expand All @@ -47,7 +48,7 @@ In the following instructions, replace `__{jbossHomeName}__` with the actual pat
== Start the Server
. Open a terminal and navigate to the root of the {productName} directory.
. The following shows the command line to start the server:
. Start the {productName} server with the default standalone profile by typing the following command.
+
[source,subs="+quotes,attributes+",options="nowrap"]
----
Expand Down
Loading

0 comments on commit 02d5031

Please sign in to comment.