forked from jboss-eap/quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
798 lines (605 loc) · 77.7 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
<html><head><title>README</title><link href="https://raw.github.com/pmuir/github-flavored-markdown/gh-pages/shared/css/documentation.css" rel="stylesheet"></link><link href="https://raw.github.com/github/github-flavored-markdown/gh-pages/shared/css/pygments.css" rel="stylesheet"></link></head><body><h1 id="toc_0">JBoss AS Quickstarts</h1>
<p>Summary: The quickstarts demonstrate Java EE 6 and a few additional technologies from the JBoss stack. They provide small, specific, working examples that can be used as a reference for your own project.</p>
<h2 id="toc_1">Introduction</h2>
<p>These quickstarts run on both JBoss Enterprise Application Platform 6 and JBoss AS 7. If you want to run the quickstarts on JBoss Enterprise Application Platform 6, we recommend using the JBoss Enterprise Application Platform 6 ZIP file. This version uses the correct dependencies and ensures you test and compile against your runtime environment. </p>
<p>Be sure to read this entire document before you attempt to work with the quickstarts. It contains the following information:</p>
<ul>
<li><p><a href="#availableQuickstarts">Available Quickstarts</a>: List of the available quickstarts and details about each one.</p></li>
<li><p><a href="#suggestedApproach">Suggested Approach to the Quickstarts</a>: A suggested approach on how to work with the quickstarts.</p></li>
<li><p><a href="#systemrequirements">System Requirements</a>: List of software required to run the quickstarts.</p></li>
<li><p><a href="#mavenconfiguration">Configure Maven</a>: How to configure the Maven repository for use by the quickstarts.</p></li>
<li><p><a href="#runningquickstarts">Run the Quickstarts</a>: General instructions for building, deploying, and running the quickstarts.</p></li>
<li><p><a href="#arquilliantests">Run the Arquillian Tests</a>: How to run the Arquillian tests provided by some of the quickstarts.</p></li>
<li><p><a href="#optionalcomponents">Optional Components</a>: How to install and configure optional components required by some of the quickstarts.</p></li>
</ul>
<p><a id="availableQuickstarts"></a></p>
<h2 id="toc_2">Available Quickstarts </h2>
<p>The following is a list of the currently available quickstarts. The table lists each quickstart name, the technologies it demonstrates, gives a brief description of the quickstart, and the level of experience required to set it up. For more detailed information about a quickstart, click on the quickstart name.</p>
<p>Some quickstarts are designed to enhance or extend other quickstarts. These are noted in the <strong>Prerequisites</strong> column. If a quickstart lists prerequisites, those must be installed or deployed before working with the quickstart.</p>
<p>Quickstarts with tutorials in the <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/Introduction/" title="Get Started Developing Applications">Get Started Developing Applications</a> are noted with two asterisks ( ** ) following the quickstart name. </p>
<table><thead><tr><th align='left'><strong>Quickstart Name</strong></th><th align='left'><strong>Demonstrated Technologies</strong></th><th align='left'><strong>Description</strong></th><th align='left'><strong>Experience Level Required</strong></th><th align='left'><strong>Prerequisites</strong></th></tr></thead><tbody><tr><td align='left'><a href='bean-validation/README.html' title='bean-validation'>bean-validation</td><td align='left'> JPA, Bean Validation</td><td align='left'>Shows how to use Arquillian to test Bean Validation</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='bmt/README.html' title='bmt'>bmt</td><td align='left'> Bean Managed Transactions (BMT), EJB</td><td align='left'>EJB that demonstrates bean-managed transactions (BMT)</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='cdi-add-interceptor-binding/README.html' title='cdi-add-interceptor-binding'>cdi-add-interceptor-binding</td><td align='left'> DeltaSpike, CDI</td><td align='left'>Creating a basic CDI extension to automatically add an interceptor binding</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='cdi-injection/README.html' title='cdi-injection'>cdi-injection</td><td align='left'> CDI</td><td align='left'>Demonstrates the use of CDI 1.0 Injection and Qualifiers with JSF as the front-end client.</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='cdi-portable-extension/README.html' title='cdi-portable-extension'>cdi-portable-extension</td><td align='left'> CDI</td><td align='left'>Creating a basic CDI extension to provide injection of fields from an XML file.</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='cdi-veto/README.html' title='cdi-veto'>cdi-veto</td><td align='left'> CDI</td><td align='left'>Creating a basic CDI extension to demonstrate vetoing beans.</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='cluster-ha-singleton/README.html' title='cluster-ha-singleton'>cluster-ha-singleton</td><td align='left'> HASingleton, JNDI, EJB</td><td align='left'>A SingletonService deployed in a JAR started by SingletonStartup and accessed by an EJB</td><td align='left'>Advanced</td><td align='left'> </td></tr><tr><td align='left'><a href='cmt/README.html' title='cmt'>cmt</td><td align='left'> Container Managed Transactions (CMT), EJB</td><td align='left'>EJB that demonstrates container-managed transactions (CMT)</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='ejb-asynchronous/README.html' title='ejb-asynchronous'>ejb-asynchronous</td><td align='left'> EJB </td><td align='left'>Demonstrates asynchronous EJB invocations.</td><td align='left'>Advanced</td><td align='left'> </td></tr><tr><td align='left'><a href='ejb-in-ear/README.html' title='ejb-in-ear'>ejb-in-ear</td><td align='left'> EAR, EJB</td><td align='left'>Packages an EJB JAR and WAR in an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='ejb-in-war/README.html' title='ejb-in-war'>ejb-in-war</td><td align='left'> JSF, WAR, EJB</td><td align='left'>Packages an EJB JAR in a WAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='ejb-remote/README.html' title='ejb-remote'>ejb-remote</td><td align='left'> EJB</td><td align='left'>Shows how to access an EJB from a remote Java client program using JNDI</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='ejb-security/README.html' title='ejb-security'>ejb-security</td><td align='left'> Security, EJB</td><td align='left'>Shows how to use Java EE Declarative Security to Control Access to EJB 3</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='forge-from-scratch/README.html' title='forge-from-scratch'>forge-from-scratch</td><td align='left'> Forge</td><td align='left'>Demonstrates how to generate a fully Java EE compliant project using nothing but JBoss Forge</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='greeter/README.html' title='greeter'>greeter</td><td align='left'> EJB, JPA, JSF, JTA, CDI</td><td align='left'>Demonstrates the use of CDI 1.0, JPA 2.0, JTA 1.1, EJB 3.1 and JSF 2.0</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='h2-console/README.html' title='h2-console'>h2-console</td><td align='left'> H2</td><td align='left'>Shows how to use the H2 console with JBoss AS</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld/README.html' title='helloworld'>helloworld</td><td align='left'> Servlet, CDI</td><td align='left'>Basic example that can be used to verify that the server is configured and running correctly</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-jms/README.html' title='helloworld-jms'>helloworld-jms</td><td align='left'> JMS</td><td align='left'>Demonstrates the use of a standalone (Java SE) JMS client</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-mdb/README.html' title='helloworld-mdb'>helloworld-mdb</td><td align='left'> EJB, MDB, JMS</td><td align='left'>Demonstrates the use of JMS 1.1 and EJB 3.1 Message-Driven Bean</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-osgi/README.html' title='helloworld-osgi'>helloworld-osgi</td><td align='left'> OSGi</td><td align='left'>Shows how to create and deploy a simple OSGi Bundle</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-rs/README.html' title='helloworld-rs'>helloworld-rs</td><td align='left'> JAX-RS, CDI</td><td align='left'>Demonstrates the use of CDI 1.0 and JAX-RS</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-singleton/README.html' title='helloworld-singleton'>helloworld-singleton</td><td align='left'> Singleton, EJB</td><td align='left'>Demonstrates the use of an EJB 3.1 Singleton Session Bean, instantiated once, maintaining state for the life of the session</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='helloworld-ws/README.html' title='helloworld-ws'>helloworld-ws</td><td align='left'> JAX-WS</td><td align='left'>Deployment of a basic JAX-WS Web service bundled in a WAR archive</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='hibernate3/README.html' title='hibernate3'>hibernate3</td><td align='left'> Hibernate 3</td><td align='left'>Example that uses Hibernate 3 for database access. Compare the code in this quickstart to the hibernate4 quickstart to see the changes needed to upgrade to Hibernate 4.</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='hibernate4/README.html' title='hibernate4'>hibernate4</td><td align='left'> Hibernate 4</td><td align='left'>This quickstart performs the same functions as the hibernate3 quickstart, but uses Hibernate 4 for database access. Compare this quickstart to the hibernate3 quickstart to see the changes needed to run with Hibernate 4..</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='inter-app/README.html' title='inter-app'>inter-app</td><td align='left'> CDI, JSF, EJB</td><td align='left'>Shows how to communicate between two applications using EJB and CDI</td><td align='left'>Advanced</td><td align='left'> </td></tr><tr><td align='left'><a href='jax-rs-client/README.html' title='jax-rs-client'>jax-rs-client</td><td align='left'> JAX-RS</td><td align='left'>Demonstrates the use an external JAX-RS RestEasy client which interacts with a JAX-RS Web service that uses CDI 1.0 and JAX-RS</td><td align='left'>Intermediate</td><td align='left'> helloworld-rs</td></tr><tr><td align='left'><a href='jta-crash-rec/README.html' title='jta-crash-rec'>jta-crash-rec</td><td align='left'> Crash Recovery, JTA</td><td align='left'>Uses Java Transaction API and JBoss Transactions to demonstrate recovery of a crashed transaction</td><td align='left'>Advanced</td><td align='left'> </td></tr><tr><td align='left'><a href='jts/README.html' title='jts'>jts</td><td align='left'> JTS</td><td align='left'>Uses Java Transaction Service (JTS) to coordinate distributed transactions</td><td align='left'>Intermediate</td><td align='left'> cmt</td></tr><tr><td align='left'><a href='jts-distributed-crash-rec/README.html' title='jts-distributed-crash-rec'>jts-distributed-crash-rec</td><td align='left'> JTS</td><td align='left'>Demonstrates recovery of distributed crashed components</td><td align='left'>Advanced</td><td align='left'> jts</td></tr><tr><td align='left'><a href='kitchensink/README.html' title='kitchensink'>kitchensink</td><td align='left'> BV, EJB, JAX-RS, JPA, JPA, JSF, CDI</td><td align='left'>An example that incorporates multiple technologies</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='kitchensink-ear/README.html' title='kitchensink-ear'>kitchensink-ear</td><td align='left'> EAR</td><td align='left'>Based on kitchensink, but deployed as an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='kitchensink-jsp/README.html' title='kitchensink-jsp'>kitchensink-jsp</td><td align='left'> JSP</td><td align='left'>Based on kitchensink, but uses a JSP for the user interface</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='kitchensink-ml/README.html' title='kitchensink-ml'>kitchensink-ml</td><td align='left'> BV, EJB, JAX-RS, JPA, JPA, JSF, CDI</td><td align='left'>A localized version of kitchensink</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='kitchensink-ml-ear/README.html' title='kitchensink-ml-ear'>kitchensink-ml-ear</td><td align='left'> EAR</td><td align='left'>A localized version of kitchensink-ear</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='log4j/README.html' title='log4j'>log4j</td><td align='left'> JBoss Modules</td><td align='left'>Demonstrates how to use modules to control class loading for 3rd party logging frameworks</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='logging-tools/README.html' title='logging-tools'>logging-tools</td><td align='left'> JBoss Logging Tools</td><td align='left'>Demonstrates the use of JBoss Logging Tools to create internationalized loggers, exceptions, and generic messages</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='mail/README.html' title='mail'>mail</td><td align='left'> CDI, JSF, JavaMail</td><td align='left'>Demonstrates the use of JavaMail</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='numberguess/README.html' title='numberguess'>numberguess</td><td align='left'> JSF, CDI</td><td align='left'>Demonstrates the use of CDI 1.0 and JSF 2.0</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='payment-cdi-event/README.html' title='payment-cdi-event'>payment-cdi-event</td><td align='left'> CDI</td><td align='left'>Demonstrates how to use CDI 1.0 Events</td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='servlet-async/README.html' title='servlet-async'>servlet-async</td><td align='left'> CDI, EJB, Servlet</td><td align='left'>Demonstrates CDI, plus asynchronous Servlets and EJBs</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='servlet-filterlistener/README.html' title='servlet-filterlistener'>servlet-filterlistener</td><td align='left'> Servlet</td><td align='left'>Demonstrates Servlet filters and listeners</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='servlet-security/README.html' title='servlet-security'>servlet-security</td><td align='left'> Security, Servlet</td><td align='left'>Demonstrates how to use Java EE declarative security to control access to Servlet 3</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='shopping-cart/README.html' title='shopping-cart'>shopping-cart</td><td align='left'> EJB</td><td align='left'>Demonstrates a stateful session bean</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='tasks/README.html' title='tasks'>tasks</td><td align='left'> Arquillian, JPA</td><td align='left'>Demonstrates testing JPA using Arquillian</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='tasks-jsf/README.html' title='tasks-jsf'>tasks-jsf</td><td align='left'> JPA, JSF</td><td align='left'>Provides a JSF 2.0 as view layer for the tasks quickstart</td><td align='left'>Intermediate</td><td align='left'> tasks</td></tr><tr><td align='left'><a href='tasks-rs/README.html' title='tasks-rs'>tasks-rs</td><td align='left'> JAX-RS, JPA</td><td align='left'>Demonstrates how to use JAX-RS and JPA together</td><td align='left'>Intermediate</td><td align='left'> tasks</td></tr><tr><td align='left'><a href='temperature-converter/README.html' title='temperature-converter'>temperature-converter</td><td align='left'> EJB</td><td align='left'>Demonstrates a stateless session bean </td><td align='left'>Beginner</td><td align='left'> </td></tr><tr><td align='left'><a href='template/README.html' title='template'>template</td><td align='left'> (list technologies used here)</td><td align='left'>(a brief description of the quickstart to appear in the table )</td><td align='left'>[one of the following: Beginner, Intermediate, or Advanced]</td><td align='left'> (list any quickstarts that must be deployed prior to running this one)</td></tr><tr><td align='left'><a href='wicket-ear/README.html' title='wicket-ear'>wicket-ear</td><td align='left'> JPA, Apache Wicket</td><td align='left'>Demonstrates how to use the Wicket Framework 1.5 with the JBoss server using the Wicket-Stuff Java EE integration, packaged as an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='wicket-war/README.html' title='wicket-war'>wicket-war</td><td align='left'> JPA, Apache Wicket</td><td align='left'>Demonstrates how to use the Wicket Framework 1.5 with the JBoss server using the Wicket-Stuff Java EE integration packaged as a WAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='wsat-simple/README.html' title='wsat-simple'>wsat-simple</td><td align='left'> JAX-WS, WS-AT</td><td align='left'>Deployment of a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service bundled in a WAR archive</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='wsba-coordinator-completion-simple/README.html' title='wsba-coordinator-completion-simple'>wsba-coordinator-completion-simple</td><td align='left'> JAX-WS, WS-BA</td><td align='left'> Deployment of a WS-BA (WS-BusinessActivity) enabled JAX-WS Web service bundled in a WAR archive (Participant Completion protocol)</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='wsba-participant-completion-simple/README.html' title='wsba-participant-completion-simple'>wsba-participant-completion-simple</td><td align='left'> JAX-WS, WS-BA</td><td align='left'>Deployment of a WS-BA (WS-BusinessActivity) enabled JAX-WS Web service bundled in a war archive (Coordinator Completion protocol)</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='xml-dom4j/README.html' title='xml-dom4j'>xml-dom4j</td><td align='left'> JSF, Servlet, DOM4J</td><td align='left'>Demonstrates how to upload an XML file and parse it using 3rd party XML parsing libraries</td><td align='left'>Intermediate</td><td align='left'> </td></tr><tr><td align='left'><a href='xml-jaxp/README.html' title='xml-jaxp'>xml-jaxp</td><td align='left'> DOM, SAX, Servlet, JAXP</td><td align='left'>Upload, validation and parsing of XML using SAX or DOM</td><td align='left'>Intermediate</td><td align='left'> </td></tr></table></table>
<p><a id="suggestedApproach"></a></p>
<h2 id="toc_3">Suggested Approach to the Quickstarts </h2>
<p>We suggest you approach the quickstarts as follows:</p>
<ul>
<li>Regardless of your level of expertise, we suggest you start with the <strong>helloworld</strong> quickstart. It is the simplest example and is an easy way to prove your server is configured and started correctly.</li>
<li>If you are a beginner or new to JBoss, start with the quickstarts labeled <strong>Beginner</strong>, then try those marked as <strong>Intermediate</strong>. When you are comfortable with those, move on to the <strong>Advanced</strong> quickstarts.</li>
<li>Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, be sure to deploy and test it before looking at the expanded version.</li>
</ul>
<p><a id="systemrequirements"></a></p>
<h2 id="toc_4">System Requirements </h2>
<p>To run these quickstarts with the provided build scripts, you need the following:</p>
<ol>
<li><p>Java 1.6, to run JBoss AS and Maven. You can choose from the following:</p>
<ul>
<li>OpenJDK</li>
<li>Oracle Java SE</li>
<li>Oracle JRockit</li>
</ul></li>
<li><p>Maven 3.0.0 or newer, to build and deploy the examples</p>
<ul>
<li>If you have not yet installed Maven, see the <a href="http://maven.apache.org/guides/getting-started/index.html">Maven Getting Started Guide</a> for details.</li>
<li><p>If you have installed Maven, you can check the version by typing the following in a command line:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="o">--</span><span class="n">version</span>
</pre>
</div></li>
</ul></li>
<li><p>The JBoss Enterprise Application Platform 6 distribution ZIP or the JBoss AS 7 distribution ZIP.</p>
<ul>
<li>For information on how to install and run JBoss, refer to the product documentation.</li>
</ul></li>
<li><p>You can also use <a href="#useeclipse">JBoss Developer Studio or Eclipse</a> to run the quickstarts. </p></li>
</ol>
<p><a id="mavenconfiguration"></a></p>
<h2 id="toc_5">Configure Maven </h2>
<p>Maven configuration is dependent on whether you are running JBoss Enterprise Application Platform 6 or JBoss AS7.</p>
<p><a id="eap6mavenconfig"></a></p>
<h3 id="toc_6">Configure Maven for JBoss Enterprise Application Platform 6</h3>
<p>If you are using the JBoss Enterprise Application Platform 6 distribution, you need to download and configure the Maven repository.</p>
<ol>
<li><p>Download the JBoss Enterprise Application Platform 6 Maven repository distribution ZIP and unzip it into a directory of your choice.</p></li>
<li><p>Modify the <code>example-settings.xml</code> file located in the root of your quickstarts folder. </p>
<ul>
<li>Replace all instances of <code>path/to/jboss-eap/repo</code> within <code>file:///path/to/jboss-eap/repo</code> with the fully qualified path to the Maven repository you unzipped in the previous step.</li>
<li><p>Be sure to use 3 forward slashes after <code>file:</code>: 2 for the protocol and 1 for the fully qualified path. For example:</p>
<div class="highlight"><pre><span class="n">file</span><span class="p">:</span><span class="o">///</span><span class="n">home</span><span class="o">/</span><span class="n">username</span><span class="o">/</span><span class="n">Quickstarts</span><span class="o">/</span><span class="n">jboss</span><span class="o">-</span><span class="n">eap</span><span class="o">-</span>6<span class="p">.</span>0<span class="o">-</span><span class="n">quickstarts</span>
</pre>
</div></li>
</ul></li>
<li><p>Configure the Maven user settings. </p>
<ul>
<li><em>Note:This is the recommended approach and is required if you are running the quickstarts in JBoss Developer Studio.</em></li>
<li><p>Look for the <code>settings.xml</code> file in the <code>${user.home}/.m2/</code> directory. For example:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="p">:</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="o">\</span><span class="n">Documents</span> <span class="n">and</span> <span class="n">Settings</span><span class="o">\</span><span class="n">USER_NAME</span><span class="o">\</span><span class="p">.</span><span class="n">m2</span><span class="o">\</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span> <span class="n">or</span> <span class="o">\</span><span class="n">Users</span><span class="o">\</span><span class="n">USER_NAME</span><span class="o">\</span><span class="p">.</span><span class="n">m2</span><span class="o">\</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
<li><p>If you have an existing <code>settings.xml</code> file, modify it with the configuration information from the <code>example-settings.xml</code> file.</p></li>
<li><p>If there is no <code>settings.xml</code> file, copy the modified <code>example-settings.xml</code> file to the <code>m2</code> directory for your operating system and rename it to <code>settings.xml</code>.</p></li>
</ul></li>
<li><p>If you choose not to configure the <code>settings.xml</code> file described in the previous step, you must append <code>-s PATH_TO_QUICKSTARTS/example-settings.xml</code> to every Maven command. </p>
<ul>
<li><em>Note: This only valid only when you run the quickstarts using the command line.</em><br/></li>
<li><p>The following is an example of a deployment passing the Maven settings using the command line:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">deploy</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ul></li>
</ol>
<p><a id="as7mavenconfig"></a></p>
<h3 id="toc_7">Configure Maven for JBoss AS 7</h3>
<p>If you are using the JBoss AS 7 Quickstart distribution, the community artifacts are available in the Maven central repository so no additional configuration is needed.</p>
<h3 id="toc_8">Maven Profiles</h3>
<p>Profiles are used by Maven to customize the build environment. The <code>pom.xml</code> in the root of the quickstart directory defines the following profiles:</p>
<ul>
<li>The <code>default</code> profile defines the list of modules or quickstarts that require nothing but JBoss Enterprise Application Platform or JBoss AS .</li>
<li>The <code>requires-postgres</code> profile lists the quickstarts that require PostgreSQL to be running when the quickstart is deployed.</li>
<li>The <code>complex-dependency</code> profile lists quickstarts that require manual configuration that can not be automated.</li>
<li>The <code>requires-full</code> profile lists quickstarts the require you start the server using the full profile.</li>
<li>The <code>requires-xts</code> profile lists quickstarts the require you start the server using the xts profile.</li>
<li>The <code>non-maven</code> profile lists quickstarts that do not require Maven, for example, quickstarts that depend on deployment of other quickstarts or those that use other Frameworks such as Forge.</li>
</ul>
<p><a id="runningquickstarts"></a></p>
<h2 id="toc_9">Run the Quickstarts </h2>
<p>The root folder of each individual quickstart contains a README file with specific details on how to build and run the example. In most cases you do the following:</p>
<ul>
<li><a href="#startjboss">Start the JBoss server</a></li>
<li><a href="#buildanddeploy">Build and deploy the quickstart</a></li>
</ul>
<p><a id="startjboss"></a></p>
<h3 id="toc_10">Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server</h3>
<p>Before you deploy a quickstart, in most cases you need a running server. A few of the Arquillian tests do not require a running server. This will be noted in the README for that quickstart. </p>
<p>The JBoss server can be started a few different ways.</p>
<ul>
<li><a href="#startserverweb">Start the JBoss Server With the <em>web</em> profile</a>: This is the default configuration. It defines minimal subsystems and services.</li>
<li><a href="#startserverfull">Start the JBoss Server with the <em>full</em> profile</a>: This profile configures many of the commonly used subsystems and services.</li>
<li><a href="#startservercustom">Start the JBoss Server with a custom configuration</a>: Custom configuration parameters can be specified on the command line when starting the server.<br/></li>
</ul>
<p>The README for each quickstart will specify which configuration is required to run the example.</p>
<p><a id="startserverweb"></a></p>
<h4 id="toc_11">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with the Web Profile</h4>
<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the server with the web profile:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span>
</pre>
</div></li>
</ol>
<p><a id="startserverfull"></a></p>
<h4 id="toc_12">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with the Full Profile</h4>
<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the server with the full profile:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ol>
<p><a id="startservercustom"></a></p>
<h4 id="toc_13">Start JBoss Enterprise Application Platform 6 or JBoss AS 7 with Custom Configuration Options</h4>
<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the server. Replace the CUSTOM_OPTIONS with the custom optional parameters specified in the quickstart.</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="n">CUSTOM_OPTIONS</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="n">CUSTOM_OPTIONS</span>
</pre>
</div></li>
</ol>
<p><a id="buildanddeploy"></a></p>
<h3 id="toc_14">Build and Deploy the Quickstarts</h3>
<p>Review the README file in the root folder of the quickstart for specific details on how to build and run the example. In most cases you do the following:</p>
<ol>
<li>The command used to build the quickstart depends on the individual quickstart, the server version, and how you configured Maven.
<ul>
<li>If you are running JBoss Enterprise Application Platform 6 and did not configure the Maven user settings described in <a href="#eap6mavenconfig">Configure Maven for JBoss Enterprise Application Platform 6</a> above, you need to specify command line arguments. </li>
<li>If you are running JBoss AS 7, it uses community artifacts available in the Maven central repository, so command line arguments are not usually required. </li>
</ul></li>
<li>See the README file in each individual quickstart folder for specific details and information on how to run and access the example.</li>
</ol>
<h4 id="toc_15">Build the Quickstart Archive</h4>
<p>In some cases, you may want to build the application to test for compile errors or view the contents of the archive. </p>
<ol>
<li>Open a command line and navigate to the root directory of the quickstart you want to build.</li>
<li><p>Use this command if you only want to build the archive, but not deploy it:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">JBoss</span> <span class="n">AS</span> 7 <span class="n">or</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">package</span>
<span class="n">For</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">NOT</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">package</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ol>
<h4 id="toc_16">Build and Deploy the Quickstart Archive</h4>
<ol>
<li>Make sure you <a href="#startjboss">start the JBoss Server</a> as described in the README.</li>
<li>Open a command line and navigate to the root directory of the quickstart you want to run.</li>
<li><p>Use this command to build and deploy the archive:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">JBoss</span> <span class="n">AS</span> 7 <span class="n">or</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">package</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">deploy</span>
<span class="n">For</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">NOT</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">package</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">deploy</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ol>
<h4 id="toc_17">Undeploy an Archive</h4>
<p>The command to undeploy the quickstart is simply: </p>
<div class="highlight"><pre> <span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">undeploy</span>
</pre>
</div>
<p><a id="verifyall"></a></p>
<h3 id="toc_18">Verify the Quickstarts Build and Deploy with One Command</h3>
<hr/>
<p>You can verify the quickstarts build and deploy using one command. However, quickstarts that have complex dependencies must be skipped. For example, the <em>jax-rs-client</em> quickstart is a RESTEasy client that depends on the deployment of the <em>helloworld-rs</em> quickstart. As noted above, the root <code>pom.xml</code> file defines a <code>complex-dependencies</code> profile to exclude these quickstarts from the root build process. </p>
<p>To build and test the quickstarts:</p>
<ol>
<li>Do not start the server.</li>
<li>Open a command line and navigate to the root directory of the quickstarts.</li>
<li><p>Use this command to build, deploy, and undeploy the quickstarts that do not have complex dependencies:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">JBoss</span> <span class="n">AS</span> 7 <span class="n">or</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pdefault</span><span class="p">,</span>!<span class="nb">complex</span><span class="o">-</span><span class="n">dependencies</span>
<span class="n">For</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">NOT</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pdefault</span><span class="p">,</span>!<span class="nb">complex</span><span class="o">-</span><span class="n">dependencies</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ol>
<p>This command iterates through the quickstarts, excluding those with complex dependencies, and does the following:</p>
<ul>
<li>Builds the quickstart</li>
<li>Starts the server</li>
<li>Deploys the quickstart</li>
<li>Undeploys the quickstart</li>
<li>Stops the server</li>
</ul>
<p><a id="undeployall"></a></p>
<h3 id="toc_19">Undeploy the Deployed Quickstarts with One Command</h3>
<hr/>
<p>To undeploy the quickstarts from the root of the quickstart folder, you must pass the argument <code>-fae</code> (fail at end) on the command line. This allows the command to continue past quickstarts that fail due to complex dependencies and quickstarts that only have Arquillian tests and do not deploy archives to the server.</p>
<p>You can undeploy quickstarts using the following procedure:</p>
<ol>
<li>Start the server.</li>
<li>Open a command line and navigate to the root directory of the quickstarts.</li>
<li><p>Use this command to undeploy any deployed quickstarts:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">JBoss</span> <span class="n">AS</span> 7 <span class="n">or</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">undeploy</span> <span class="o">-</span><span class="n">fae</span>
<span class="n">For</span> <span class="n">JBoss</span> <span class="n">Enterprise</span> <span class="n">Application</span> <span class="n">Platform</span> 6 <span class="p">(</span><span class="n">Maven</span> <span class="n">user</span> <span class="n">settings</span> <span class="n">NOT</span> <span class="n">configured</span><span class="p">):</span>
<span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="p">:</span><span class="n">undeploy</span> <span class="o">-</span><span class="n">fae</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
</ol>
<p>To undeploy any quickstarts that fail due to complex dependencies, follow the undeploy procedure described in the quickstart's README file.</p>
<p><a id="arquilliantests"></a></p>
<h3 id="toc_20">Run the Arquillian Tests</h3>
<hr/>
<p>Some of the quickstarts provide Arquillian tests. By default, these tests are configured to be skipped, as Arquillian tests require the use of a container. </p>
<p>You can run these tests using either a remote or managed container. The quickstart README should tell you what you should expect to see in the console output and server log when you run the test.</p>
<p><a id="testremote"></a></p>
<ol>
<li><p>Test the quickstart on a Remote Server</p>
<ul>
<li>A remote container requires you start the JBoss Enterprise Application Platform 6 or JBoss AS 7 server before running the test. <a href="#startjboss">Start the JBoss Server</a> as described in the quickstart README file.</li>
<li><p>Run the test goal with the following profile activated:</p>
<p>For JBoss AS 7 or JBoss Enterprise Application Platform 6 (Maven user settings configured): </p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">remote</span>
</pre>
</div>
<p>For JBoss Enterprise Application Platform 6 (Maven user settings NOT configured): </p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">remote</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div>
<p><a id="testmanaged"></a></p></li>
</ul></li>
<li><p>Test the quickstart on Managed Server</p>
<p><em>Note: This test requires that your server is not running. Arquillian will start the container for you, however, you must first let it know where to find the remote JBoss container.</em></p>
<ul>
<li>Open the test/resources/arquillian.xml file located in the quickstart directory. </li>
<li><p>Find the configuration for the remote JBoss container. It should look like this:</p>
<div class="highlight"><pre><span class="nt"><container</span> <span class="na">qualifier=</span><span class="s">"jboss"</span> <span class="na">default=</span><span class="s">"true"</span><span class="nt">></span>
<span class="c"><!-- If you want to use the JBOSS_HOME environment variable, just delete the jbossHome property --></span>
<span class="nt"><configuration></span>
<span class="nt"><property</span> <span class="na">name=</span><span class="s">"jbossHome"</span><span class="nt">></span>/path/to/jboss/as<span class="nt"></property></span>
<span class="nt"></configuration></span>
<span class="nt"></container></span>
</pre>
</div></li>
<li><p>Find the “jbossHome” property and replace the “/path/to/jboss/as” value with the actual path to your JBoss Enterprise Application Platform 6 or JBoss AS 7 server.</p></li>
<li><p>Run the test goal with the following profile activated:</p>
<p>For JBoss Enterprise Application Platform 6 (Maven user settings NOT configured): </p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">managed</span> <span class="o">-</span><span class="n">s</span> <span class="n">PATH_TO_QUICKSTARTS</span><span class="o">/</span><span class="n">example</span><span class="o">-</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div>
<p>For JBoss AS 7 or JBoss Enterprise Application Platform 6 (Maven user settings configured): </p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">managed</span>
</pre>
</div></li>
</ul></li>
</ol>
<p><a id="useeclipse"></a></p>
<h2 id="toc_21">Use JBoss Developer Studio or Eclipse to Run the Quickstarts</h2>
<p>You can also deploy the quickstarts from Eclipse using JBoss tools. For more information on how to set up Maven and the JBoss tools, refer to the <a href="https://access.redhat.com/knowledge/docs/JBoss_Enterprise_Application_Platform/">JBoss Enterprise Application Platform 6 Development Guide</a> or <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/Introduction/" title="Get Started Developing Applications">Get Started Developing Applications</a>.</p>
<p><a id="optionalcomponents"></a></p>
<h2 id="toc_22">Optional Components </h2>
<p>The following components are needed for only a small subset of the quickstarts. Do not install or configure them unless the quickstart requires it.</p>
<ul>
<li><p><a href="#adduser">Add a User</a>: Add a Management or Application user for the quickstarts that run in a secured mode.</p></li>
<li><p><a href="#postgresql">Install and Configure the PostgreSQL Database</a>: The PostgreSQL database is used for the distributed transaction quickstarts.</p></li>
<li><p><a href="#byteman">Install and Configure Byteman</a>: This tool is used to demonstrate crash recovery for distributed transaction quickstarts.</p></li>
</ul>
<p><a id="adduser"></a></p>
<h3 id="toc_23">Add a Management or Application User</h3>
<p>By default, JBoss Enterprise Application Platform 6 and JBoss AS 7 are now distributed with security enabled for the management interfaces. A few of the quickstarts use these management interfaces and require that you create a management or application user to access the running application. A script is provided in the <code>JBOSS_HOME/bin</code> directory for that purpose.</p>
<p>The following procedures describe how to add a user with the appropriate permissions to run the quickstarts that depend on them.</p>
<p><a id="addmanagementuser"></a></p>
<h4 id="toc_24">Add an Management User</h4>
<ol>
<li>Open a command line</li>
<li><p>Type the command for your operating system</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">bat</span>
</pre>
</div></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">What</span> <span class="n">type</span> <span class="n">of</span> <span class="n">user</span> <span class="n">do</span> <span class="n">you</span> <span class="n">wish</span> <span class="n">to</span> <span class="n">add</span>?
<span class="n">a</span><span class="p">)</span> <span class="n">Management</span> <span class="n">User</span> <span class="p">(</span><span class="n">mgmt</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="k">properties</span><span class="p">)</span>
<span class="n">b</span><span class="p">)</span> <span class="n">Application</span> <span class="n">User</span> <span class="p">(</span><span class="n">application</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="k">properties</span><span class="p">)</span>
<span class="p">(</span><span class="n">a</span><span class="p">):</span>
</pre>
</div>
<p>At the prompt, press enter to use the default Management User</p></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">Enter</span> <span class="n">the</span> <span class="n">details</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">user</span> <span class="n">to</span> <span class="n">add</span><span class="p">.</span>
<span class="n">Realm</span> <span class="p">(</span><span class="n">ManagementRealm</span><span class="p">)</span> <span class="p">:</span>
</pre>
</div>
<p>If the quickstart README specifies a realm, type it here. Otherwise, press enter to use the default <code>ManagementRealm</code>. </p></li>
<li><p>When prompted, enter the following</p>
<div class="highlight"><pre><span class="n">Username</span> <span class="o">:</span> <span class="n">admin</span>
<span class="n">Password</span> <span class="o">:</span> <span class="o">(</span><span class="n">choose</span> <span class="n">a</span> <span class="n">password</span> <span class="k">for</span> <span class="n">the</span> <span class="n">admin</span> <span class="n">user</span><span class="o">)</span>
</pre>
</div>
<p>Repeat the password</p></li>
<li><p>Choose yes for the remaining promts.</p></li>
</ol>
<p><a id="addapplicationuser"></a></p>
<h4 id="toc_25">Add an Application User</h4>
<ol>
<li>Open a command line</li>
<li><p>Type the command for your operating system</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">bat</span>
</pre>
</div></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">What</span> <span class="n">type</span> <span class="n">of</span> <span class="n">user</span> <span class="n">do</span> <span class="n">you</span> <span class="n">wish</span> <span class="n">to</span> <span class="n">add</span>?
<span class="n">a</span><span class="p">)</span> <span class="n">Management</span> <span class="n">User</span> <span class="p">(</span><span class="n">mgmt</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="k">properties</span><span class="p">)</span>
<span class="n">b</span><span class="p">)</span> <span class="n">Application</span> <span class="n">User</span> <span class="p">(</span><span class="n">application</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="k">properties</span><span class="p">)</span>
<span class="p">(</span><span class="n">a</span><span class="p">):</span>
</pre>
</div>
<p>At the prompt, type: b</p></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">Enter</span> <span class="n">the</span> <span class="n">details</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">user</span> <span class="n">to</span> <span class="n">add</span><span class="p">.</span>
<span class="n">Realm</span> <span class="p">(</span><span class="n">ApplicationRealm</span><span class="p">)</span> <span class="p">:</span>
</pre>
</div>
<p>If the quickstart README specifies a realm, type it here. Otherwise, press enter to use the default <code>ApplicationRealm</code>. </p></li>
<li><p>When prompted, enter the the Username and Passord. If the quickstart README specifies a Username nad Password, enter them here. Otherwise, use the default Username <code>quickstartUser</code> and Password <code>quickstartPassword</code>.</p>
<div class="highlight"><pre><span class="n">Username</span> <span class="o">:</span> <span class="n">quickstartUser</span>
<span class="n">Password</span> <span class="o">:</span> <span class="n">quickstartPassword</span>
</pre>
</div></li>
<li><p>At the next prompt, you will be asked “What roles do you want this user to belong to?”. If the quickstart README specifies a role to use, enter that here. Otherwise, type the role: <code>guest</code></p></li>
</ol>
<p><a id="postgresql"></a></p>
<h3 id="toc_26">Install and Configure the PostgreSQL Database</h3>
<p>Some of the quickstarts require the PostgreSQL database. This section describes how to install and configure the database for use with these quickstarts.</p>
<h4 id="toc_27">Download and Install PostgreSQL 9.1.2</h4>
<p>The following is a brief overview of how to install PostgreSQL. More detailed instructions for installing and starting PostgreSQL can be found on the internet.</p>
<p><em>Note</em>: Although the database only needs to be installed once, to help partition each quickstart we recommend using a separate database per quickstart. Where you see QUICKSTART_DATABASENAME, you should replace that with the name provided in the particular quickstart's README</p>
<h5 id="toc_28">Linux Instructions</h5>
<p>Use the following steps to install and configure PostgreSQL on Linux. You can download the PDF installation guide here: <a href="http://yum.postgresql.org/files/PostgreSQL-RPM-Installation-PGDG.pdf">http://yum.postgresql.org/files/PostgreSQL-RPM-Installation-PGDG.pdf</a></p>
<ol>
<li><p>Install PostgreSQL</p>
<ul>
<li>The yum install instructions for PostgreSQL can be found here: <a href="http://yum.postgresql.org/howtoyum.php/">http://yum.postgresql.org/howtoyum.php/</a></li>
<li>Download the repository RPM from here: <a href="http://yum.postgresql.org/repopackages.php/">http://yum.postgresql.org/repopackages.php/</a></li>
<li><p>To install PostgreSQL, in a command line type: </p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">rpm</span> <span class="o">-</span><span class="n">ivh</span> <span class="n">pgdg</span><span class="o">-</span><span class="n">fedora91</span><span class="o">-</span>9<span class="p">.</span>1<span class="o">-</span>4<span class="p">.</span><span class="n">noarch</span><span class="p">.</span><span class="n">rpm</span>
</pre>
</div></li>
<li><p>Edit your distributions package manager definitions to exclude PostgreSQL. See the “important note” on <a href="http://yum.postgresql.org/howtoyum.php/">http://yum.postgresql.org/howtoyum.php/</a> for details on how to exclude postgresql packages from the repository of the distribution.</p></li>
<li><p>Install <em>postgresql91</em> and <em>postgres91-server</em> by typing the following in a command line:</p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">yum</span> <span class="n">install</span> <span class="n">postgresql91</span> <span class="n">postgresql91</span><span class="o">-</span><span class="n">server</span>
</pre>
</div></li>
</ul></li>
<li><p>Set a password for the <em>postgres</em> user</p>
<ul>
<li><p>In a command line, login as root and set the postgres password by typing the following commands: </p>
<div class="highlight"><pre><span class="n">su</span>
<span class="n">passwd</span> <span class="n">postgres</span>
</pre>
</div></li>
<li><p>Choose a password</p></li>
</ul></li>
<li><p>Configure the test database</p>
<ul>
<li><p>In a command line, login as the <em>postgres</em> user, navigate to the postgres directory, and initialize the database by typing:</p>
<div class="highlight"><pre><span class="n">su</span> <span class="n">postgres</span>
<span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">pgsql</span><span class="o">-</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">bin</span><span class="o">/</span>
<span class="o">./</span><span class="n">initdb</span> <span class="o">-</span><span class="n">D</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">pgsql</span><span class="o">/</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">data</span>
</pre>
</div></li>
<li><p>Modify the <code>/var/lib/pgsql/9.1/data/pg_hba.conf</code> file to set the authentication scheme to password for tcp connections. Modify the line following the IPv4 local connections: change trust to to password. The line should look like this:</p>
<div class="highlight"><pre><span class="n">host</span> <span class="n">all</span> <span class="n">all</span> 127<span class="p">.</span>0<span class="p">.</span>0<span class="p">.</span>1<span class="o">/</span>32 <span class="n">password</span>
</pre>
</div></li>
<li><p>Modify the <code>/var/lib/pgsql/9.1/data/postgresql.conf</code> file to allow prepared transactions and reduce the maximum number of connections</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="p">=</span> 10
<span class="n">max_connections</span> <span class="p">=</span> 10
</pre>
</div></li>
</ul></li>
<li><p>Start the database server </p>
<ul>
<li><p>In the same command line, type the following:</p>
<div class="highlight"><pre><span class="o">./</span><span class="n">postgres</span> <span class="o">-</span><span class="n">D</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">pgsql</span><span class="o">/</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">data</span>
</pre>
</div></li>
<li><p>Note, this command does not release the command line. In the next step you need to open a new command line.</p></li>
</ul></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>
<ul>
<li><p>Open a new command line and login again as the <em>postgres</em> user, navigate to the postgres directory, and create the database by typing the following:</p>
<div class="highlight"><pre><span class="n">su</span> <span class="n">postgres</span>
<span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">pgsql</span><span class="o">-</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">bin</span><span class="o">/</span>
<span class="o">./</span><span class="n">createdb</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre>
</div></li>
</ul></li>
</ol>
<h5 id="toc_29">Mac OS X Instructions</h5>
<p>The following are the steps to install and start PostgreSQL on Mac OS X. Note that this guide covers only 'One click installer' option.</p>
<ol>
<li>Install PostgreSQL using Mac OS X One click installer: <a href="http://www.postgresql.org/download/macosx/">http://www.postgresql.org/download/macosx/</a></li>
<li><p>Allow prepared transactions:</p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">su</span> <span class="o">-</span> <span class="n">postgres</span>
</pre>
</div>
<ul>
<li><p>Edit <code>/Library/PostgreSQL/9.1/data/postgresql.conf</code> to allow prepared transactions</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="p">=</span> 10
</pre>
</div></li>
</ul></li>
<li><p>Start the database server </p>
<div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">Library</span><span class="o">/</span><span class="n">PostgreSQL</span><span class="o">/</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">bin</span>
<span class="o">./</span><span class="n">pg_ctl</span> <span class="o">-</span><span class="n">D</span> <span class="p">.</span><span class="o">./</span><span class="n">data</span> <span class="n">restart</span>
</pre>
</div></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>
<div class="highlight"><pre><span class="o">./</span><span class="n">createdb</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre>
</div></li>
<li><p>Verify that everything works. As the <em>postgres</em> user using the password you specified in Step 1, type the following:</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">Library</span><span class="o">/</span><span class="n">PostgreSQL</span><span class="o">/</span>9<span class="p">.</span>1<span class="o">/</span><span class="n">bin</span>
<span class="o">./</span><span class="n">psql</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span>
</pre>
</div>
<p>At the prompt</p>
<div class="highlight"><pre><span class="n">start</span> <span class="n">transaction</span><span class="p">;</span>
<span class="n">select</span> 1<span class="p">;</span>
<span class="n">prepare</span> <span class="n">transaction</span> <span class="s">'foobar'</span><span class="p">;</span>
<span class="n">commit</span> <span class="n">prepared</span> <span class="s">'foobar'</span><span class="p">;</span>
</pre>
</div></li>
</ol>
<h5 id="toc_30">Windows Instructions</h5>
<p>Use the following steps to install and configure PostgreSQL on Windows:</p>
<ol>
<li>Install PostgreSQL using the Windows installer: <a href="http://www.postgresql.org/download/windows/">http://www.postgresql.org/download/windows/</a></li>
<li><p>Enable password authentication and configure PostgreSQL to allow prepared transactions</p>
<ul>
<li><p>Modify the <code>C:\Program Files\PostgreSQL\9.1\data\pg_hba.conf</code> file to set the authentication scheme to password for tcp connections. Modify the line following the IPv4 local connections: change trust to to password. The line should look like this:</p>
<div class="highlight"><pre><span class="n">host</span> <span class="n">all</span> <span class="n">all</span> 127<span class="p">.</span>0<span class="p">.</span>0<span class="p">.</span>1<span class="o">/</span>32 <span class="n">password</span>`
</pre>
</div></li>
<li><p>Modify the <code>C:\Program Files\PostgreSQL\9.1\data\postgresql.conf</code> file to allow prepared transactions and reduce the maximum number of connections:</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="p">=</span> 10
<span class="n">max_connections</span> <span class="p">=</span> 10
</pre>
</div></li>
</ul></li>
<li><p>Start the database server</p>
<ul>
<li>Choose Start -> All Programs -> PostgreSQL 9.1\pgAdmin III</li>
<li>Server Groups -> Servers (1) -> PostgreSQL 9.1 (localhost:5432)</li>
<li>Right click -> Stop Service</li>
<li>Right click -> Start Service</li>
</ul></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>
<ul>
<li><p>Open a command line</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="n">C</span><span class="p">:</span><span class="o">\</span><span class="n">Program</span> <span class="n">Files</span><span class="o">\</span><span class="n">PostgreSQL</span><span class="o">\</span>9<span class="p">.</span>1<span class="o">\</span><span class="n">bin</span><span class="o">\</span>
<span class="n">createdb</span><span class="p">.</span><span class="n">exe</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre>
</div></li>
</ul></li>
</ol>
<h4 id="toc_31">Create a Database User</h4>
<ol>
<li> Make sure the PostgreSQL bin directory is in your PATH.
<ul>
<li>Open a command line and change to the root directory
psql</li>
<li>If you see an error that 'psql' is not a recognized command, you need to add the PostgreSQL bin directory to your PATH environment variable. </li>
</ul></li>
<li><p>As the <em>postgres</em> user, start the PostgreSQL interactive terminal by typing the following command:</p>
<div class="highlight"><pre><span class="n">psql</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span>
</pre>
</div></li>
<li><p>Create the user sa with password sa and all privileges on the database by typing the following commands (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart):</p>
<div class="highlight"><pre><span class="n">create</span> <span class="n">user</span> <span class="n">sa</span> <span class="n">with</span> <span class="n">password</span> <span class="s">'sa'</span><span class="p">;</span>
<span class="n">grant</span> <span class="n">all</span> <span class="n">privileges</span> <span class="n">on</span> <span class="n">database</span> "<span class="n">QUICKSTART_DATABASENAME</span>" <span class="n">to</span> <span class="n">sa</span><span class="p">;</span>
<span class="o">\</span><span class="n">q</span>
</pre>
</div></li>
<li><p>Test the connection to the database using the TCP connection as user <code>'sa'</code>. This validates that the change to <code>pg_hba.conf</code> was made correctly: </p>
<div class="highlight"><pre><span class="n">psql</span> <span class="o">-</span><span class="n">h</span> 127<span class="p">.</span>0<span class="p">.</span>0<span class="p">.</span>1 <span class="o">-</span><span class="n">U</span> <span class="n">sa</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre>
</div></li>
</ol>
<p><a id="addpostgresqlmodule"></a></p>
<h4 id="toc_32">Add the PostgreSQL Module to the JBoss server</h4>
<ol>
<li>Create the following directory structure: <code>JBOSS_HOME/modules/org/postgresql/main</code></li>
<li>Download the JBDC driver from <a href="http://jdbc.postgresql.org/download.html">http://jdbc.postgresql.org/download.html</a> and copy it into the directory you created in the previous step.</li>
<li><p>In the same directory, create a file named module.xml. Copy the following contents into the file:</p>
<div class="highlight"><pre><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="nt"><module</span> <span class="na">xmlns=</span><span class="s">"urn:jboss:module:1.0"</span> <span class="na">name=</span><span class="s">"org.postgresql"</span><span class="nt">></span>
<span class="nt"><resources></span>
<span class="nt"><resource-root</span> <span class="na">path=</span><span class="s">"postgresql-9.1-901.jdbc4.jar"</span><span class="nt">/></span>
<span class="nt"></resources></span>
<span class="nt"><dependencies></span>
<span class="nt"><module</span> <span class="na">name=</span><span class="s">"javax.api"</span><span class="nt">/></span>
<span class="nt"><module</span> <span class="na">name=</span><span class="s">"javax.transaction.api"</span><span class="nt">/></span>
<span class="nt"></dependencies></span>
<span class="nt"></module></span>
</pre>
</div></li>
</ol>
<p><a id="addpostgresqldriver"></a></p>
<h4 id="toc_33">Add the Driver Configuration to the JBoss server</h4>
<p>You can configure the driver using the JBoss CLI or by manually editing the configuration file.</p>
<h5 id="toc_34">Configure the Driver Using the JBoss CLI</h5>
<ol>
<li><p>Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server by typing the following: </p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre>
</div></li>
<li><p>To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">bin</span><span class="o">/</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">sh</span> <span class="o">--</span><span class="n">connect</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">bin</span><span class="o">\</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">bat</span> <span class="o">--</span><span class="n">connect</span>
</pre>
</div></li>
<li><p>At the prompt, type the following:</p>
<div class="highlight"><pre><span class="p">[</span><span class="n">standalone</span><span class="p">@</span><span class="n">localhost</span><span class="p">:</span>9999 <span class="o">/</span><span class="p">]</span> <span class="o">/</span><span class="n">subsystem</span><span class="p">=</span><span class="n">datasources</span><span class="o">/</span><span class="n">jdbc</span><span class="o">-</span><span class="n">driver</span><span class="p">=</span><span class="n">postgresql</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="n">driver</span><span class="o">-</span><span class="n">name</span><span class="p">=</span><span class="n">postgresql</span><span class="p">,</span><span class="n">driver</span><span class="o">-</span><span class="n">module</span><span class="o">-</span><span class="n">name</span><span class="p">=</span><span class="n">org</span><span class="p">.</span><span class="n">postgresql</span><span class="p">,</span><span class="n">driver</span><span class="o">-</span><span class="n">xa</span><span class="o">-</span><span class="n">datasource</span><span class="o">-</span><span class="n">class</span><span class="o">-</span><span class="n">name</span><span class="p">=</span><span class="n">org</span><span class="p">.</span><span class="n">postgresql</span><span class="p">.</span><span class="n">xa</span><span class="p">.</span><span class="n">PGXADataSource</span><span class="p">)</span>
</pre>
</div></li>
</ol>
<h5 id="toc_35">Configure the Driver Manually</h5>
<ol>
<li> Backup the file: <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code></li>
<li> Open the <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code> file in an editor and locate the subsystem <code>urn:jboss:domain:datasources:1.0</code>. </li>
<li><p>Add the following driver to the <code><drivers></code> section that subsystem. You may need to merge with other drivers in that section:</p>
<div class="highlight"><pre><span class="nt"><driver</span> <span class="na">name=</span><span class="s">"postgresql"</span> <span class="na">module=</span><span class="s">"org.postgresql"</span><span class="nt">></span>
<span class="nt"><xa-datasource-class></span>org.postgresql.xa.PGXADataSource<span class="nt"></xa-datasource-class></span>
<span class="nt"></driver></span>
</pre>
</div></li>
</ol>
<h4 id="toc_36">Important Quickstart Testing Information</h4>
<p>The installation of PostgreSQL is a one time procedure. However, unless you have set up the database to automatically start as a service, you must repeat the instructions “Start the database server” above for your operating system every time you reboot your machine.</p>
<p><a id="byteman"></a></p>
<h3 id="toc_37">Install and Configure Byteman</h3>
<p><em>Byteman</em> is used by a few of the quickstarts to demonstrate distributed transaction processing and crash recovery.</p>
<h4 id="toc_38">What is It?</h4>
<p><em>Byteman</em> is a tool which simplifies tracing and testing of Java programs. Byteman allows you to insert extra Java code into your application, either as it is loaded during JVM startup or after it has already started running. This code can be used to trace what the application is doing and to monitor and debug deployments to be sure it is operating correctly. You can also use <em>Byteman</em> to inject faults or synchronization code when testing your application. A few of the quickstarts use <em>Byteman</em> to halt an application server in the middle of a distributed transaction to demonstrate crash recovery.</p>
<p><a id="byteman-install"></a></p>
<h4 id="toc_39">Download and Configure Byteman</h4>
<ol>
<li>Download Byteman from <a href="http://www.jboss.org/byteman/downloads/">http://www.jboss.org/byteman/downloads/</a></li>
<li>Extract the ZIP file to a directory of your choice.</li>
<li><p>By default, the Byteman download provides unrestricted permissions to <em>others</em> which can cause a problem when running Ruby commands for the OpenShift quickstarts. To restrict the permissions to <em>others</em>, open a command line and type the followinge:</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="n">byteman</span><span class="o">-</span><span class="n">download</span><span class="o">-</span>2<span class="p">.</span>0<span class="p">.</span>0<span class="o">/</span>
<span class="n">chmod</span> <span class="o">-</span><span class="n">R</span> <span class="n">o</span><span class="o">-</span><span class="n">rwx</span> <span class="n">byteman</span><span class="o">-</span><span class="n">download</span><span class="o">-</span>2<span class="p">.</span>0<span class="p">.</span>0<span class="o">/</span>
</pre>
</div></li>
</ol>
<p><a id="byteman-halt"></a></p>
<h4 id="toc_40">Halt the Application Using Byteman</h4>
<p><em>NOTE</em>: The Byteman scripts only work in JTA mode. They do not work in JTS mode. If you have configured the server for a JTS quickstart, you must follow the instructions to <a href="jts/README.html#remove-jts-configuration">Remove the JTS Configuration from the JBoss server</a> before making the following changes. Otherwise Byteman will not halt the server. </p>
<p>When instructed to use Byteman to halt the application, perform the following steps:</p>
<ol>
<li><p>Find the appropriate configuration file for your operating system in the list below.</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">conf</span>
<span class="n">For</span> <span class="n">Windows</span><span class="p">:</span> <span class="n">JBOSS_HOME</span><span class="o">\</span><span class="n">bin</span><span class="o">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">conf</span><span class="p">.</span><span class="n">bat</span>
</pre>
</div></li>
<li><p><strong>Important</strong>: Make a backup copy of this file before making any modifications.</p></li>
<li><p>The quickstart README should specify the text you need to append to the server configuration file.</p></li>
<li><p>Open the configuration file and append the text specified by the quickstart to the end of the file. Make sure to replace the file paths with the correct location of your quickstarts and the <em>Byteman</em> download. </p></li>
<li><p>The following is an example of of the configuration changes needed for the <em>jta-crash-rec</em> quickstart: </p>
<p>For Linux, open the <code>JBOSS_HOME/bin/standalone.conf</code> file and append the following line:</p>
<div class="highlight"><pre>JAVA_OPTS="-javaagent:/PATH_TO_BYTEMAN_DOWNLOAD/lib/byteman.jar=script:/PATH_TO_QUICKSTARTS/jta-crash-rec/src/main/scripts/xa.btm <span class="cp">${</span><span class="n">JAVA_OPTS</span><span class="cp">}</span>"
</pre>
</div>
<p>For Windows, open the <code>JBOSS_HOME\bin\standalone.conf.bat</code> file and append the following line:</p>
<div class="highlight"><pre><span class="n">SET</span> "<span class="n">JAVA_OPTS</span><span class="p">=</span><span class="c">%JAVA_OPTS% -javaagent:C:PATH_TO_BYTEMAN_DOWNLOAD\lib\byteman.jar=script:C:\PATH_TO_QUICKSTARTS\jta-crash-rec\src\main\scripts\xa.btm %JAVA_OPTS%"</span>
</pre>
</div></li>
</ol>
<p><a id="byteman-disable"></a></p>
<h4 id="toc_41">Disable the Byteman Script</h4>
<p>When you are done testing the quickstart, remember to restore the configuration file with the backup copy you made in step 2 above.</p>
</body></html>