Permalink
Browse files

Merge branch 'master' into ejb-http

  • Loading branch information...
ctomc committed Jan 3, 2018
2 parents f2bdfa8 + c6198a8 commit 771702435da0e2674efd1b4d80f98448762979a3
Showing with 5,054 additions and 3,380 deletions.
  1. +88 −69 README.adoc
  2. +99 −75 app-client/README.adoc
  3. +22 −2 attributes.adoc
  4. +58 −43 batch-processing/README.adoc
  5. +26 −22 bean-validation-custom-constraint/README.adoc
  6. +24 −19 bean-validation/README.adoc
  7. +28 −24 bmt/README.adoc
  8. +50 −45 cmt/README.adoc
  9. +76 −69 contacts-jquerymobile/README.adoc
  10. +14 −0 development-shortcuts.adoc
  11. +0 −9 docs.properties
  12. +60 −36 ejb-asynchronous/README.adoc
  13. +42 −31 ejb-in-ear/README.adoc
  14. +26 −25 ejb-in-war/README.adoc
  15. +123 −63 ejb-multi-server/README.adoc
  16. +42 −41 ejb-remote/README.adoc
  17. +117 −79 ejb-security-context-propagation/README.adoc
  18. +166 −89 ejb-security-jaas/README.adoc
  19. +109 −87 ejb-security-programmatic-auth/README.adoc
  20. +87 −65 ejb-security/README.adoc
  21. +61 −36 ejb-throws-exception/README.adoc
  22. +23 −18 ejb-timer/README.adoc
  23. +35 −23 forge-from-scratch/README.adoc
  24. +28 −25 greeter/README.adoc
  25. +78 −27 ha-singleton-deployment/README.adoc
  26. +160 −80 ha-singleton-service/README.adoc
  27. +80 −36 helloworld-html5/README.adoc
  28. +83 −69 helloworld-jms/README.adoc
  29. +67 −49 helloworld-mbean/README.adoc
  30. BIN helloworld-mbean/{helloworld-mbean-webapp/src/main/webapp → images}/jconsole.png
  31. BIN helloworld-mbean/{helloworld-mbean-webapp/src/main/webapp → images}/jconsole_connection.png
  32. +68 −43 helloworld-mdb-propertysubstitution/README.adoc
  33. +18 −17 helloworld-mdb/README.adoc
  34. +141 −95 helloworld-mutual-ssl-secured/README.adoc
  35. +114 −72 helloworld-mutual-ssl/README.adoc
  36. +24 −20 helloworld-rs/README.adoc
  37. +22 −19 helloworld-singleton/README.adoc
  38. +84 −49 helloworld-ssl/README.adoc
  39. +30 −23 helloworld-ws/README.adoc
  40. +19 −17 helloworld/README.adoc
  41. +45 −36 hibernate/README.adoc
  42. +54 −30 inter-app/README.adoc
  43. +87 −81 jaxrs-client/README.adoc
  44. +50 −29 jaxws-addressing/README.adoc
  45. +50 −26 jaxws-ejb/README.adoc
  46. +51 −29 jaxws-pojo/README.adoc
  47. +72 −40 jaxws-retail/README.adoc
  48. +24 −20 jsonp/README.adoc
  49. +64 −37 jta-crash-rec/README.adoc
  50. +194 −26 jts-distributed-crash-rec/README.adoc
  51. +127 −85 jts/README.adoc
  52. +36 −26 kitchensink-angularjs/README.adoc
  53. +45 −33 kitchensink-ear/README.adoc
  54. +43 −37 kitchensink-html5-mobile/README.adoc
  55. +37 −27 kitchensink-jsp/README.adoc
  56. +47 −34 kitchensink-ml/README.adoc
  57. +33 −23 kitchensink/README.adoc
  58. +47 −31 logging-tools/README.adoc
  59. +85 −60 logging/README.adoc
  60. +67 −44 mail/README.adoc
  61. +53 −43 managed-executor-service/README.adoc
  62. +180 −115 messaging-clustering-singleton/README.adoc
  63. +145 −94 messaging-clustering/README.adoc
  64. +20 −17 numberguess/README.adoc
  65. +22 −18 payment-cdi-event/README.adoc
  66. +33 −31 resteasy-jaxrs-client/README.adoc
  67. +22 −24 servlet-async/README.adoc
  68. +46 −35 servlet-filterlistener/README.adoc
  69. +86 −48 servlet-security/README.adoc
  70. +82 −51 shopping-cart/README.adoc
  71. +33 −29 shrinkwrap-resolver/README.adoc
  72. +49 −42 spring-greeter/README.adoc
  73. +33 −27 spring-kitchensink-basic/README.adoc
  74. +33 −27 spring-kitchensink-springmvctest/README.adoc
  75. +47 −43 spring-petclinic/README.adoc
  76. +27 −21 spring-resteasy/README.adoc
  77. +36 −26 tasks-jsf/README.adoc
  78. +90 −54 tasks-rs/README.adoc
  79. +28 −17 tasks/README.adoc
  80. +22 −18 temperature-converter/README.adoc
  81. +56 −46 template/README.adoc
  82. +24 −18 thread-racing/README.adoc
  83. +30 −24 websocket-client/README.adoc
  84. +21 −16 websocket-endpoint/README.adoc
  85. +26 −21 websocket-hello/README.adoc
  86. +45 −31 wsat-simple/README.adoc
  87. +43 −27 wsba-coordinator-completion-simple/README.adoc
  88. +42 −28 wsba-participant-completion-simple/README.adoc
  89. +30 −24 xml-jaxp/README.adoc
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -3,6 +3,26 @@
:jbossHomeName: WILDFLY_HOME
:productVersion: 12
:buildRequirements: Java 8.0 (Java SDK 1.8) or later and Maven 3.3.1 or later
:githubRepoUrl: https://github.com/wildfly/quickstart/
:useEclipseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_JBDS.md#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts
:jbdsEapServerName: WildFly Application Server 11.x
:githubRepoUrl: https://github.com/wildfly/quickstart/
:useEclipseUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_JBDS.adoc#use_red_hat_jboss_developer_studio_or_eclipse_to_run_the_quickstarts
:useEclipseDeployJavaClientDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_containing_server_and_java_client_projects
:useEclipseDeployEARDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_JBDS.adoc#deploy_and_undeploy_a_quickstart_ear_project
:useProductHomeDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_OF_{jbossHomeName}.adoc#use_of_product_home_and_jboss_home_variables
:configureMavenDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_MAVEN_JBOSS_EAP.adoc#configure_maven_to_build_and_deploy_the_quickstarts
:arquillianTestsDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/RUN_ARQUILLIAN_TESTS.adoc#run_the_arquillian_tests
:addUserDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CREATE_USERS.adoc#create_users_required_by_the_quickstarts
:addApplicationUserDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CREATE_USERS.adoc#add_an_application_user
:addManagementUserDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CREATE_USERS.adoc#add_an_management_user
:startServerDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/START_JBOSS_EAP.adoc#start_the_jboss_eap_server
:configurePostgresDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_database_for_use_with_the_quickstarts
:configurePostgresDownloadDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#download_and_install_postgresql
:configurePostgresCreateUserDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#create_a_database_user
:configurePostgresAddModuleDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#add_the_postgres_module_to_the_jboss_eap_server
:configurePostgresDriverDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_POSTGRESQL_JBOSS_EAP.adoc#configure_the_postgresql_driver_in_the_jboss_eap_server
:configureBytementDownloadDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#download_and_configure_byteman
:configureBytemanDisableDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#disable_the_byteman_script
:configureBytemanClearDocUrl: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_BYTEMAN.adoc#clear_the_transaction_object_store
: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
@@ -16,48 +16,59 @@ The `batch-processing` quickstart shows how to use chunk oriented batch jobs to
== What is it?
This quickstart simulates a file importation using batch jobs. To make it easy, this quickstart offers the user a way to generate files. The generate file can have its name and the number of records customized. The user may also specify if the file contains an error or not.
This quickstart simulates a file importation using batch jobs. To make it easy, this quickstart offers the user a way to generate files. The generated file can have its name and the number of records customized. The user can also specify if the file contains an error or not.
The Job contains two steps (tasks):
The job contains two tasks:
. Import the file (Chunk oriented) - The chunk size was set to `3`. The `RecordsReader` is responsible for parsing the file and create an instance of `Contact`. The `ContactsFormatter` applies the proper case to the Contact name and it also applies a mask to the phone number. Finally, `ContactsPersister` will send the Contact instance to the Database.
. Log the number of records imported
. It imports the file using a chunk oriented approach.
The database schema defines that the column for name is unique. For that reason, any atempt to persist a duplicate value will throw an exception. On the second attempt to run the job, the `ChunkCheckpoint` will provide information to skip the Contacts that were already persisted.
* The chunk size is set to `3`.
* The `RecordsReader` is responsible for parsing the file and create an instance of `Contact`.
* The `ContactsFormatter` applies the proper case to the contact name and it also applies a mask to the phone number.
* Finally, `ContactsPersister` sends the contact instance to the database.
_Note: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment!_
. It logs the number of records imported.
_Note: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/[Configuration Guide] for {productNameFull}._
The database schema defines that the column for name is unique. For that reason, any attempt to persist a duplicate value will throw an exception. On the second attempt to run the job, the `ChunkCheckpoint` provides information to skip the contacts that were already persisted.
//*************************************************
// Add notes about use in a production environment.
//*************************************************
:uses-h2:
:uses-ds-xml:
include::../development-shortcuts.adoc[leveloffset=+1]
== System Requirements
The application this project produces is designed to be run on {productNameFull} {productVersion} or later.
All you need to build this project is {buildRequirements}. See https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_MAVEN_JBOSS_EAP7.md#configure-maven-to-build-and-deploy-the-quickstarts[Configure Maven for {productName} {productVersion}] to make sure you are configured correctly for testing the quickstarts.
All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts.
== Use of {jbossHomeName}
In the following instructions, replace `{jbossHomeName}` with the actual path to your {productName} installation. The installation path is described in detail here: https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_OF_{jbossHomeName}.md#use-of-eap_home-and-jboss_home-variables[Use of {jbossHomeName} and JBOSS_HOME Variables].
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].
== 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:
[subs=normal]
. 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"]
----
For Linux: {jbossHomeName}/bin/standalone.sh
For Windows: {jbossHomeName}\bin\standalone.bat
$ __{jbossHomeName}__/bin/standalone.sh
----
+
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"]
----
mvn clean package wildfly:deploy
$ mvn clean package wildfly:deploy
----
. This will deploy `target/{artifactId}.war` to the running instance of the server.
@@ -70,14 +81,13 @@ 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
INFO [org.jboss.as.quickstarts.batch.controller.BatchController] (default task-3) File generated at /var/folders/j8/63sgdmbn5tqdkyw0tz6df53r0000gn/T/temp-file.txt
@@ -94,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
@@ -107,22 +117,24 @@ INFO [org.jboss.as.quickstarts.batch.job.listener.JobListener] (Batch Thread -
=== Usage 2: Import an error file and fix it
Now we will simulate a file with duplicate records. This will raise an exception and stop the processing. After that, we will fix the file and continue the importing where it stopped.
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.
. 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.
Now we 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.
. 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.
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.
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
@@ -146,14 +158,15 @@ 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 we 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 we 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
NOTE: You will see the following warnings in the server log. You can ignore these warnings.
You will see the following warnings in the server log. You can ignore these warnings.
[source,options="nowrap"]
----
WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
@@ -163,11 +176,12 @@ HHH000431: Unable to determine H2 database version, certain features may not wor
== Undeploy the Archive
. Make sure you have started the {productName} server as described above.
. Open a command prompt and navigate to the root directory of this quickstart.
. Open a terminal and navigate to the root directory of this quickstart.
. When you are finished testing, type this command to undeploy the archive:
+
[source,options="nowrap"]
----
mvn wildfly:undeploy
$ mvn wildfly:undeploy
----
== Run the Quickstart in Red Hat JBoss Developer Studio or Eclipse
@@ -178,6 +192,7 @@ You can also start the server and deploy the quickstarts or run the Arquillian t
If you want to debug the source code of any library in the project, run the following command to pull the source into your local repository. The IDE should then detect it.
[source,options="nowrap"]
----
$ mvn dependency:sources
----
mvn dependency:sources
----
Oops, something went wrong.

0 comments on commit 7717024

Please sign in to comment.