Migracion WAS8
Migracion WAS8
Migracion WAS8
Front cover
WebSphere Application
Server V8.5 Migration Guide
Review case studies for competitive and
version migrations
Learn about the migration strategy
and planning
Become proficient with the
Application Migration Toolkit
Ersan Arik
Burak Cakil
Kurtcebe Eroglu
Vasfi Gucer
Rispna Jain
Levent Kaya
ibm.com/redbooks
Sinan Konya
Hatice Meric
Ross Pavitt
Dave Vines
Hakan Yildirim
Tayfun Yurdagul
SG24-8048-00
Note: Before using this information and the product it supports, read the information in Notices on
page xxi.
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The team who wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxiii
xxiii
xxvi
xxvi
xxvi
iii
27
27
27
29
30
30
31
34
35
35
36
36
iv
39
40
41
41
42
43
43
43
44
44
44
45
45
45
47
48
52
53
53
53
55
57
58
58
58
65
65
68
68
71
71
72
73
75
78
78
79
79
79
81
82
82
83
85
85
111
112
113
113
114
117
118
119
119
119
120
120
121
121
122
122
122
123
123
123
124
124
124
126
127
128
128
129
130
131
132
Contents
133
133
134
134
140
194
194
194
195
209
219
235
236
236
237
237
237
238
238
239
239
240
241
244
246
248
249
253
254
254
254
255
255
258
261
Contents
313
314
315
315
315
317
319
323
338
338
339
339
339
340
342
343
352
vii
421
422
422
422
423
423
423
424
424
424
424
425
425
426
426
426
427
427
427
427
428
428
428
428
428
428
429
429
429
430
430
430
431
431
431
432
432
432
433
433
433
434
435
435
435
436
436
ix
Figures
1-1 WebSphere Application Server V8.5 editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1-2 Stand-alone application server environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1-3 Network Deployment environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1-4 Administrative agent in a stand-alone configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1-5 Job manager architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1-6 WebSphere Application Server V8.5 container services. . . . . . . . . . . . . . . . . . . . . . . . 12
1-7 Business-level applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1-8 Files in WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1-9 Application server cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1-10 Dynamic cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1-11 Conceptual diagram of a core group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1-12 Dynamic cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1-13 Overview of WebSphere security service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1-14 Liberty profile architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2-1 Migration process overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2-2 Migration key activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2-3 Select an import source window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2-4 Select the EAR file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2-5 Selecting target run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2-6 Select the JAR file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2-7 Existing project into workspace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2-8 Browse and select the root directory or archive file . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3-1 Java classloaders hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3-2 A typical Java EE classloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3-3 WebSphere Application Server classloader hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . 61
3-4 Application server classloader settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3-5 WAR classloader policy settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3-6 Preferred packaging structure of a Java EE application . . . . . . . . . . . . . . . . . . . . . . . . 69
3-7 Clients that are provided for WebSphere Application Server . . . . . . . . . . . . . . . . . . . . 74
3-8 Java EE Specifications Migration wizard - J2EE Version selection . . . . . . . . . . . . . . . 77
3-9 Increases the version level of the project facet - before migration . . . . . . . . . . . . . . . . 77
3-10 Increases the version level of the project facet - after migration. . . . . . . . . . . . . . . . . 78
3-11 Converts .xmi files to .xml files - before migration. . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3-12 Converts .xmi files to .xml files - after migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3-13 Typical infrastructure for web services applications . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4-1 Steps for planning and implementation for migrating an application. . . . . . . . . . . . . . . 90
4-2 Migration aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4-3 Example configuration for migrating from WebLogic to WebSphere . . . . . . . . . . . . . . 92
4-4 Modules with red Xs indicating that there are one or more errors . . . . . . . . . . . . . . . . 93
4-5 A high-level flow of how the Migration Toolkit works. . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4-6 Software Analyzer Reporting pane for creating analysis reports . . . . . . . . . . . . . . . . . 94
4-7 Sample HTML report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4-8 Help view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4-9 Add Repository window for adding the Application Migration Tool as a repository. . . . 97
4-10 Plug-in selection in the Install window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4-11 Application server settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4-12 Analysis option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4-13 Software Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
xi
6-33
6-34
6-35
6-36
6-37
6-38
6-39
6-40
6-41
6-42
6-43
6-44
6-45
6-46
6-47
6-48
6-49
6-50
6-51
6-52
6-53
6-54
6-55
6-56
6-57
6-58
6-59
6-60
6-61
6-62
6-63
6-64
6-65
6-66
6-67
6-68
6-69
6-70
6-71
6-72
6-73
6-74
6-75
6-76
6-77
6-78
6-79
6-80
6-81
6-82
6-83
6-84
6-85
163
164
164
165
166
166
167
167
168
169
170
172
173
175
179
179
185
186
187
187
188
188
189
189
190
190
191
192
192
193
195
196
198
198
199
199
200
200
201
201
202
203
204
205
205
206
206
207
207
207
208
208
210
xiii
xv
12-11 EAR modules and Utility JAR projects during application import . . . . . . . . . . . . . . 394
12-12 Software Analyzer configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
12-13 Setting up a new Software Analyzer configuration . . . . . . . . . . . . . . . . . . . . . . . . . 396
12-14 Setting rules for the Software Analyzer configuration . . . . . . . . . . . . . . . . . . . . . . . 397
12-15 Rule set configuration dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
12-16 A ready Software Analyzer configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
12-17 Software Analyzer results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
12-18 Java Code Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
12-19 XML File Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
12-20 View Java Code Review results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
12-21 Clean Java Code Review results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
12-22 Fixing XML file review results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
12-23 Configuring the Application Migration Toolkit for the Probability Distribution Sample
application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
12-24 Installing the Axis 2 application on WebSphere Application Server V6.1 . . . . . . . . 411
12-25 Configuring the Application Migration Toolkit for the Stock Quote Axis2 application414
12-26 Selecting the parent last option for class loader order . . . . . . . . . . . . . . . . . . . . . 417
xvi
Tables
3-1 Java and vendor deployment descriptors and configuration files . . . . . . . . . . . . . . . . . 67
3-2 Java EE version numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4-1 Application Migration Tools and installIU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6-1 Explanation of the cell and domain components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
6-2 Explanation of the JMS components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6-3 Explanation of JMS extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
6-4 Data source values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6-5 Database connection properties values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6-6 JMS Server values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6-7 JMS queue values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6-8 JMS topic values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6-9 JMS Topic values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6-10 Queue connection factory values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6-11 Topic connection factory values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6-12 Explanation of WebLogic specific file names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6-13 JMS queue connection factory configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
6-14 JMS topic connection factory configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6-15 JMS queue configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6-16 JMS queue configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6-17 JMS topic configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
6-18 JMS activation specification configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
6-19 JMS activation specification configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
6-20 OrderProcessor MDBs WebSphere binding configuration . . . . . . . . . . . . . . . . . . . . 178
6-21 Mailer MDBs WebSphere binding configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
6-22 JDBC provider configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
6-23 JDBC data source configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6-24 J2C authentication alias configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6-25 WebSphere bindings for the Account EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6-26 Trade EJB JNDI names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6-27 EJB reference names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6-28 Default data source configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6-29 Trade web application reference JNDI names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
6-30 The contents of the MVC projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
6-31 The contents of the EJB projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
7-1 Terminology comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7-2 Creating the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
8-1 Terminology comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
8-2 Required libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
9-1 Terminology comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
9-2 Parameters for the Fileset Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
9-3 Parameters for the Properties for DB2 JCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
9-4 Parameters for the Fileset Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
9-5 Parameters for the Properties for DB2 JCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
10-1 Shared dependencies to be copied . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
12-1 EJB changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
12-2 JAX-WS changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
12-3 JCA enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
12-4 JPA changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
xvii
xviii
373
373
373
377
378
379
Examples
3-1 Web.xml excerpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3-2 WebSphere Application Server V8.5 deployment descriptor excerpt . . . . . . . . . . . . . . 66
3-3 Thin client looking up an EJB deployed on a single server. . . . . . . . . . . . . . . . . . . . . . 73
4-1 Installing the Migration Toolkit through the command line . . . . . . . . . . . . . . . . . . . . . . 99
4-2 Uninstalling the Application Migration Tools through the command line. . . . . . . . . . . 100
6-1 Basic authentication definition in web.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6-2 Mapping definition in weblogic.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6-3 org.eclipse.wst.common.project.facet.core file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6-4 WebLogic Query Language construct. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6-5 The basic authentication settings in web.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
6-6 Table.ddl file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7-1 The corrected peristence.xml file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
8-1 Warning message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
8-2 Command area code snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8-3 Changes to the file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
9-1 Required configuration of the required global data source . . . . . . . . . . . . . . . . . . . . . 281
9-2 The configuration that is required to add a user and a Test role . . . . . . . . . . . . . . . . 282
9-3 The commands that are required to create the necessary DB2 databases . . . . . . . . 288
9-4 Database creation commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9-5 Changing the mvncore.xml file code snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9-6 Define data source in mvncore.xml. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9-7 Define paths and trusted domains in mvncore.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9-8 Updating mvnforum.xml with the location of the mvnforum_home directory. . . . . . . . 298
9-9 Contents of a Liberty profile server configured to run the MvnForum application. . . . 302
9-10 Creating the EasyJSP database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
9-11 Creating the data structure and sample data of the EasyJSP database . . . . . . . . . 307
9-12 Adding the required packages to access the data source . . . . . . . . . . . . . . . . . . . . 308
9-13 Changing the connection parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
9-14 Remove the square brackets in the following SQL syntaxes . . . . . . . . . . . . . . . . . . 308
9-15 The resource reference to add to the deployment descriptor . . . . . . . . . . . . . . . . . . 310
10-1 Code snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
10-2 Seam setup command interactive output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
10-3 Code snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
10-4 Roo script file for generating a sample application . . . . . . . . . . . . . . . . . . . . . . . . . . 340
10-5 Overriding hashCode and equals methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
11-1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
11-2 Uninstall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
12-1 Command to build the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
12-2 Command to uninstall the PlantsByWebSphere sample application on Windows . . 385
12-3 Command to uninstall the PlantsByWebSphere sample application on Linux . . . . . 386
12-4 Command to install the PlantsByWebSphere sample application on Windows . . . . 386
12-5 Command to install the PlantsByWebSphere sample application on Linux . . . . . . . 386
12-6 Java code to be analyzed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
12-7 Usage of the equals method of Duration class leading to a flag . . . . . . . . . . . . . . . . 401
12-8 Usage of equals method of Duration class leading to a flag . . . . . . . . . . . . . . . . . . . 401
12-9 A snippet from the error.jsp file included in the PlantsByWebSphere. . . . . . . . . . . . 403
12-10 The manifest.mf file for the jsf-ibm.jar in the Probability Distribution Sample . . . . . 407
12-11 The EnableChildFirstClassLoading property in the axis2.xml file . . . . . . . . . . . . . . 415
xix
xx
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area. Any
reference to an IBM product, program, or service is not intended to state or imply that only that IBM product,
program, or service may be used. Any functionally equivalent product, program, or service that does not
infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to
evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The
furnishing of this document does not grant you any license to these patents. You can send license inquiries, in
writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time
without notice.
Any references in this information to non-IBM websites are provided for convenience only and do not in any
manner serve as an endorsement of those websites. The materials at those websites are not part of the
materials for this IBM product and use of those websites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring
any obligation to you.
Any performance data contained herein was determined in a controlled environment. Therefore, the results
obtained in other operating environments may vary significantly. Some measurements may have been made
on development-level systems and there is no guarantee that these measurements will be the same on
generally available systems. Furthermore, some measurements may have been estimated through
extrapolation. Actual results may vary. Users of this document should verify the applicable data for their
specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the
accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the sample
programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore,
cannot guarantee or imply reliability, serviceability, or function of these programs.
xxi
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries, or both. These and other IBM trademarked terms are
marked on their first occurrence in this information with the appropriate symbol ( or ), indicating US
registered or common law trademarks owned by IBM at the time this information was published. Such
trademarks may also be registered or common law trademarks in other countries. A current list of IBM
trademarks is available on the Web at http://www.ibm.com/legal/copytrade.shtml
The following terms are trademarks of the International Business Machines Corporation in the United States,
other countries, or both:
AIX 5L
AIX
CICS
DB2 Universal Database
DB2
developerWorks
GDDM
Global Technology Services
IBM SmartCloud
IBM
IMS
MQSeries
MVS
Passport Advantage
Rational Team Concert
Rational
Redbooks
Redbooks (logo)
System p
System x
System z
WebSphere
z/OS
xxii
Preface
This IBM Redbooks publication helps you plan and execute the migration of J2EE
applications that are developed for Oracle WebLogic Server, Oracle Application Server,
JBoss, and Apache Tomcat, so that they run on IBM WebSphere Application Server V8.5.
In addition, this book covers migration from earlier versions of WebSphere Application Server
to WebSphere Application Server V8.5.
This book provides detailed information to plan migrations, suggested approaches for
developing portable applications, and migrating working examples for each of the platforms
from which we migrated in our examples. The primary tool that is used in the migration
scenarios that are covered in this book is the IBM WebSphere Application Server Migration
Toolkit V3.5.
It is not our intention to provide a feature-by-feature comparison of these application servers
versus WebSphere Application Server, but to produce practical technical advice for
developers who must migrate applications from these vendors to WebSphere Application
Server V8.5.
This publication is an update of WebSphere Application Server V7: Competitive Migration
Guide, SG24-7870.
The book is intended as a migration guide for IT specialists who are working on migrating
applications that are written for other application servers or earlier versions of WebSphere
Application Server to WebSphere Application Server V8.5.
xxiii
Kurtcebe Eroglu works for Sade Yazilim Ve Danismanlik as an IT specialist. He has over 10
years of experience in IT, focusing on application integration middleware and enterprise
software development. He has a Bachelor of Science degree in Environmental Engineering, a
Master of Science degree in Computer Engineering, a Master of Science degree in
Engineering Management from Middle East Technical University, and is studying for a degree
in Philosophy.
Vasfi Gucer is a Project Leader at the IBM International Technical Support Organization. He
has been with the ITSO since January 1999. He has more than 12 years of experience in the
areas of Systems Management, networking hardware, and software on mainframe and
distributed platforms. He writes extensively and teaches IBM classes worldwide on IBM
products. Vasfi is also an IBM Certified Senior IT Specialist, PMP, and ITIL Expert.
Rispna Jain is a Technical Software Deployment Manager for the WebSphere suite of
products in IBM Global Technology Services and works with clients in North America. She
has seven years of experience with WebSphere Application Server product development at
IBM Software Group in various roles, such as development, Level 3 support, and testing.
Rispna has also been a technical speaker for WebSphere Application Server related topics at
various WebSphere conferences. She is an IBM Certified SOA associate and holds a Master
of Technology degree in Computer Science.
Levent Kaya is an IT Specialist working for IBM Software Services for WebSphere (ISSW) in
Turkey for two years. He has five years of experience in the IT industry. He has two years of
development experience with IBM WebSphere Process Server. He has a Bachelor of
Science degree in Computer Engineering from Yildiz Technical University
Sinan Konya is the Chief Architect and founder of eteration a.s. He is an object mentor and
an educator. He is a founding member of ObjectLearn and wrote ObjectWeb Lomboz in 2000,
which is open source software for JavaEE development. Before he worked at eteration, Sinan
was with BEA Systems Inc. and The Object People as a Mentor. He has more than 17 years
of experience in designing and implementing enterprise-wide and mission-critical systems.
He has been involved in teaching object technology and enterprise software development
using Java and JavaEE technologies for over 15 years in various industries. He has a Master
of Science degree in Control and Computer Engineering from Istanbul Technical University.
He was involved as a committer in the Eclipse WTP.
Hatice Meric is a Technical Consultant working for IBM Istanbul Innovation Center in Turkey.
In her previous IBM role, she was an IT Specialist in Software Services at IBM Turkey. She
has a Bachelor of Science degree in Computer Engineering from Yildiz Technical University.
Ross Pavitt is a Software Engineer at IBM Hursley in the United Kingdom. He joined the
WebSphere Application Server Liberty profile team in 2012 as a test lead, focusing on
customer scenario testing. Before that position, he was part of the IBM CICS Transaction
Gateway team. Ross joined IBM in 2008 and focused on functional verification and other
automated testing for multiple platforms, including IBM System z, IBM System x and IBM
System p.
Dave Vines is an IBM Master Inventor and Senior Software Engineer at the IBM Hursley
Laboratory in the United Kingdom working in WebSphere Application Server Development
specializing in the Liberty profile and IBM Workload Deployer. He joined the laboratory in
1984 and has worked on various IBM licensed programs, including GDDM, IBM
MQSeries, LANDP and, since 1998, on Component Broker and WebSphere Application
Server. He received a Bachelor of Science degree from the University of Exeter, England,
in 1984.
xxiv
Preface
xxv
Comments welcome
Your comments are important to us!
We want our books to be as helpful as possible. Send us your comments about this book or
other IBM Redbooks publications in one of the following ways:
Use the online Contact us review Redbooks form found at:
ibm.com/redbooks
Send your comments in an email to:
[email protected]
Mail your comments to:
IBM Corporation, International Technical Support Organization
Dept. HYTD Mail Station P099
2455 South Road
Poughkeepsie, NY 12601-5400
xxvi
Part 1
Part
WebSphere Application
Server V8.5: Concepts
and architecture
This part provides an overview of WebSphere Application Server V8.5, including the
lightweight Liberty profile. If you are new to WebSphere Application Server or to the Liberty
profile that is introduced in V8.5, read this part first.
Chapter 1.
Overview of WebSphere
Application Server V8.5
IBM WebSphere Application Server helps drive business agility with an innovative and
performance-based foundation to build, reuse, run, integrate, and manage service-oriented
architecture (SOA) applications and services. From business critical enterprise-wide
applications to the smallest departmental level applications, WebSphere Application Server
offers reliability, availability, security, and scalability.
WebSphere Application Server V8.5 addresses the needs of todays agile enterprises and
developers. For the enterprise, it provides a choice of application server solutions with fidelity
for the available editions. It also provides increased scalability, resiliency, and security for
critical applications and the flexibility to deploy new offerings quickly and efficiently. It includes
a lightweight and powerful, yet simple, application server to satisfy multiple requirements
around a simplified low-end application environment. For the developer, it provides an
improved developer experience and a simplified server configuration that can be versioned
and maintained in source control along with the applications.
This chapter provides an overview of WebSphere Application Server V8.5, including the
lightweight Liberty profile. This chapter describes the following topics:
Overview of WebSphere Application Server
WebSphere Application Server packaging
WebSphere Application Server concepts
Containers
Applications
Profiles
Workload management
High availability
Health management
Administration and problem determination
Messaging
Service integration
Security
Liberty profile
1.3.1 Servers
WebSphere Application Server V8.5 provides the infrastructure and capabilities that are
required to host applications and proxy servers that distribute work to the application servers.
It also defines generic external servers to the administration process and to associate web
servers for routing purposes.
When you use WebSphere Application Server V8.5, you can have the following types
of servers:
Application servers
Proxy servers
Generic servers
Application servers
The application server is the core of the WebSphere Application Server product and is the
runtime environment in which business applications run. It provides containers and services,
such as database connectivity, threading, and workload management, that can be used by
applications. Each application server runs in its own Java virtual machine (JVM) and can
have one or many applications that are deployed to it.
Because each application server runs in a single JVM, you can deploy applications using one
of the following options, which are based on machine resources and risk:
A model that uses one application per application server can reduce the risk of JVM
issues that are caused by one application that affects other applications. However, more
machine resource impact for each JVM can occur. So, there is a trade-off.
A model that uses multiple applications per application server optimizes system resources
by minimizing the JVM machine resource impact. However, poorly written applications can
cause negative impacts to other applications within the same JVM.
WebSphere Application Server V8.5 introduces the concept of the Liberty profile. The Liberty
profile is a composable and dynamic application server runtime environment. It is a subset of
the functionality of the Base and Express packages and is installed separately, using either
Installation Manager or a downloadable compressed file format. It is a stand-alone server,
similar to the stand-alone Base or Express application servers, that uses an
easy-to-configure XML configuration file format.
The Liberty profile is a simplified and lightweight run time for web applications. The small
footprint and low impact, along with a simplified configuration, makes the WebSphere
Application Server V8.5 Liberty profile a good option for developers who are building web
applications that do not require the full Java EE environment of traditional enterprise
application server profiles.
The Liberty profile provides a lightweight development and application-serving environment
for web and OSGi applications that is configured with the correct level of capabilities that are
required for the individual applications. You can use the Liberty profile to specify only those
features that are required for the applications that are deployed, reducing the memory
footprint and increasing performance.
The Liberty profile is optimized for developer and operational productivity. You can use it in
both development and production environments. Within the development environment, the
Liberty profile supports the same platforms as the base application server and Mac OSX. In
addition, enterprise qualities of service, such as security and transaction integrity, are
enabled as required.
For details about the Liberty profile, see 1.15, Liberty profile on page 34.
Proxy servers
A proxy server is a specific type of application server that routes requests to content servers
that perform the work. The proxy server is the initial point of entry, after the protocol firewall,
for requests that enter the environment.
You can use WebSphere Application Server to create the following types of proxy servers:
The WebSphere Application Server Proxy classifies, prioritizes, and routes HTTP and
Session Initiation Protocol (SIP) requests to servers in the enterprise and to cache content
from servers.
The DMZ Secure Proxy Server comes in a separate installation package and provides
security enhancements to allow deployments inside of a DMZ. It improves security by
minimizing the number of external ports that are opened and running as an unprivileged
user when you bind to well-known ports.
The on-demand router (ODR) is an intelligent Java based HTTP proxy server and SIP
proxy server that is built on the WebSphere run time. The ODR manages the flow of
requests to application servers based on a set of configurable routing rules. It is
asynchronous, high performing, scalable, and can be clustered for high availability.
Generic servers
A generic server is a server that can be managed as part of the administrative domain of
WebSphere Application Server, but it is not supplied by WebSphere Application Server. With
the generic servers function of WebSphere Application Server, a generic server can be
defined as an application server instance within the WebSphere Application Server
administration and associate it with a non- WebSphere Application Server or process.
Multiple stand-alone application servers can exist on a system, either through independent
installations of WebSphere Application Server binary files or by creating multiple application
server profiles within one installation (Figure 1-2).
In a Network Deployment and WebSphere Application Server for z/OS environments, a cell
can consist of multiple nodes and node groups, which are all administered from a single point,
the deployment manager (using GUI or scripting) (Figure 1-3).
Cells can contain nodes that are running any of the supported operating systems or
platforms, including spanning z/OS Sysplex environments and other operating systems. For
example, z/OS nodes, Linux nodes, UNIX nodes, and Windows system nodes can exist in the
same WebSphere Application Server cell.
The deployment manager is used to administer the cell from a single point. It communicates
with the node agents of the cell to manage the applications servers within each node. A node
is federated into the cell and can be managed only by the deployment manager that is
managing that cell. The node agent is an administrative server that is running in the node. It
monitors the application servers on that node and routes administrative requests from the
deployment manager to those application servers.
The master repository is managed by the deployment manager and regularly synchronized
with local copies that are held on each of the nodes.
10
11
1.4 Containers
Figure 1-6 illustrates applications that run in different containers inside the JVM.
Containers provide runtime support for applications. They are specialized to run specific
types of applications and can interact with other containers by sharing session management,
security, and other attributes.
12
The SIP container processes applications that use at least one SIP servlet that is written
to the JSR 289 specification. It provides network services over which it receives requests
and sends responses. It determines which applications to start and in what order. The
container supports UDP, TCP, and TLS/TCP protocols.
The OSGi Blueprint container processes OSGi applications that are based on the OSGi
framework. Blueprint is separated from Java EE technology, but it can be mixed in to
deploy modular applications that use both Java EE 6/7 and OSGi R4 V4.2 technologies.
1.5 Applications
At the heart of WebSphere Application Server is its ability to run applications. WebSphere
Application Server V8.5 supports multiple technologies and programming models that can be
used within enterprise applications. In addition to the programming models and technologies,
applications can use either the Java 6 or Java 7 Java runtime environment (JRE). Java 6 is
installed with the product and used by default. WebSphere Application Server V8.5 supports
IBM WebSphere SDK Java Technology Edition Version 7.0 as a pluggable JDK that can be
optionally installed and enabled by using the managesdk tool.
For more information, see the IBM SDK Java Technology Edition Version 7 Information
Center at:
http://publib.boulder.ibm.com/infocenter/java7sdk/v7r0/index.jsp
The following programming models and technologies are supported in WebSphere
Application Server V8.5:
Java EE applications
Portlet applications
SIP applications
Business-level applications
WebSphere Batch applications
OSGi applications
Communications enabled applications
Service Component Architecture
XML
WebSphere Application Server Web 2.0 and Mobile Toolkit
13
14
15
The XML job control language provides a method to describe the steps that are involved in
the batch jobs. This application runs in batch containers that also run at the same time in
designated WebSphere Application Server environments. A job scheduler determines the
appropriate container to run the job and maintains job histories to support job visibility
and control.
16
Java servlets
JavaScript for Asynchronous JavaScript and XML (Ajax)
1.5.9 XML
Since first being standardized in 1999, XML usage in application development environments
grew to include the following types of scenarios:
A simplified programming model for building presentation flexible web applications using
end-to-end declarative XML that can be adapted to various platform types from mobile
to desktop
Access, search, retrieval, and presentation of data or documents that are stored in
native XML
Filter for XML data sets, such as web feeds in Java applications
XML data transformations for application development scenarios
WebSphere Application Server V8.5 provides XML support to work with web applications that
process data by using standard XML technologies such as Extensible Stylesheet Language
Transformation (XSLT) 2.0, XML Path Language (XPath) 2.0, and XML Query Language
(XQuery) 1.0. You can use XQuery 1.0 to query large amounts of data that is stored in XML
outside of a database. All together, this technologies offer the benefit of simplifying
application development and improving its performance and reliability
17
Code quality tools help teams find and correct problems before they escalate into
expensive problems.
For developers not using one of the development environments that are based in WebSphere
Application Server, WebSphere Application Server for Developers provides a runtime
environment for development and testing. This runtime environment is identical to the
production runtime environment on which the applications eventually run. It provides for
efficient development and aids in reducing testing effort.
The Liberty profile supports web applications, OSGi applications, and Java Persistence API.
Associated services, such as transaction and security, are supported for these application
types and for Java Persistence API. It is lightweight, easy to install, and allows for dynamic
updates to the runtime environment, making the Liberty profile a good platform for developing
and testing web and OSGi applications. This platform is beneficial when you are developing
an application to run on the WebSphere Application Server Full profile, because any
application that runs on the Liberty profile also runs on the Full profile.
1.6 Profiles
WebSphere Application Server runtime environments are built by creating a set of
configuration files, named profiles, that represent a WebSphere Application Server
configuration. The following categories of WebSphere Application Server files are available
(Figure 1-8):
Product files are a set of read-only static files or product binary files that are shared by
any instances of the WebSphere Application Server product.
Configuration files (profiles) are a set of user-customizable data files. This file set
includes WebSphere configuration, installed applications, resource adapters, properties,
log files, and so on.
Administration is greatly enhanced when you use profiles instead of multiple product
installations. Disk space is saved and updating the product is simplified when you maintain a
single set of product core files.
You can use the Customization Toolbox to create separate environments, such as for
development or testing, without having to perform a separate product installation for each
environment. Different profile templates are available in WebSphere Application Server V8.5
through the Customization Toolbox - Profile Management Tool (PMT), including:
Cell
A Cell template contains a federated application server node and a deployment manager.
Deployment manager
The Network Deployment profile provides the necessary configuration for starting and
managing the deployment manager server.
Default profile (for stand-alone servers)
This server default profile provides the necessary configuration file for starting and
managing an application server, and all the resources that are required to run
enterprise applications.
Administrative Agent
This profile is used to create the administrative agent to administer multiple stand-alone
application servers.
Default secure proxy
This profile is available when you install the DMZ secure proxy server feature.
19
Job manager
This profile is useful for coordinating administrative actions among multiple Deployment
Managers, administering multiple stand-alone application servers, asynchronously
submitting jobs to start servers, and completing various other tasks.
Custom
This profile, also known as Empty Node because it has no application server inside, can
be federated to a deployment manager cell later. It is used to host application servers,
clusters, an ODR, or other Java processes.
20
1.7.3 Clusters
A cluster is a collection of servers that is managed together. With clusters, enterprise
applications can scale beyond the amount of throughput that can be achieved with a single
application server. Also, enterprise applications can be highly available because requests are
automatically routed to the running servers if there is a failure. The servers that are members
of a cluster can be on different host machines. A cell can include no clusters, one cluster, or
multiple clusters.
An application server cluster (Figure 1-9) is a logical collection of application server
processes that provides workload balancing and high availability. It is a grouping of
application servers that run an identical set of applications that are managed so that they
behave as a single application server (parallel processing). WebSphere Application Server
Network Deployment or WebSphere Application Server for z/OS is required for clustering.
21
WebSphere Application Server V8.5 provides integrated support for dynamic clusters. A
dynamic cluster (Figure 1-10) is an application deployment target that can expand and
contract depending on the workload in the environment. Dynamic clusters work with
autonomic managers, including the application placement controller and the dynamic
workload manager to maximize the usage of computing resources. A dynamic cluster uses
weights and workload management. This management is used to balance the workloads of
its cluster members dynamically, and is based on performance information that is collected
from the cluster members.
Dynamic workload management is a feature of the ODR that applies the same principles as
workload management, such as routing based on a weight system, which establishes a
prioritized routing system. With dynamic workload management, the system can dynamically
modify the weights to stay current with the business goals, compared to manually setting
static weights in workload management. It also balances requests across the available nodes
to regulate response times.
22
WebSphere Application Server Network Deployment uses a high availability manager (HA
manager) to address these single points of failure within the WebSphere Application Server
environment. An HA manager instance runs on every application server, proxy server, node
agent, and deployment manager in a cell. A cell can be divided into multiple high availability
domains that are known as core groups (Figure 1-11).
Each HA manager instance establishes network connectivity with all other high availability
manager instances in the same core group, using a specialized, dedicated, and configurable
transport channel. The transport channel provides mechanisms that allow the HA manager
instance to detect when other members of the core group start, stop, or fail.
Within a core group, HA manager instances are elected to coordinate high availability
activities. An instance that is elected is known as a core group coordinator. The coordinator
is highly available, so that if a process that is serving as a coordinator stops or fails, another
instance is elected to assume the coordinator role, without loss of continuity.
The HA manager provides a specialized messaging mechanism that enables processes to
exchange information about their current state. Each process sends or posts information that
is related to its current state, and can register to be notified when the state of the other
processes changes.
The Data Replication Service (DRS) that is provided with WebSphere Application
Server V8.5 is used to replicate stateful EJB sessions, HTTP session data, and dynamic
cache information among cluster members. When DRS is configured for memory-to-memory
replication, the transport channels that are defined for the HA managers are used to pass this
data among the cluster members.
23
The ODR is an intelligent Java based HTTP proxy server and SIP proxy server that is built on
the WebSphere run time that can manage the flow of requests into both WebSphere and non
WebSphere environments. The ODR is asynchronous, high performing, scalable, and can be
clustered for high availability.
You can use the ODR to set up a highly available deployment manager using a hot-standby
model for availability. For example, you can have two or more deployment managers, where
one deployment manager is active (known as the primary deployment manager) and one or
more deployment managers are backup managers in standby mode. The primary deployment
manager hosts the cells administrative function, and if the active manager is stopped or fails,
a standby manager takes over and is designated the new active deployment manager.
Although the deployment manager process is not considered a single point of failure (SPOF)
for applications and application server functionality, using a highly available deployment
manager eliminates the deployment manager as a SPOF for cell administration. This type of
high availability is especially important in environments that rely on automated operations,
including application deployment and server monitoring.
The WebSphere Application Server V8.5 default messaging engine, the service integration
bus (bus), provides high availability to the messaging system process. By creating the
messaging engine within the cluster, it can fail over to any other server in the cluster. To
achieve a seamless failover, the queue information and message data must be stored in a
shared location that is accessible by all members of the cluster. This shared location can be
an external database or shared disk environment.
High availability also means ensuring that you have adequate resources to meet the
changing demands. By using Intelligent Management capabilities in WebSphere Application
Server V8.5, applications are mapped to dynamic clusters that are spread throughout
hardware pools. Each node in the dynamic cluster can run one or more instances of an
application server that clusters applications. By deploying applications to dynamic clusters,
requests to the application can be managed autonomically. The dynamic cluster can expand
and contract with application server virtualization. By deploying applications to dynamic
clusters, you enable application virtualization.
You can combine the advantages that infrastructure virtualization provides with the
advantages of hardware virtualization by using both in the same infrastructure.
Autonomic computing
Autonomic computing refers to the self-managing characteristics of distributed computing
resources that adapt to unpredictable changes while hiding intrinsic complexity from
operators and users. Using Intelligent Management in WebSphere Application Server
V8.5, you can create a self-managing environment that serves applications. It can help
you overcome the complexity of systems management and reduce the barrier that
complexity poses to further growth. An autonomic system makes decisions on its own,
using high-level policies. It constantly checks and optimizes the status of the system, and
automatically adapts it to changing conditions.
Cloud computing
Virtualization and autonomic computing are steps toward cloud computing. By building a
virtualization foundation, you put the secure, scalable, and efficient system in place in
which to build a cloud.
Intelligent management includes the primary features of intelligent routing, dynamic
operations, performance management, health management, and application edition
management, which are described in the following sections.
Dynamic cluster is a server cluster that uses weights and workload management to balance
the workloads of its cluster members dynamically. It balances based on performance
information that is collected from the cluster members. Dynamic clusters consist of a number
of servers that can stop or start in response to changing workload.
These clusters are application deployment targets that can expand and contract, depending
on the workload in the environment. After you deploy applications to dynamic clusters, the
placement of the applications is determined by the operational policies that you define.
Autonomic managers control the placement of the server instances and how workload is
routed to each application. If workload increases for a specific application, the number of
server instances for the dynamic cluster that is hosting the application can increase. The
application can also use available resources from other applications that are not experiencing
increased workload.
25
Figure 1-12 illustrates how the workload increases for a specific application. The number of
server instances for the dynamic cluster that is hosting the application can increase by using
available resources from other applications. In this example, New Application Server 3
contributes bandwidth to satisfy higher workload requests. The ODR manages this dynamic
cluster growth and sends requests to the new server.
The ODR is an intelligent Java based HTTP proxy server and Session Initiation Protocol
(SIP) proxy server that is built on the WebSphere run time. It is responsible for managing the
flow of requests into the WebSphere environment and non WebSphere environment. The
ODR, similar to the web server plug-in for WebSphere Application Server, uses session
affinity to route work requests. The ODR is asynchronous, high performance, and scalable. It
can be clustered for high availability.
The ODR can be used to set up a highly available deployment manager. It can then route to
an active deployment manager and possibly a hot-standby deployment manager.
Dynamic workload management is a feature of the ODR. It applies the same principles as
Workload Manager (WLM), such as routing based on a weight system, which establishes a
prioritized routing system. The dynamic workload controller autonomically sets the routing
weights in WLM. With workload management, you manually set static weights in the
administrative console. The system can dynamically modify these weights to stay current with
the business goals.
26
The application edition management feature also provides an application versioning model
that supports multiple deployments of the same application in a cell. You can choose which
edition to activate on a cluster, so you can roll out an application update or revert to a
previous level.
1.11.1 Administration
In the WebSphere Application Server Express and Base packages, you can administer
stand-alone server instances individually and administer multiple stand-alone server
instances on a single system using an administrative agent. In WebSphere Application
Server Network Deployment, you can administer an entire cell of application servers using a
deployment manager.
27
WebSphere Application Server V8.5 provides the following administrative tools that you can
use to configure and manage a runtime environment:
WebSphere scripting client (wsadmin)
The wsadmin client provides a non-graphical scripting and interactive interface that you
can use to administer WebSphere Application Server from a command-line prompt. By
connecting the client to an application server instance, you can run commands using
either the Jython or Jacl scripting languages.
Administrative console
The administrative console is a browser-based client that allows administrators to monitor,
update, and configure the WebSphere Application Server environment, except for the
Liberty profile. Unfederated application servers, administrative agents, deployment
managers, and job managers can have their own administrative consoles.
For actions run in the administrative console, you can use command assistance to view
the wsadmin scripting commands in Jython for the last action that was run. This assistance
provides a way to develop automation using wsadmin scripting by first stepping through the
tasks that you need in the administrative console.
Command-line utilities
Administrative utilities can help to manage the environment from the command line. These
utilities include the ability to perform common administrative tasks, such as starting and
stopping application server instances and backing up the configuration. The utilities are
run on and act against the local server or node, including the deployment manager.
WebSphere Customization Toolbox
The WebSphere Customization Toolbox includes the following tools for customizing
various parts of the WebSphere Application Server environment:
You can use the Web Server Plug-ins Configuration Tool to configure web server
plug-ins for any operating system on which the WebSphere Customization Toolbox
can be installed.
You can use the WebSphere Customization Toolbox command-line utility to start the
command-line version of the Plug-ins Configuration Tool (PCT).
The Profile Management Tool (z/OS only) can be started on an Intel based Windows or
Linux operating system to generate jobs and instructions for creating profiles for
WebSphere Application Server on z/OS systems.
The z/OS Migration Management Tool generates definitions for migrating WebSphere
Application Server for z/OS profiles from an Intel based Windows or Linux
operating system.
Job manager
You can use the job manager to manage multiple WebSphere Application Server domains
(multiple deployment managers and administrative agents) through a single administration
interface. It also provides a centralized interface for asynchronous job submissions.
In WebSphere Application Server V8.5, you can use the job manager to package the
Liberty profile runtime environments, configurations, and applications to distribute and
deploy a Liberty profile server and applications and to start embedded profile packages.
Centralized installation manager
You can use the centralized installation manager to consolidate and simplify the required
steps in installing and applying maintenance. With the centralized installation manager,
you can install, update, uninstall, and apply maintenance to WebSphere Application
Server remotely.
28
You access the centralized installation manager functions through the job manager or
deployment manager. Because the functions are implemented as jobs, the process also
supports job scheduling. Using the centralized installation manager with the job manager,
you can manage multiple product offerings in an agentless manner for multiple cells.
Administrative applications
With WebSphere Application Server Version V8.5, you can develop custom Java
applications using Java Management Extensions (JMX) to perform any of the
administrative features of the WebSphere Application Server administrative tools. For
example, you can prepare, install, uninstall, edit, and update applications
through programming.
29
WebSphere Application Server V8.5 provides the server dump command for problem
diagnosis for a Liberty profile server. The result file that is obtained from this command
contains server configuration, log information, and details of the deployed applications in the
work area directory.
Usually, a dump of a running Liberty profile server includes the following information:
1.12 Messaging
Generically, the term messaging describes communication or the exchange of information
between two or more interested parties. Messaging is a facility for exchanging data between
applications and clients of different types. It is also an excellent tool for communication
between heterogeneous platforms.
WebSphere Application Server V8.5 implements a powerful and flexible messaging platform
within the WebSphere Application Server environment that is called the service integration
bus (SIBus). WebSphere Application Server applications run asynchronous messaging
services, using the Java Messaging Service (JMS) application programming interface (API),
to interface with a messaging provider. The messaging provider can be the WebSphere MQ
messaging provider, the default messaging provider (bus), or a third-party
messaging provider.
Applications can use one of the following styles of asynchronous messaging:
Point-to-point applications typically use queues to pass messages to each other. An
application sends a message to another application by identifying a destination queue.
The underlying messaging and queuing system receives the message from the sending
application and routes the message to its destination queue, where the receiving
application retrieves it.
In publish/subscribe messaging, the subscriber is the consumer of the information and
specifies the topics of interest by submitting a subscription request. The publisher supplies
information in the form of messages, which contain both a topic and the actual
information. A message broker sits between the subscriber and the publisher, and as it
receives published messages, it forwards those messages to the subscribers who
requested messages in the topic that is given in each individual message.
30
Service integration bus capabilities are fully integrated into WebSphere Application Server
V8.5, enabling it to take advantage of WebSphere security, administration, performance
monitoring, trace capabilities, and problem determination tools. A service integration bus
(SIBus) is a group of one or more bus members in a WebSphere Application Server cell that
cooperate to provide asynchronous messaging services. A cell requires only one bus, but a
cell can contain any number of buses. A messaging engine is a component that is
responsible for processing messages, sending and receiving requests, and
hosting destinations.
A destination is defined within a bus and represents a logical address to which applications
can attach as message producers, consumers, or both. Destinations are associated with a
messaging engine by using a message point.
Service integration has the following types of bus destinations, each with a different purpose:
A queue destination is used for point-to-point messaging.
A topic space destination is used for publish/subscribe messaging.
A foreign destination is a destination that is defined on another bus (called a foreign bus)
and that is also used in point-to-point messaging.
An alias destination is an alternative name for either a queue destination or a topic
space destination.
1.14 Security
WebSphere Application Server provides a security infrastructure and mechanisms to protect
sensitive resources and to address enterprise end-to-end security requirements. From a
broad perspective, a WebSphere security service runs locally in each process (deployment
manager, node agent, and application server).
31
This architecture (Figure 1-13) distributes the security workload so that one process does not
act as a bottleneck for the entire environment. If a security service failure occurs, then only a
single process is affected. The authentication mechanism and user registry are separated.
You can secure the environment at various levels, from the physical security of the location
where the server hardware is, to the security within the application itself.
WebSphere Application Server V8.5 security includes the following levels:
Java virtual machine (JVM) security
The JVM provides a set of standards-based security services for Java applications and an
installation layer between Java applications and the various services within the operating
system. It provides an isolated environment to the Java application that is running in it,
which in this case is WebSphere Application Server. In addition, the JVM protects memory
from unrestricted access, creates exceptions when errors occur within a thread, and
defines array types.
Java 2 security
The Java 2 security model offers access control to system resources, including file
system, system property, socket connection, threading, class loading, and so on.
Application code must explicitly grant the required permission to access a protected
resource. Java 2 uses security policy files, which can control the access to the resources
by applications. A WebSphere Application Server application has its own policy files, so
that it can use files and directories on the host operating system.
Java EE security API
The Java EE standard API describes methods with which the application can obtain the
logged in users name and role membership. WebSphere Application Server never returns
the password of any user using the API methods.
32
The Java EE security policy describes how application resources are accessed. The
developer, when creating the application, has no information about real users of the
application. Instead, the developer defines user roles, and during development the user
roles are mapped to access rights. The rule set is stored in the descriptor files of the
application. Then, when the application is deployed, the deployer is responsible for
mapping users and groups to the security roles.
CSIv2 security
CSIv2 is an IIOP-based, three-tiered, security protocol that is developed by the Object
Management Group (OMG). This protocol provides message protection, interoperable
authentication, and delegation. Any calls that are made among secure Object Request
Brokers (ORBs) are started over the CSIv2 security protocol, which sets up the security
context and the necessary quality of protection. After the session is established, the call is
passed up to the enterprise bean layer.
WebSphere security
WebSphere security enforces security policies and services with regard to access to its
resources. It covers a wide range of features. It begins with the administrator user
management in the administrative console, controlling which administrative user is
allowed to do what on the administrative console. Administrative security is enabled
by default.
The WebSphere Application Server security infrastructure provides a set of services. These
services are integrated with the underlying operating system, the runtime environment, and
other servers and server components. The WebSphere Application Server security
infrastructure includes the following key security areas:
Authentication
Authorization
Key and certificate management
Auditing
Flexible configuration option
WebSphere Application Server V8.5 provides the capability to use security domains. Each
security domain can have its own, separately configured Virtual Member Manager (VMM)
instance. WebSphere Application Server V8.5 provides the following options and
combinations to select the best user registry setting for an application environment:
Security domains
WebSphere security domains provide the flexibility to use several security configurations
within a single WebSphere Application Server cell. With security domains, you can
configure several security attributes, such as the user registry, for various applications in
the same cell. The global security configuration applies to all administrative functions,
naming resources, and Mbeans, and is the default security configuration for user
applications. You must define a global security configuration before you can create the
security domains. If you do not configure security domains, the applications use
information from the global security configuration.
When you create a security domain and associate it with a scope, only the user
applications in that scope use the security attributes that are defined in the security
domain. The administrative applications and the naming operations in that scope use the
global security configuration. Each security domain must be associated with a scope (cell,
or specific clusters, servers, and service integration buses) where it is applied.
33
User registries
Information about users and groups are in a user registry. In WebSphere Application
Server, a user registry authenticates a user. It contains information about users and
groups so that security-related functions, including authentication and authorization, can
be performed. Although WebSphere Application Server supports several types of user
registries, only one user registry can be active in a certain scope.
WebSphere Application Server supports the following types of user registries:
Local operating system
Stand-alone Lightweight Directory Access Protocol (LDAP)
Federated repository (a combination of a file-based registry and one or more LDAP
servers in a single realm)
Custom registry
34
The Liberty profile provides a development and a test environment and a production
environment on all WebSphere Application Server V8.5 supported platforms. Additionally, the
Liberty profile provides a development environment on the Macintosh operating system.
a pplication
features
apps
res ources
applicat ion
serve r.x m l
c o n fi g u p d ates
j sp- 2.2
fea tu re u p d ates
jsf - 2.0
ser vlet - 3. 0
w ab- 1.0
a p p u p d ates
ssl -1. 0
ta
r n sacti on- 1.1
j ndi- 1. 0
eo
s
iD
s
n
tb
a
e-1
s
a
.0
m onit or - 1.0
d
j bc- 4. 0
JD K 6. 0+
Figure 1-14 Liberty profile architecture
A functional server is produced by starting the runtime environment with a configuration that
includes a list of features that are to be used. Features are the units of capability, by which the
runtime environment is defined and controlled.
By default, a server runs no features. You can use the feature manager to add the features
that are needed. The feature manager maps each feature name to a list of bundles that
provide the feature. When a feature configuration is changed, the feature manager
recalculates the list of required bundles, stops and uninstalls those bundles that are no longer
needed, and then installs and starts any additions. All features are designed to cope with
other features that are added or removed dynamically.
35
In a Liberty profile configuration, the features of the profile provide the configuration default
values. Thus, user-specified configuration is kept to a minimum. Any property can be
overridden in a user-specific server configuration, and any changes that are made to the
configuration are dynamically injected into the contributing feature immediately. There is no
need to restart the server.
36
Part 2
Part
Migrating methodology
and common issues for
migration
In this part, we describe the migrating methodology and common issues for migration. These
topics are applicable to migrations from any Java Enterprise Edition (EE) platform to
WebSphere Application Server V8.5, and are not tied into a specific product.
37
38
Chapter 2.
39
40
Sample migration
A sample migration is defined by a migration of a single application that is representative of
the other applications. A representative application is one that has architectural and
implementation similarities with most of the applications that are migrated within
the enterprise.
This process can be repeated for more applications after the first one is complete. This
migration is the most common type of application migration because it lays a foundation for
future migrations that are based on challenges that are encountered in migrating the sample
application. You can also determine how quickly a migration can be done and highlight all the
problems that are faced so that you can build a concise plan.
Partial migration
Partial migration consists of migrating multiple or a few applications at a time in a phased
approach where the schedule can cover them until the project is completed. It is a good
choice when you have teams that own applications in a shared environment or when one
team owns multiple applications, which makes it impossible to migrate every application at the
same time because of time conflicts.
Applications that are written based on that same architecture and modularized can also be
used with this type of migration (for example, moving user interface modules before business
components or vice versa).
Full migration
Full migration is obvious, but has its own set of characteristics. When you decide to go with
this option, either you have a dedicated environment for an application or you must migrate
the entire environment because of certain reasons, such as end of support, impossible
interoperability of certain applications, and other possible issues.
41
Get the applications migrated with the smallest number of changes and as quickly
as possible.
Do not skip the migration assessment before you begin, whether it is considered a simple
or complex migration.
In the assessment, review the code and evaluate how compatible your code is with a new
platforms Java SE.
In the assessment, review the code and evaluate how applications are following or
deviating from Java EE specifications.
Do not forget Integrated Development Environment (IDE) migration.
Although both the application code and application servers (old and new) comply with
Java EE specifications, each vendor can implement their code in their own way and can
also provide extensions to the specification that must be migrated.
Do not change too much at a time. Use an iterative approach. Migrate a small portion of
code and test it, then go back and repeat the process. It is easier to find problems when
you have a small controlled environment.
Keep change variables small. For example, freeze code changes other than the changes
that are migration-related. Evaluate the changes that are needed for build scripts and
required runtime configurations.
Determine how to deal with Java SE and Java EE specifications. Should you compile
using compatibility with an earlier version or upgrade?
Do not replicate your performance tuning from a previous application server. Make
specific performance tuning decisions by using WebSphere.
Get interested parties to discuss the migration and make them interact with each other to
learn from previous implementations.
Never forget that there are tools to help in the migration process.
WebSphere Application Server V8 provides compatibility with an earlier version as far
back as J2EE 1.2. However, most of the older application codes include third-party
libraries, use vendor-specific extensions, and use non-public APIs. These codes must be
redesigned, replaced, and reimplemented.
There are cases where we face external factors that contribute to migration complexity
and requires attention from all interested parties. These external factors are integrations
with existing systems and interoperability between migrated applications that are
dependent of other applications functionality or services.
Always include a rollback plan. A rollback plan is critical to the business to ensure that the
migration does not include any unplanned downtime. It is also important to practice the
rollback plan before you attempt migration of the production system. In addition, make a
backup copy of your code before you start a migration.
42
The migration assessment is the starting point of a migration. There is no other way to know
the scope, expectations, current environment, teams that are involved, and all other relevant
information to the migration team except by research. The information that is gathered during
the assessment phase provides an understanding of the application environment. This
information can be used during the planning stage.
This section describes how the assessment can be conducted and the artifacts that can be
produced during this stage.
43
These examples are ones of how the report assessment helps the migration, as the better the
report, the better the project plan and the implementation.
Some tasks can be done in parallel (education, setup, testing, and so on).
44
This list is not final, so you can add or remove sections that fit your needs. Documenting
findings from migration implementation is helpful for future migrations.
Production rollout resources may be different from migration resources.
45
Prepare phase
During this phase, check for product and application prerequisites. You should have
hardware, software, and people available. Set up development environments, schedule
meetings, provide education, and get help if needed.
Migrate phase
Start migrating both application code, runtime environments, and the Integrated
Development Environment (IDE). Always remember that the assessment report is your
reference; you can find important information regarding the decisions that are taken and
sometimes even code review feedback that states the challenging areas of the migration.
You must decide about the migration type, so document everything that is happening and
you benefit from your feedback immediately. If you are a project manager or a delegate,
your role is important in addressing issues that are raised when everyone is together or
interfacing with other parties, such as software and hardware vendors or third-party
service providers.
The migration and test phases are closely integrated. It might be useful to test small
pieces of functionality until you have everything migrated. This approach helps in
two ways:
Challenges of first migrated functionality serve as input to other migrations and speeds
up the process.
Tests run in parallel with code migration and are prepared for QA and load tests after
migration is complete.
Test phase
The test phase is dynamic and has intersections with the migrate and rollout phases.
There are three main types of tests that are welcome in a migration process:
Hands on testing, which is done together with application migration
46
Functional/regression testing to make sure that all functions are working as expected
Load tests to assess whether the application/server is performing equal or better than
the previous environment
Rollout phase
The rollout phase starts after all previous tests are completed and you ensured that the
application is ready to provide the same or better responses than the previous
environment. We know that there are issues that are only raised during production, which
is why you have plans and the other previous phases to prevent or nullify chances of
rollout back outs.
Deploy the application into the production environment, run the tests again, and if
everything is okay, then decide whether to proceed. Usually, these rollouts require a
detailed plan with milestones, owners, and check points to put the team together and
address any problems or initiate the backout plan.
Rollouts with interoperability and interfaces are much harder to implement because of the
potential compatibility problems with the existing applications. Be mindful about these
challenges and prepare plans to prevent these issues. A good approach is to have this
migration occur during a maintenance window so that you can stop external inputs to the
systems affected and test integration and interoperability, to minimize the risks of having
tests that are mixed with actual valid requests. A cleanup of databases or message
queues might also be needed.
Cleanup phase
This phase starts when you successfully deploy the migrated application into production.
There are tools that help monitor performance and system stability that are useful in this
phase. Assign specialists to make the appropriate tuning of settings that might be
required. Make the changes in the non-production environments before you make them in
the production environment and run through the test plans again.
47
These changes can be done manually or by using tools to speed migration. IBM Rational
Application Developer V8.5 has extended functions to help you in that matter. Additionally, a
new Migration Toolkit is released that helps you migrate applications from Oracle WebLogic,
Oracle Application Server, JBoss, Tomcat, and previous versions of WebSphere application
servers to IBM WebSphere Application Server V8.x. For applications that use annotations,
Rational Application Developer can provide them through WRD tags to build and maintain
applications that are using EJB 3.x, web services, and other components. Other tools are
also available to provide you with guidance in code reviews.
Application migration has common steps to be followed. Details about the technical activities
are covered in the following chapters:
48
49
3. While you are importing your project, if you have not added WebSphere Application
Server into the workspace, you must click New in the Enterprise Application Import
window to select the target run time (Figure 2-5).
4. Click Finish. In the next window, select the JAR file to be imported (Figure 2-6).
Importing the Java source code: Importing the EAR file builds the project structure for
the application, web modules, and EJB modules. Usually, the EAR file does not include the
Java source code, and it must be imported as an additional step.
50
51
3. Browse and select Select root directory or Select archive file, then select the projects
that you want to add (Figure 2-8).
Figure 2-8 Browse and select the root directory or archive file
4. Click Finish.
52
Migration also includes specific tasks from product-to-product. We try to cover those task in
our product-specific chapters.
IBM migration specialists have been working in these environments for a long time. Expertise
in migrations and in the target implementation environment is important and, in a few cases,
crucial to minimizing disruption during implementation.
53
WebSphere education
WebSphere education helps you build and enhance our WebSphere skills. It has more than
250 courses across both the WebSphere software portfolio and SOA. It provides flexible
classroom, online, and private courses. The courses are designed by award winning
instructors with first-hand product knowledge.
The role-based training path in WebSphere education assists you by defining a path to
acquiring skills for specific WebSphere product offerings. For a list of WebSphere education
offerings, go to:
http://www-01.ibm.com/software/websphere/education/
Migration Discoveries
Helps customers understand the value proposition that is provided by WebSphere and the
advantages to be gained over the competitive application servers.
Migration Assessments
Provides thorough application analysis with specific recommendations about the steps and
methodology to be used to migrate competitive application server-based applications. In
addition, provides implementation assistance to clients and ISVs to accelerate time-to-value
and mitigate risk.
2.6 Summary
This process and activities are not supposed to be a final methodology or even the only way
to go through a migration project. Instead, it helps you to be prepared and anticipate
challenges to come. Following this process as a base for your own projects definitely helps.
As you can see, there are several factors that influence your planning, but basically two
things are essential:
A migration assessment with the assessment report used as the input to the project plan
Using an iterative process where first waves or iterations serve as a knowledge base for
future ones
Another thing that is important to note is that the approach of migrate first and improve later is
a good way to separate pitfalls of both activities, although they are related.
55
56
Chapter 3.
57
58
If you want to avoid such problems, you must understand the fundamental mechanism of
class loading and classloaders within WebSphere Application Server. The following section
includes an explanation of configuration options for the classloader and how they can be
used with the WebSphere Application Server V8.5.
The classloader hierarchy and delegation model are common between WebSphere
Application Server V6.1, V7.0, and V8.x. There is one additional feature, which is called the
isolated shared library, which is introduced with Version 7.
59
60
The top box in Figure 3-3 represents the Java classloaders (bootstrap, extensions, and
application). WebSphere loads the just the components that it needs to bootstrap itself and to
initialize the WebSphere extensions classloader.
Information about the other components in this hierarchy is covered in the following sections.
Web modules
EJB modules
Resource adapter archives (RAR files)
Utility JAR files
Application client modules
61
The application classloader is responsible for loading resources that are part of an EAR
module, for example, utility JAR, EJB modules, resource adapter files, and shared libraries.
Depending on the classloader policy, this classloader can be shared by multiple applications
(EAR files) or can be unique for each application, which is the default.
The class-loading behavior of an installed enterprise application can be configured at the
application server level. For each application server in the system, you can set the
classloader policy to either Single or Multiple. From the administrative console, click
Servers Server Types WebSphere application servers and click the correct server.
Then, on the Configuration tab under the Server-specific Application Settings section, select
the appropriate classloader policy (Figure 3-4).
When the application server classloader policy is set to Single, a single application class
loader is used to load all EJB, utility JAR files, and shared libraries within the application
server (JVM). If the WAR classloader policy is set to use the Single classloader for
application option, the web module contents for this particular application are also loaded by
this single classloader.
There are limitations when you use this mode, such as for JSF applications. For more
information, see:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-mp&topic=cwebjavaserverfaces
When the application server classloader policy is set to Multiple, which is the default, each
application receives its own classloader for loading EJB, utility JAR files, and shared libraries.
Depending on whether the WAR classloader policy is set to use the Classloader for each
WAR file in application option or the Single classloader for application option, the web
module might or might not receive its own classloader.
62
The web module classloader loads the contents of the WEB-INF/classes and WEB-INF/lib
directories. By default, web modules receive their own classloader, a WAR classloader, to
have a classloader for each WAR file in the application. It is possible to modify the default
behavior by changing the applications WAR classloader policy. You can find this policy
setting in the administrative console by clicking Applications WebSphere Enterprise
Applications, select the application, and click Class loading and update detection WAR
class loader policy, which opens the window that is shown in Figure 3-5.
If the WAR classloader policy is set to the Single classloader for application option, the web
module contents are loaded by the application classloader in addition to the EJB, RAR files,
utility JAR files, and shared libraries. The application classloader is the parent of the
WAR classloader.
Tip: During the authors migration experiences, we encountered clients that require
enterprise applications to communicate across various WebSphere cells. In this case, a
CORBA style and an explicit JNDI name are specified. For more information about this
topic, see:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was
-nd-mp&topic=cejbbindingsejbfp
63
There are two possible options for the class loading mode:
Classes that are loaded with the parent classloader first
This mode is the default mode for all classloaders. It is the Java EE and Java standard.
The loading of the resources is first delegated to the parent classloader. If the parent
classloader is unable to find the resource, the child classloader tries to handle it.
Classes that are loaded with the application classloader firs
Using the parent last class loading policy makes the classloader work opposite of the
parent first mode. The resource is loaded from the application or web module classloader
first. If the resource is not found, the loading is delegated to the parent classloader.
In previous WebSphere releases, these settings were called PARENT_FIRST and PARENT_LAST.
Shared libraries
Shared libraries are files that are used by multiple applications. Examples of shared libraries
are commonly used frameworks, such as Apache Struts or log4j. You use shared libraries
typically to point to a set of JAR files and associate those JAR files to an application, a web
module, or the classloader of an application server. Shared libraries are useful when you
have different versions of the same framework that you want to associate to
different applications.
Shared libraries are configured using the administration console and can be defined at the
cell, node, server, or cluster level. Before you use shared libraries, they must be associated
with an application, a web module, or the classloader of an application server level.
Bundled libraries
WebSphere Application Server V8.5 contains open source libraries that are in the server
class path. If you are using the same libraries and there is a version mismatch, you might
receive one of the following errors:
java.lang.NoSuchMethodError
java.lang.ClassCastException
java.lang.NoClassDefFoundError
To fix these errors, you can try to experiment with various class loading policies, such as
parent last instead of parent first.
The following list details the common libraries that might create problems:
WebSphere Application Server V8.5 includes the Jakarta Commons Logging (JCL), which
is known to cause problems when you migrate.
The following topics describe how to solve JCL problems on WebSphere:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=w
as-nd-mp&topic=ctrb_classload_jcl
http://www.ibm.com/support/docview.wss?uid=swg27004610
JDom is also bundled with WebSphere Application Server V8.5.
64
For more information, see WebSphere Application Server V6.1: Classloader Problem
Determination, REDP-4307.
65
The Java EE standard deployment descriptors are mapped to the WebSphere Application
Server V8.5 specific deployment descriptors with IDs, as illustrated in Example 3-1 and
Example 3-2. The ID in the WebSphere Application Server V8.5 specific deployment
descriptor must match the one in the Java EE standard deployment descriptor.
Example 3-1 Web.xml excerpt
...
<resource-ref id="ResourceRef_2">
<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
...
Example 3-2 WebSphere Application Server V8.5 deployment descriptor excerpt
...
<resRefBindings xmi:id="ResourceRefBinding_1117409057536"
jndiName="jms/QueueConnectionFactory">
<bindingResourceRef href="WEB-INF/web.xml#ResourceRef_2"/>
</resRefBindings>
...
WebSphere Application Server V8.5 validates the deployment descriptors more strictly
than, for example, JBoss and Oracle Weblogic, which leads to the following problems
when migrating:
Deployment descriptors fail validation because the elements are not in the correct
order or the DTD is incorrect.
JSPs do not compile.
Use web.xml to map JNDI references that are placed on vendor-specific deployment
descriptors. If you are migrating to Java EE 6, you are likely using annotations that simplify
references using embedded dependency injection that is implemented by WebSphere
Application Server V8.5, such as @EJB.
The switch JNDI reference mapping since WebSphere Application Server V8.5 JNDI
standards is different than in other vendors. It is usually different in all other vendors, so it
is actually a migration issue for almost every application server to another.
Next, we show an example of how the standard Java EE web.xml deployment descriptor and
WebSphere Application Server V8.5 are mapped with IDs. In the example, a resource
reference, with the ResourceRef_2 ID, is mapped to a JNDI name that points to a resource
that is managed by WebSphere Application Server V8.5. See Example 3-1 and Example 3-2.
66
Table 3-1 lists the Java EE standard and vendor-specific deployment descriptors.
Table 3-1 Java and vendor deployment descriptors and configuration files
Description
Java EE
specification
WebSphere
Application Server
V8.5
Apache
Tomcat
JBoss
Oracle
Application
Server
Oracle
WebLogic
EAR
application
application.x
ml
ibm-application-b
nd.xmi
ibm-application-e
xt.xmi
N/A
jboss-app
.xml
orion-applicat
ion.xml
weblogicapplication
.xml
WAR
application
web.xml
ibm-web-bnd.xmi
ibm-web-ext.xmi
context.xml1
jboss-web
.xml
orion-web.xml
weblogic.
xml
EJB
application
ejb-jar.xml
ibm-ejb-jar-bnd.
xmi
ibm-ejb-jar-ext.
xmi
ibm-ejb-accessbean.xml
N/A
jboss.xml
jaws.xml
jbosscmpjdbc.xml
orion-ejb-jar.
xml
weblogic-ej
b-jar.xml
weblogiccmp-rdbms
-jar.xml
persistence
-configurat
ion.xml
J2EE client
application
applicationclient.xml
ibm-applicationclient-bnd.xmi
ibm-applicationclient-ext.xmi
N/A
jbossclient.
xml
orion-applicat
ion.xml
oracleapplicationclient.
xml
clientapplication
.runtime.
xml
Server
configuration
Not covered by
the Java EE
specification
Mainly in
<was_home>\profil
es\<profile_name>
\config\
cells
Mainly in the
<tomcat_
home>\conf
directory and
<web_app>\
META-INF/
context.xml
Mainly in
the
<jboss_ho
me>\serve
r directory
Mainly in
ORACLE_HOME\j2
ee\<server_nam
e>\config
directory
Mainly in
<domain_
home>\confi
g.xml
1. The context.xml file can have JNDI names and a configuration that would normally be in web.xml.
WebSphere Application Server binding and extension files that are defined in Table 3-1 can
be in XMI or XML format depending on the Java EE version of the application. XMI formatted
files are used with a J2EE version of 1.4 and earlier. Starting with Java EE 5, binding and
extension definitions support files with the suffix of XML for EJB 3.x and Web 2.5 and later
modules. During migrating an application, it is important to include the correct file format with
the application. If an application is developed with Java EE 5 or later, bindings and extensions
are expected in the XML file format.
New in V8.5: WebSphere Application Server V8.5 supports the Java EE 6 and the EJB 3.1
specifications, which allow developers to use annotations in their source code. These
annotations contain information about how the application should be deployed, making
much of the packaging and deployment tasks. Annotations can also reduce the number of
classes and interfaces that the developer needs to manage within the project.
67
In previous Java EE versions, deployment descriptors are necessary to tell the application
server how to deploy the modules and how clients should locate EJB interfaces. In Java EE 6
applications, the use of deployment descriptors is optional. If the code is correctly annotated,
the EAR file or modules do not need to contain any deployment descriptors when you migrate
to WebSphere Application Server V8.5.
Utility JARs
Common utility JAR (Java ARchive) or class files are common application code and are
also used by other modules and deployment descriptors for a Java EE application client.
Every application is unique and its requirements are different; it is not simple to determine
where best to place a utility file.
To use the utility JARs that come with your packages, it is important to determine where
these files should be included in the WebSphere Application Server environment and
which classloader policy settings should be used. If the utility JARs are shared by more
than one enterprise application, you can configure a shared library at the server, node, or
cell scope, depending on where the applications using these shared libraries are, and
associate it with all the applications that use it.
If multiple modules within the application need this utility file, you can place the utility file in
the root directory of the EAR, and modify the manifest.mf file to reference the utility JAR.
After you place the utility file in the correct location, you can alter the classloader settings
to use a utility file that is already included with WebSphere Application Server.
For example, Apache Log4j is a popular logging implementation to perform logging from
both the EJB module and the web modules. It is tempting to configure log4j as a utility JAR
so you have only a single copy of it in your EAR or keep the JAR file in each EJB and web
module. For more information about this topic, see WebSphere Application Server V6.1:
Classloader Problem Determination, REDP-4307.
RAR (Resource Adapter)
A resource adapter is a system-level software driver, also called a connector module, that
a Java application uses to connect to a back-end enterprise information system (EIS),
such as CICS, SAP, and PeopleSoft. RAR files are packaged as a standard Java archive
with a .rar file extension. It also contains a mandatory deployment descriptor file named
ra.xml that is in the modules META-INF directory.
Figure 3-6 illustrates the preferred way of packaging an application.
EAR
META-INF/application.xml
Log4j.jar
utility.jar
EJB
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Class-Path:
log4j.jar
utility.jar
WAR
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Class-Path:
log4j.jar
utility.jar
ejb.jar
69
The migration and creation of the package can be better accomplished by using Rational
Application Developer V8.5. When you use Rational Application Developer V8.5, you can
look for any potential migration problems easily, and it assists you with the creation of the
configuration of the server.
Tip: If you are moving a project into Rational Application Developer, export the project
from your source Eclipse as an EAR file that includes the source, and then import this file
into Rational Application Developer. If you choose to import the file as an existing project,
you must manually enable the Project Facets for WebSphere (co-existence) and
WebSphere (extended).
Migration problems
In Java EE 6 applications, EJB 3.1 content can be packaged and deployed as part of a WAR
file. A bean that is packaged inside a WAR module has the same behavior as a bean that is
packaged inside an EJB JAR module.
Tip: Always include the version number of libraries, frameworks, and applications in either
the MANIFEST.MF or the name of the file. During our migration process, we were unable to
identify the version of many frameworks. Knowing the version number is critical when you
need support.
During the migration of the sample applications that contain a previous Java EE specification,
we discovered the following packaging-related problems:
EJB module references classes in the WAR module
The application worked on JBoss because of the JBoss Unified classloader flat hierarchy.
It stops working when deployed to WebSphere Application Server V8.5, because the EJB
cannot view what the WAR module contains.
Tip: The EJB module should not depend on classes in the web module. This situation
creates a dependency that does not work on platforms other than JBoss. Extract these
classes from the web application module and put them in a utility JAR. Use the
META-INF/MANIFEST.MF file to declare the dependency.
EJB module references libraries that are in the WAR module
In one application, EJBs imported classes from both Apache Axis and Apache Struts. The
required JAR files are in the web modules WEB-INF/lib folder and are only visible to
that module.
Tip: Dependencies on libraries that are shared between Java EE modules in an
application are in the root of the EAR file. The modules that have the dependencies
should declare the dependency by using the META-INF/MANIFEST.MF file.
You can place common JARs in a shared library in WebSphere and set the scope to
Application. All modules in the EAR file are able to use such libraries. Shared libraries
can also be set at the server scope.
70
Sometimes migration happens in many areas, including operating systems, so make the
code portable after you move to the new server. Migrating applications that make usage of
native code might also require the native code to be recompiled, for example, in a migration
from a 32-bit environment to a 64-bit environment. In addition, changes in the Java code that
call the JNI API might be needed as the JNI specifications can change from version
to version.
Additionally, when you define shared libraries, if a native path for loading JNI libraries is set,
check it as well.
71
72
...
context = new InitialContext(env);
remote =
(CustomerServiceRemote)context.lookup("com.ibm.itso.CustomerServiceRemote");
...
To run thin clients, you need to install the Java EE and Java thin application client, which
is part of the WebSphere Application Server V8.5 installation package and can be
installed separately.
73
For more information about how to run and develop thin clients, see the WebSphere
Application Server V8.5 Information Center:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was
-nd-mp&topic=welc6tech_cli_dev
Applet application client
The Applet application client provides a browser-based Java run time capable of
interacting with enterprise beans directly, instead of indirectly through a servlet. A Java
applet that is embedded in an HTML document runs in a web browser.
ActiveX to EJB Bridge application client
The ActiveX application client allows ActiveX programs to access enterprise beans
through a set of ActiveX automation objects. The ActiveX application client uses the Java
Native Interface (JNI) architecture to programmatically access the Java virtual machine
(JVM) API. The ActiveX to EJB Bridge is supported on Windows systems only.
For detailed capabilities about each client container, search on Client Application at the
Information Center, or go to the following website:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-mp&topic=tcli_developactivex
Several types of clients are installed either with WebSphere Application Server or, optionally,
with the Application Client for WebSphere Application Server (Figure 3-7).
Figure 3-7 Clients that are provided for WebSphere Application Server
74
J2EE
Java EE 5
Java EE 6
Web
2.2
2.5
3.0
EJB
1.1
You can migrate
EJB 1.1 to EJB 3 or
EJB 3.1, providing
that there are no
CMP or BMP
beans (EJB 1. x
and 2. x projects
with CMP or BMP
beans can be left
as is in a Java EE
EAR).
3.0
3.1
JDBC
3.0
4.0
4.1
75
Specification/API
J2EE
Java EE 5
Java EE 6
JCA
1.0
1.5
1.6
JPA
n/a
2.0
2.0
JMS
1.1
1.1
1.1
Java Servlet
2.4
2.5
3.0
JSP
2.0
2.1
2.1
JSF
1.0
1.2
2.0
CDI
n/a
n/a
1.0
JAX-RPC
1.1
1.1
1.1
JAX-WS
n/a
2.1
2.2
JAX-RS
n/a
n/a
1.1
Bean Validation
n/a
n/a
1.0
SIP
n/a
1.1
1.1
EAR
1.2
5.0
6.0
Application Client
1.2
5.0
6.0
WebSphere Application Server V8.5 supports applications that are written to Java EE 6 and
supports portable applications that are written for the previous Java EE versions, specifically
Java EE 5, Java 2 Platform, Enterprise Edition (J2EE) 1.4, and J2EE 1.3.
If you plan to maintain your applications, consider migrating them to Java EE 6. This way, you
are up to date, and the changes in the next Java EE specifications are easier to carry out.
For more information about Java EE 6 new opportunities, see Experience JEE Using Rational
Application Developer V7.5, SG24-7827.
Using the Java EE specifications upgrade wizard within the Rational Application Developer
V8.5, complete the following steps:
1. In the Enterprise Explorer view, right-click the project that you want to upgrade, and select
Java EE Specifications Upgrade wizard.
2. Follow the instructions on the Java EE Specifications Upgrade wizard Welcome Page and
click Next.
3. In the J2EE version field, select the Java EE version level that you want to upgrade to and
click Next.
4. Select the modules that you want to upgrade, and click Finish (Figure 3-8).
Figure 3-9 through Figure 3-12 on page 78 show the modifications done by the Rational
Application Developer Jmigration process automatically. The specification level of modules
before and after the migration (Figure 3-9 and Figure 3-10 on page 78) and descriptors file in
the application package before and after the migration (Figure 3-11 on page 78 and
Figure 3-12 on page 78) are seen within the Rational Application Developer V8.5 as follows.
Figure 3-9 Increases the version level of the project facet - before migration
77
Figure 3-10 Increases the version level of the project facet - after migration
78
3.3.3 Servlets
Servlets are as old as Java EE implementations, which is why no issues were raised during
our migration. Because you are going to a new Java EE implementation with great
improvements in code maintainability, you might not want to lose the annotations.
The usage of new annotations (such as @servlet) helps avoid problems for teams that face
issues in updating deployment descriptors. If you do not want to maintain XDoclet, this
situation is a good opportunity to get rid of it.
Here are the new Java Servlet technology features that are included with the
Java EE 6 platform:
Annotation support
Asynchronous support
Ease of configuration
Enhancements to existing APIs
Pluggability
79
One of the most important considerations when you migrate a web services application is the
URL you use because you might need to update references to these services (in the
WSDL file).
You must consider the various approaches, depending upon your environment:
The first approach is to update and redeploy the application clients (the consumers for
your web services, represented by number 1 in Figure 3-13). For this approach, you must
rewrite the application client and the references that point to the new WSDL provider.
Depending on how many consumers use the service, it can take too much software
development and deployment effort. If the web service is published on the Internet, this
approach is not viable.
If your web service is developed and installed over a three tier infrastructure, you can also
make changes only on the upper tier, such as a Load Balancer, NAT, or Reverse Proxy
devices (see number 2 in Figure 3-13). In this case, you must reconfigure these devices to
point to the new URL for the web service.
Looking to the first tier in your architecture (see 3a and 3b in Figure 3-13), you probably
have web servers as front-end devices for static pages, and another web application and
proxy for the application server itself. For example, if you use IBM HTTP Server, you can
use the HTTP modules to replace the old URLs with the new ones. For more information,
visit the Apache HTTP Modules (mod_redirect, mod_proxy, mod_rewrite, and mod_alias)
web page at the Apache HTTP website:
http://httpd.apache.org/docs/2.2/mod/
80
Because you are likely moving from one application server to another (layer 4 in
Figure 3-13 on page 80), you should consider development issues when you build it on
Rational Application Developer. If possible, try to avoid changes on the URLs (server
name and server port) and path names (context root and servlet mappings). If you do not
change these items, it is easier to migrate and keep connectivity with other client
applications. It is not possible to keep the same URLs because you might need to move to
other servers or even to another infrastructure. In these cases, you should consider the
other options to remap the URLs.
81
82
JMS resources
A common issue in migrating JMS resources is that the way each application server
configures JMS resources varies from vendor to vendor.
Before migrating JMS definition to WebSphere, you should decide which messaging engine
to use to exchange messages asynchronously. WebSphere Application Server supports the
following messaging providers:
The WebSphere Application Server default messaging provider (which uses the service
integration bus as the provider).
The WebSphere MQ messaging provider (which uses your WebSphere MQ system as
the provider).
Third-party messaging providers that implement either a JCA Version 1.5 - 1.6 resource
adapter or the ASF component of the JMS Version 1.1 specification.
Your applications can use the messaging resources from any of these JMS providers. In
WebSphere Application Server V8.5, before you define or create the JMS resources (such as
queues, topics, and connection factories), you can first create a service integration bus. A
service integration bus in WebSphere Application Server V8.5 is the back end that is used by
the default messaging provider.
Listener ports: The default messaging provider (SIB) does not use listener ports. The
only applications that connect through listener ports to SIB would be using older
WebSphere MQ type configurations, which are mainly for supporting WebSphere
Application Server 5 type applications (the Version 5 default messaging provider)
connecting through an MQClientLink. MDBs using SIB connect using activation specs, and
MDBs connecting to WebSphere MQ messaging provider can connect through listener
ports or activation specs. The Version 5 default messaging provider is removed from
WebSphere Application Server V8.5.
For more information about messaging, including tutorials and samples, can be found at the
Information Center at:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-mp&topic=welc6tech_msg
JDBC resources
Reconfiguring the JDBC resources is probably the most common migration step between
application servers. Generally, migrating from application servers might also require the
migration of database products or versions, which requires JDBC drivers updates, so be sure
to use the appropriate JDBC driver to avoid problems with new implementations for new
databases. When you keep the database, ensure that you are using the correct driver as well.
83
JDBC drivers can be supplied by database vendors or by application server vendors. Use the
drivers that are provided by the database vendor. Changing drivers is normally transparent to
the applications, unless nonstandard extensions or driver-specific properties is not used. If
applications are written to the standard JDBC (4.0), the specifications work correctly and
require minimal migration effort.
In WebSphere Application Server V8.5, there are three configurations to be performed to set
up a data source:
The JDBC driver, which is usually ready to go for most databases
J2C Authentication data, where you configure the user and password to be used to
connect in the database
The data source itself
For more information about configuring JDBC resources, see:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-mp&topic=welc6tech_dat
Security resources
There are several areas where you configure security resources for your migrated
applications and the administrative functions and roles, such as authentication mechanisms,
authorization mechanisms, and security for web services.
Because this area is a sensitive one of migration that probably involves security standards
that must be applied (such as ITCS 104 (Information Technology Security Standards, which
are internal IBM security standards), you should see the appropriate reference materials that
are available. A few basic configurations are shown in the product-specific migration chapters
of this book.
For more information about security configurations and resources on WebSphere Application
Server V8, see:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-mp&topic=welc6topsecuring
Also, see WebSphere Application Server V7.0 Security Guide, SG24-7660.
85
There are cases where you face problems with this approach (for example, choosing a
sample application migration that is serving components or services to other applications,
such as EJBs).
Migration complexity discussions require a good amount of time to decide how to move
forward when there are integrations with existing systems. Integration is a sensitive topic in
the middleware world, despite standards, tools, and a proven architecture that minimizes its
complexity. When you manage or participate in a migration project, remember that
integrations are not as easy as changing configurations or a few lines of code. Integrations
require the revision of standards and compatibility. In many cases, the team should consider
it a separate project.
86
Part 3
Part
Migrating your
applications to
WebSphere Application
Server V8.5
This part describes how to migrate your Oracle WebLogic Server, Oracle Application Server,
Red Hat JBoss, and Apache Tomcat J2EE applications to WebSphere Application Server
V8.5.
This part provides detailed information to plan migrations, suggested approaches for
developing portable applications, and migration working examples for each of the platforms
from which we migrated. The primary tool that is used in the migration scenarios that are
covered in this book is the IBM WebSphere Application Server Migration Toolkit V3.5.
87
88
Chapter 4.
89
Figure 4-1 Steps for planning and implementation for migrating an application
90
As you can see in Figure 4-2, application changes and testing is 42% of the whole
migration process.
The Migration Toolkit is a set of plug-ins for Eclipse and Rational Application Developer
products, which reduces the cost and duration of application migration processes. It includes
several migration tools, each of which can be used for migrating applications from different
application servers. The Migration Toolkit includes the following migration tools:
Application Migration Tool - WebLogic to WebSphere (see Application Migration Tool WebLogic to WebSphere on page 133)
Application Migration Tool - Oracle AS to WebSphere (see Application Migration Tool Oracle AS to WebSphere on page 222)
Application Migration Tool - JBoss AS to WebSphere (see Application Migration Tool JBoss AS to WebSphere on page 236)
Application Migration Tool - Apache Tomcat to WebSphere (see Application Migration
Tool - Apache Tomcat to WebSphere on page 275)
Application Migration Tool - WebSphere Version to Version (see Application Migration
Tool - WebSphere Version to Version overview on page 358)
These tools are based on IBM Rational Software Analyzer, which has code scanning
capabilities that help identify code constructs that must be reviewed and possibly changed
while you migrate an application.
The process of converting Java applications can involve modifying Java source code, JSP
files, deployment descriptors and XML files, and class path information, which can be a costly
and time-consuming process. The tools also have rules for Java SE version migration that
identify migration issues that can occur when you change the version of the Java run time.
There are additional rules to improve code regarding Java coding preferred practices.
The tool flags a number of known differences between applications that are hosted on Oracle
WebLogic, JBoss, or Apache Tomcat and WebSphere Application Server. In many cases, the
tool can automatically convert these key differences. If the tool is unable to perform the fix, it
flags the file in question to provide insight as to where changes are needed and how to
perform a manual fix.
91
92
After the changes are done, you should see no red Xs (Figure 4-4) next to the name of the
application in Enterprise Explorer, which is a sign that there should be no errors that prevent
the application from running on the target application server.
Figure 4-4 Modules with red Xs indicating that there are one or more errors
In Figure 4-5, you can see the workflow of migrating a competitive application server
application (or a previous version of WebSphere Application Server) to a WebSphere
Application Server V8.5 application.
93
You can use the Migration Toolkit to create multiple configurations, which eliminate the
requirement of deleting and re-creating configurations each time you plan a migration
analysis for different application servers or migration strategies.
The Migration Toolkit can also generate reports for you to better estimate the scope of the
migration of your applications. The reports summarize your past analysis records, and
provide a high-level output of the application codes quality, complexity, and structure. You
can generate an analysis report after you run an analysis by clicking the icon in the right pane
in the Software Analyzer Results window (Figure 4-6). You can also generate reports for your
historical scans.
Figure 4-6 Software Analyzer Reporting pane for creating analysis reports
94
For Java code reviews, you can create the analysis report as PDF or HTML formats. You see
an HTML report example in Figure 4-7. For Java, XML, JSP, and class path code reviews, you
can export the analysis records in XML format.
At the time of the writing of this book, the latest version of the Migration Toolkit is V3.5, and it
currently supports the following migration operations:
Migrating applications to WebSphere Application Server Version 7, 8, or 8.5
Migrating WebLogic Java, JSP, and class path artifacts (Java EE 5 and earlier versions)
Migrating WebLogic deployment descriptors (Java EE 5 and earlier versions)
Migrating JBoss Java and class path artifacts (Java EE 5 and earlier versions)
Migrating JBoss deployment descriptors (Java EE 5 and earlier versions)
Migrating OracleAS Java and JSP artifacts (Java EE 5 and earlier versions)
Migrating OracleAS deployment descriptors (Java EE 5 and earlier versions)
Migrating Apache Tomcat Java and JSP artifacts (Java EE 5 and earlier versions)
Migrating Apache Tomcat Context XML information that is contained in the application
Providing assistance for migrating applications using third-party frameworks (Spring,
Hibernate, and Seam)
Migrating applications to later Java SE run times, from Java SE 1.4, 5, or 6 to either Java
SE 6 or 7
The Migration Toolkit is publicly available at no additional cost, with detailed documentation
to ease the migration of Java EE applications from various application servers to WebSphere
Application Server. Support for the Migration Toolkit is also included for WebSphere
Application Server customers.
95
Getting help
You can use a context-sensitive function while you work with the Migration Toolkit. When you
work on either Eclipse or Rational Application Developer, press F1 to view help topics about
the current issue (Figure 4-8).You can also see the Help contents by clicking Help
Dynamic Help.
96
First, you should download the Application Migration Tool that is suitable for the application to
be migrated. We selected WebLogic to WebSphere Application Migration Tool for our
example. For more information about the analysis phase, see the corresponding chapters in
this book. The migration steps for each application server are explained in detail in its
own chapter.
You can download and install the Application Migration Tools by completing the
following steps:
1. Download the Application Migration Tool suitable for the application server to be migrated
from. We used the Application Migration Tool - WebLogic to WebSphere for our example.
The Application Migration Tools and documentation can be downloaded at:
http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/compmig.html
2. From the menu bar, click Help Install New Software.
3. In the Install window, click Add.
4. In the Add Site window, enter the following information (Figure 9-6):
Name: Enter an appropriate name for the tool, for example, Application Migration Tool
WebLogic to WebSphere
Location: Enter the location of the compressed file that you downloaded, for example,
C:\MigrationToolkit\Application_Migration_Tool_WebLogic_to_WebSphere_v3.5.0.
zip.
Figure 4-9 Add Repository window for adding the Application Migration Tool as a repository
97
5. In the Install window, select the plug-in that you want to install (Figure 9-7). Click Next.
6. Accept the license agreement and click Finish to begin the installation.
7. After the installation is completed, click Restart Now to restart Rational
Application Developer.
The Application Migration Tool is now installed and ready to be used. You can analyze your
applications by clicking Run Analysis and creating the appropriate run configuration. You
can find details about the analysis phase in the chapters that are related to the application
server you want to migrate from.
98
3. If Rational Application Developer does not discover your server, you can create it
manually, as described in Installation verification on page 115.
4. For the rest of the installation, you can follow the steps that are described in 4.2, Installing
the Application Migration Tools on Eclipse on page 96, starting with step 2 on page 97.
Installing the Application Migration Tools: The steps for installing the Application
Migration Tools on Eclipse and Rational Application Developer are identical, except for the
discovery step (step 2 in 4.3, Installing the Application Migration Tools on Rational
Application Developer V8.5 on page 98).
<installLocation>\eclipsec.exe
-application org.eclipse.equinox.p2.director -metadataRepository
jar:file:C:/<amtDownloadDir>/Application_Migration_Tool_Weblogic_to_WebSphere_vn.n
.n.zip!/ -artifactRepository
jar:file:C:/<amtDownloadDir>/Application_Migration_Tool_Weblogic_to_WebSphere_vn.n
99
installIU
JBossAS
com.ibm.ws.appconversion_feature.jboss.fea
ture.group
Oracle AS
com.ibm.ws.appconversion_feature.oracle.fe
ature.group
WebLogic
com.ibm.ws.appconversion_feature.weblogic.
feature.group
com.ibm.ws.appconversion_feature.was2was.f
eature.group
Apache Tomcat
com.ibm.ws.appconversion_feature.tomcat.fe
ature.group
The Application Migration Tools can be removed by using the appropriate installIU parameter
the same way you installed it (Example 4-2).
Example 4-2 Uninstalling the Application Migration Tools through the command line
<installLocation>\eclipsec.exe
-application org.eclipse.equinox.p2.director
-uninstallIU com.ibm.ws.appconversion_feature.weblogic.feature.group
-nosplash
For more information about the Eclipse p2 director application, see:
http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide
/p2_director.html
100
101
To start the analysis from the Launch toolbar, look for the icon that is shown in Figure 4-13
and click it.
To start the analysis from the Enterprise Explorer in Eclipse, right-click the project that should
be analyzed (Figure 4-14).
102
103
4. Click New Configuration to see the dialog changes to the basic configuration interface
(Figure 4-17).
In the Software Analyzer Configuration dialog, enter a name for the configuration, such as
SampleAppMigration. On the Scope tab, click Analyze entire workspace to scan all the
projects in the workspace. The scope of an analysis can be limited by using the other
options on this dialog to analyze a working set or a selection of projects.
Tip: When you use the Enterprise Explorer menu to run your analysis, the scope of the
analysis is limited to the node in the project where the menu item was selected. You
can perform a quick analysis on a limited set of code.
5. On the Rules tab, select the type of analysis to perform by using the Rule Sets list. From
the Rule Set menu, select WebLogic Application Migration, for WebLogic to
WebSphere Application Server migration.
The rule set contains rules in the following analysis domains:
Java Code Review: Examines the Java code to determine overall quality. The rules in
this domain can range from simple code style enforcement to more complex rules used
to detect null pointer issues.
Tip: Not all rules apply to all environments because some rules can generate many
results. In these situations, avoid running these rules or ignore the results that
they produce.
104
JSP Code Review: This category contains rules that are related to JSP code.
XML File Review: This category contains rules that are related to XML and associated
files.
Class-Path Review: This category contains rules that are related to class path issues
with included libraries.
Tip: To obtain more information about a rule, highlight the rule and press F1. Help
for the rule is shown in the configuration dialog. The initial help dialog includes a
short description and a link to more information.
105
6. After the WebLogic Application Migration rule set is selected, click Set to open the dialog
that is used to configure the version of WebSphere you are migrating to and the version of
Java you were using in WebLogic (Figure 4-19).
The target WebSphere Application Server version can be either Version 7, Version 8, or
Version 8.5. Also, select the source Java version that was being used. If the target
WebSphere platform is Version 8.5, both Java V6 or Java V7 can be selected.
Number of rules: The number of rules in the analysis configuration dialog varies
depending on the platform on which the tool is installed.
7. Click Apply to save the rule configuration and click Analyze. The results are shown in the
Software Analysis Results view (Figure 4-20).
Right-clicking individual results gives access to options, such as viewing the source code
where the problem occurred or correcting the problem with a provided fix.
No results: If no results are shown in the window, no issues were identified
while scanning.
106
107
After you click the icon, an analysis report for the currently selected result element can be
generated. For example, for Java Code Review, four options, shown in Figure 4-22,
are available:
The report can be generated in both HTML and PDF format. The generated files are put in the
workspace/.metadata/.plugins/com.ibm.xtools.analysis.reporting/reports directory.
108
To select a summary of the report, click Generate reports for historical scans. Figure 4-23
shows the sample report that is generated for Analysis Summary.
4.6 Troubleshooting
The Application Migration Tools write error information to two log files:
The workspace log (workspace/.metadata/.log) contains messages that are logged by
the Application Migration Tools and messages that are logged by Rational
Software Analyzer.
The service logs for the application migration tools are in the
workspace/.metadata/.plugins/com.ibm.ws.appconversion.base directory.
This log contains all error information and detailed trace information if trace is enabled.
Enable trace in the migration tools by setting the appconversion.trace system variable on the
command line to start the Integrated Development Environment (IDE) or in the eclipse.ini
property file:
Command-line option
Add the system variable to the command line that starts Eclipse:
eclipse.exe -vmargs -Dappconversion.trace=true
eclipse.ini option
Add the following option to the eclipse.ini file found in the same directory as the
eclipse.exe file:
-Dappconversion.trace=true
Tip: Running trace slows the tool. Turn it on only if requested to do so for service.
109
110
Chapter 5.
111
Figure 5-1 Feature portfolio for Eclipse and Rational Application Developer
112
5.2 Eclipse
Eclipse is an open source and platform-independent software technology that is a rich client
platform upon which you can create integrated software applications. Written in Java, Eclipse
is a modular integration platform with a sophisticated plug-in architecture that can be used to
combine many types of developer tools for many different programming languages.
Eclipse offers multiple packages for different development needs. You can see the
descriptions of all these packages and download them at:
http://www.eclipse.org/downloads/
Because your goal is to migrate Java EE applications from one application server platform to
another, the package that you should use is the Eclipse Integrated Development Environment
(IDE) for Java EE Developers package. This Eclipse package provides support for most
popular application servers and offers many features for developing Java and Java
Enterprise Edition applications, such as:
Java editing capability with incremental compilation
A graphical HTML/JSP/JSF editor
Database management tools
113
4. After the dependency check, select the feature you want to install in the Features window.
The WebSphere Application Server V8.5 Developer Tools feature must be selected.
5. Accept the license agreement and click Finish.
114
Figure 5-3 Security warning when installing WebSphere Application Server Version 8.5 Developer
Tools
Installation verification
The installation of the WebSphere Developer Tools for Eclipse can be verified by creating a
WebSphere Application Server V8.5 server by completing the following steps:
1. Right-click anywhere in the Servers view and select New Server.
2. In the New Server definition window, click IBM WebSphere Application Server V8.5
(Figure 5-4).
115
3. Enter the host name and a name for your application server and click Next.
4. Specify the installation directory of your application server. If the directory is correct, the
JRE selection is entered automatically. Click Next.
Tip: If your WebSphere Application Server instance is on another machine within the
same network, you can enter the host name of the remote server instead of localhost.
You should also enter the network path of the remote WebSphere Application Server
JRE directory to the JRE field. Additionally, the necessary ports and WebSphere
Application Server Java runtime directory must be accessible from the
Eclipse machine.
5. Select the appropriate profile and port information, enter your user name and password
that is based on your security settings, and click Next.
6. Choose the applications that must be configured on the server by moving them from the
Available section to the Configured section. Click Finish.
7. Your new server is now configured and ready to be started (Figure 5-5). If it is not already
started, right-click the new server in the Servers window and click Start.
Important: WebSphere Developer Tools For Eclipse supports security with created
servers only with Java equal to or greater than Version 6.0. If you are using WebSphere
V8.5 with global security enabled, then you must start Eclipse with the Java that comes
with WebSphere Application Server V8.5. To accomplish this task add the following lines
to the eclipse.ini file, which is in the Eclipse directory. The lines must be added just
before the -vmargs parameter, with $WAS_HOME being the WebSphere Application Server
installation directory.
For Windows:
-vm
$WAS_HOME\java\jre\javaw.exe
For Linux\AIX:
-vm
$WAS_HOME/java/jre/jawaw
We cover the WebSphere Developer Tools for the Liberty profile in 9.3.2, Installing the
developer tools on page 277.
116
When combined with Eclipse IDE for Java EE Developers, WebSphere Application Server
Developer Tools for Eclipse provides a lightweight environment for developing
Java EE applications.
The following sections describe the tools that come with WebSphere Application Server
Developer Tools for Eclipse.
OSGi
The Open Service Gateway initiative (OSGi) Applications framework provides a programming
model for developing, assembling, and deploying, as bundles, modular applications that use
both Java EE and OSGi technologies.
WebSphere Application Server Developer Tools contains all OSGi development
tools, including:
Deployment to WebSphere Application Server V8 and V8.5 OSGi bundle
repository support
Blueprint form editor and Blueprint validation Bundle explorer
Rational Application Developer V8.5 has new support for EJB applications. You can create an
OSGi bundle from an EJB facet. You can import or export an EJB as a bundle, and promote
an EJB as an OSGi service.
Java EE
You can use WebSphere Application Server Developer Tools for Eclipse to write applications
that works with the Java EE specification. Most of the programming models under the Java
EE umbrella are supported by both Rational Application Developer and WebSphere
Application Server Developer Tools for Eclipse, such as Servlets, JSP, EJB, JPA, JAX-RS,
JAX-WS, and JAXB.
Rational Application Developer supports all these tools. In addition, other tools for the Java
EE family, such as JSF and JAX-RPC, are found only in Rational Application Developer.
117
Using Rational Application Developer, you can build applications on the latest Web 2.0
technologies, such as HTML 5, CSS3, JavaScript, Dojo, and JSO. Using the Mobile Browser
Simulator, which is shown in Figure 5-6, you can easily develop and test mobile web
applications that are based on the dojox.mobile framework. Rational Application Developer
V8.5 includes IBM Worklight Studio V5.0 from the IBM Mobile Foundation family so that you
can also develop native or hybrid applications.
118
Want to learn more about Rational Application Developer and what is new with
Version 8.5? Check out the Rational Application Developer V8.5 What's New wiki at:
http://www.ibm.com/developerworks/wikis/display/rad/Rational+Application+Develo
per+V8.5+What%27s+New
In this wiki, you find many videos about most of the features that we explain in the following
sections and the new features that are available with Rational Application Developer V8.5.
These videos help you understand the added value that is provided by Rational
Application Developer.
Also, Rational Application Developer for WebSphere Software V8 Programming Guide,
SG24-7835 is an excellent reference for the features that are described in this section.
5.4.2 Visualization
Several visualization tools are provided in Rational Application Developer, including support
for the creation and editing of UML diagrams (including using the UML diagram to directly edit
Java interfaces and classes), support for visualization of XML documents, and schemas.
Visualization of Java classes, EJBs, JPA entity beans, and web services is another feature
that comes with Rational Application Developer. You can use it to configure all the Enterprise
beans in the same window, and perform such activities as EJB validation, refactoring, quick
fixes, and EJB Annotation view. Additionally, the editor includes sections and pages that are
related specifically to WebSphere Application Server bindings and extensions to the
EJB specification.
119
Portlet templates
Support for IBM Portlet API and the JSR 168 and JSR 286 standard portlet API
5.4.4 iWidgets
An iWidget is a small application or piece of dynamic content that can be easily placed into a
web page. It is a reusable application that is designed to work within the framework that is
defined by the iWidget specification.
An iWidget acts as a wrapper for any web content that you create, such as servlets,
JavaServer Pages (JSP) files, HTML, PHP, or CGI.
Portlet project features: Two new portlet project features are added in to Rational
Application Developer. These new portlet project features include the Dojo-enabled
portlets and the creation of iWidgets inside a portlet project. The Dojo-enabled portlets run
the portal runtime environment, with the option to create custom widgets that can be
reused and enhanced further for WebSphere Portal V6.1 and later. You can also create
and publish iWidget projects or create widgets inside a portlet project.
120
Rational Application Developer V8.5 provides a preview of SCA Tools for the development of
OASIS SCA V1.1 applications, including deployment to WebSphere Application Developer
V8.5. For more information about OASIS SCA 1.1, see http://oasis-opencsa.org/sca.
You can use the following SCA extension types:
Composite, and Java Implementation types
Default (SCA) and web service bindings
JAXB 2.0 data bindings
The SCA tools work closely with the Java (JDT) and web services tools, so you can locate the
various interface binding or implementation artifacts (Java interfaces, classes, and WSDL
port types), or use the new OASIS SCA annotations.
121
Rational Application Developer supports JSF 1.x and 2.0 specifications and tag libraries, and
provides a number of rich features to enhance your usage of the JSF framework:
JSF Trace
Integration of third-party JSF tag libraries
Customizable data templates
Voice-over-IP (VoIP)
Instant messaging
Click to call
Call notification, forwarding, and blocking
The SIP wizard in Rational Application Developer creates a web project with the appropriate
facets selected so that you can construct SIP applications.
122
5.4.11 Analysis
You can use the Analysis tools to analyze existing code to discover its architecture and to
discover potential software problems. Some (but not all) of this functionality is also available
as part of the Migration Toolkit.
5.4.12 Profiling
Profiling is a technique that developers use to collect runtime data and detect application
problems, such as memory leaks, performance bottlenecks, excessive object creation, and
exceeding system resource limits during the development phase.
You can use the profiling tools in the following cases to gather data on applications that are
running in these situations:
Inside an application server, such as WebSphere Application Server
As a stand-alone Java application
On the same system as Rational Application Developer
In multiple Java virtual machines (JVMs)
On a remote WebSphere Application Server with IBM Rational Agent
Controller installed.
IBM Rational Agent Controller V8.3 can be used for remote profiling on any WebSphere
Application Server server that runs the Java Development Kit (JDK) V1.5 or later.
5.4.13 Cloud
You can use Rational Application Developer for provisioning and using virtual instances of
WebSphere Application Server or WebSphere Portal on IBM SmartCloud Enterprise, and
elastic Virtual Application Pattern workloads for IBM Workload Deployer and IBM expert
integrated systems. Rational Application Developer supports cloud-based solutions to help
you better manage IT costs.
IBM SmartCloud Enterprise: IBM SmartCloud Enterprise is an agile cloud-computing
infrastructure that provides rapid access to security-rich, enterprise-class virtual server
environments, which are suited for development and test activities and other
dynamic workloads.
The IBM SmartCloud Enterprise can be accessed at:
https://www-147.ibm.com/cloud/enterprise/dashboard
123
124
To get this information for your project, right-click the project and select Preferences. In the
left pane, you can see the Code Coverage selection. In the Code Coverage properties
window, enable Code Coverage by selecting the line check box in the Package, Source file,
Type and Method coverage options. Then you can create new filters for project. (Figure 5-9).
You can get the results of your code coverage by clicking Run Code Coverage
Generate Reports.
As shown in Figure 5-10, you can use Code Coverage to find the results line by line.
125
When you run a Code Coverage enabled application on the server, you can choose to reset
the Code Coverage indicators so that Code Coverage data is collected fresh based on your
interaction with the application.
The other functions that are not on Eclipse can be listed to highlight what the differences
between Eclipse and Rational Application Developer 8.5 are:
Java EE Connector Architecture (JCA) tools and adapters for building WebSphere
applications that integrate CICS and IMS transactions.
Create web services from beans, EJBs, or WSDL/WSIL files using the IBM WebSphere
JAX-RPC web service run time.
Web-tier facade layer for easy consumption with JSF/servlets/JPSs.
Drag and drop support for Dojo widgets.
Profiling: Object names and live data content are now available during
memory-usage analysis.
Web diagram editor for Model-View-Controller design.
126
Chapter 6.
127
6.1 Introduction
Before you start migrating your applications, we compare the WebSphere and WebLogic
architectural concepts by reviewing the terminology that is used for those concepts by
WebLogic and WebSphere administrators and developers.
Table 6-1 explains the cell and domain components of the WebLogic and WebSphere
Application Server.
Table 6-1 Explanation of the cell and domain components
128
WebLogic
WebSphere
Server instance
Administration Server
Deployment Manager
Table 6-2 and Table 6-3 on page 130 explains the JMS components and extensions of the
WebLogic and WebSphere Application Servers.
Table 6-2 Explanation of the JMS components
WebLogic
WebSphere
129
WebSphere
130
WebLogic APIs: Although the samples in the book do not use WebLogic proprietary APIs,
it is possible that your application might depend on APIs that are not available in
WebSphere Application Server. The Migration Toolkit helps with some WebLogic APIs,
such as startup and shutdown classes, but others might require redesign and
manual rewriting.
The second application that we migrate is MVC, which is a J2EE application that includes a
Container Managed Persistence (CMP) - EJB application that runs on WebLogic. The reason
that we select this application is to demonstrate the CMP mappings of EJB objects manually.
We use IBM WebSphere Application Server Migration Tool V3.5 to migrate both the Trade
and MVC applications. We explain the capabilities of the new Migration Toolkit and how to
configure it in 6.4, Application Migration Tool - WebLogic to WebSphere on page 133.
Another useful tool that you can use is the Oracle Java Application Verification Kit (AVK). This
tool is intended to help developers test their applications for the correct usage of J2EE APIs
and portability across J2EE. For more information, go to:
http://java.sun.com/j2ee/verified/avk_enterprise.html
131
132
JMS 1.1
JDBC 2.1
Entity and Stateless Session EJB 2.0
Primary Key generation pattern for CMP EJB 2.0
Message Driven beans 2.0
Two-phase commit transactions
133
JSP 1.2
Servlet 2.3
Figure 6-3 shows the Trade3 J2EE components.
Account
CMP
Trade
Servlets
Holdings
CMP
Trade Option
Web
Client
Trade
JSPs
Joe, in action!
SOAP
Client
AccountProfile
CMP
Order
CMP
Qunte
CMP
WebSphere
Command
Beans
Entity EJBs
Trade
Database
Trade
Session
EJB
WebSphere
SOAP
Router
Web Container
UDDI
Registry
Message EJBs
Trade
WSDL
WebSphere
Web Services
Trade Broker
MDB
Streamer
MDB
Queue
Topic
Message
Server
Pub/Sub
EJB Container
134
Because of the size of this section, the following list details the subsections it contains:
135
db2start
db2 connect to trade3db user db2admin using db2admin
cd <db2_home>\bnd
db2 bind @db2cli.lst blocking all grant public
The database is empty and ready to for the data to be loaded. The creation of the initial
data in the database is done by the application when it is deployed.
3. Start the Oracle WebLogic Server 10.3.6 instance (Admin Server) from the Windows Start
menu or from the command line by running the following commands:
cd C:\Oracle\Middleware\user_projects\domains\base_domain
startWebLogic.cmd
4. Access the Console Login when the server is up and running. When we created the
WebLogic configuration, we accepted the default values for port and location. In our
scenario, the Console Login can be accessed at the following URL:
http://localhost:7001/console
The user name and password that are required for login are specified during the creation
of the new WebLogic configuration. In our scenario, we used weblogic/Passw0rd for the
user name and password.
Value
Database type
DB2
Database Driver
Name
TradeDataSource
JNDI Name
jdbc/TradeDataSource
Click Next. The Transaction Options window opens and an informational message is
displayed stating that, based on the selected driver type, only XA 2-phase commit
transactions are supported. Click Next.
2. On the Connection Properties window, enter the information that is listed in Table 6-5.
Table 6-5 Database connection properties values
136
Parameter
Value
Database Name
trade3db
Host Name
localhost
Port
50000
db2admin
Password
db2admin
User name and password: Use the database user name and password for your DB2
installation. In our example, we used db2admin/db2admin.
3. On the Test Database Connection page, click Test Configuration. You should see the
message Connection test succeeded.
4. On the Select Targets window, select AdminServer as the target server and click Finish.
Value
Name
TradeJMSServer
Target
AdminServer
2. Create a JMS module to act as the container to define JMS queues, topics, and
connection factories.
3. Create a JMS Module by navigating to base_domain and clicking Services
Messaging JMS Modules.
4. Enter JMS Resource for the JMS Module name and click Next.
5. Select AdminServer as the target and click Finish.
6. Create the JMS queues, topics, and connection factories that are needed by the Trade
application at run time.
7. Click JMS Resource, then click New. Configure the destinations by creating a JMS
Queue and a JMS Topic.
8. Create a JMS Queue with the values shown in Table 6-7. Click Next
Table 6-7 JMS queue values
Parameter
Value
Name
TradeBrokerQueue
JNDI Name
jms/TradeBrokerQueue
137
10.From the JMS Resource window, create a JMS Topic with the values listed in Table 6-8.
Click Next.
Table 6-8 JMS topic values
Parameter
Value
Name
TradeStreamerTopic
JNDI Name
jms/TradeStreamerTopic
Value
Name
TradeStatsTopic
JNDI Name
jms/TradeStatsTopic
Value
Name
QueueConnectionFactory
JNDI Name
jms/QueueConnectionFactory
Value
Name
TopicConnectionFactory
JNDI Name
jms/TopicConnectionFactory
3. Click Browse and select the trade3wls.ear file. Under Location, ensure that you select
the trade3wls.ear radio button. Click Next.
4. Select the Install this deployment as an application radio button and click Next.
5. In the Optional Settings window, accept all defaults and click Finish.
This process is quick and normally completes in less than a minute. You should see two
successful messages, one for the deployment status for the EJB Modules and another for the
deployment status for the web application modules.
<security-constraint>
<web-resource-collection>
<web-resource-name>secure resources</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>threadUser</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>threadUser</role-name>
</security-role>
Example 6-2 Mapping definition in weblogic.xml
<security-role-assignment>
<role-name>threadUser</role-name>
<principal-name>ThreadUserGroup</principal-name>
</security-role-assignment>
<session-descriptor>
The security mapping definition is already defined in weblogic.xml, so we must create a
group named ThreadUserGroup and a user as a member of the group.
Security mapping definition: The security mapping definition for WebSphere is different
from WebLogic. You must go through the steps that are described in Configuring basic
authentication on WebSphere on page 185.
139
140
141
2. Select the archive file, click Browse, and select the Trade EAR file. In our example, the
file is in C:\ProjectShare\Trade3.zip (Figure 6-4).
142
3. In the Ear Module and Utility JAR Projects window, ensure that all three modules are
selected (Figure 6-5) and click Finish.
143
5. Ensure that the tradewls EAR file is selected and click Next. You see that resources in
the org.eclipse.wst.common.project.facet.core file are modified by the Workspace
Migration wizard (Figure 6-7).
6. Look at the file (Example 6-3) before you continue. As you can see, the run time is Oracle
WebLogic Server 10.3.6 and the J2EE version is 1.3.
Example 6-3 org.eclipse.wst.common.project.facet.core file
144
7. Click Next. To change Server Runtime from WebLogic to WebSphere 8.5, click the
drop-down menu and choose WebSphere Application Server 8.5 as New Server
Runtime (Figure 6-8). Click Next and click Finish.
Tip: By default, Rational Application Developer V8.5 automatically rebuilds the project
after each change to the source code. To save time, we decided in our example to turn this
feature off by clicking Project Build automatically, because with this option turned on,
Rational Application Developer V8.5 builds the project automatically with every change. If
you turn it off, you need to build the project manually, as shown in step 6 on page 152.
You should have the following projects in the Enterprise Explorer view:
trade3EJB
This project contains the Trade EJBs.
trade3Web
The Trade web application contains servlets and JSPs.
trade3wls
This project contains the EAR application.
Chapter 6. Migrating from Oracle WebLogic
145
2. Expand the Software Analyzer and click New_configuration. The right side changes to
show an explanation of the basic configuration options available.
3. In the Name field, enter AppMigration as the name of the configuration.
146
4. In the Scope tab, leave the Analyze entire workspace radio button selected
(Figure 6-11).
147
6. Select WebLogic Application Migration from the Rules Sets drop-down menu, and click
Set. (Figure 6-12).
Tip: The default is that no rules are selected until the user selects the ones that are of
interest. Rules can be chosen from rule sets or individually. After the configuration is
selected and saved by clicking Apply, the configuration can be reused.
148
7. You see the Rule set configuration dialog box. Leave Source Java Version and Target
Java Version selected(Figure 6-13) and click OK.
The Application Migration Tool and the rules set is now configured. We are ready to run
the analysis against the Trade application. You can expand any of the analysis domains to
see which rules are selected.
8. Click Analyze to analyze all the projects in the workspace.
The Software Analyzer View is opened at the bottom of the window. It contains four tabs.
Each tab corresponds to one of the analysis domains that are selected based on the Rule
Set selection made earlier.
The Class-Path Review tab lists any class path related issues.
The Java Code Review tab lists Java code-related issues.
The XML File Review tab lists issues with deployment descriptors and the presence of
any WebLogic specific files.
The JSP Code Review tab lists issues that are found in JSP files, commonly
associated with web projects.
9. Click the XML File Review tab (Figure 6-14).
149
As you can see, the tool scanned the XML files in the project and flagged the potential
problems with WebLogic deployment descriptors by category/rule violation. For example,
the tool points out that EJB and message-driven bean (MDB) Java Naming and Directory
Interface (JNDI) references are defined in a WebSphere binding file. It also detected
WebLogic specific files. You can expand each of the rules to see the files in question and
which project to which they belong.
10.Click the Java Code Review tab (Figure 6-15).
The tool found three rule violations. The first one is related to the usage of the Commons
Logging system level property in Log.java. The second one indicates that you should use
the throws Exception method instead of throws javax.jms.JMSException, Exception in
TreadeBean.java. The third one is related to the existing WebLogic-specific package in
Log.java; the tool flags only this issue, but does not provide a quick fix option.
Tip: You can right-click any of the flagged files under a specific rule to see a list of
available options in the menu. For example, under the Java Code Review tab, expand the
WebLogic package references rule, right-click any of the files in the list, and select View
Results. The Java file in question is opened and the cursor is at the code problem line.
150
Rational Application Developer V8.5 reports errors (Figure 6-16) for the web application
because the project depends on classes that are in the EJB project.
151
6. Switch to the Problems view (Figure 6-18). After you build the project automatically or
manually, you do not see any dependency errors.
152
Tip: To see the Problem view on frame, click Window Show View Other type
Problems, choose the view, and click OK. When you start a new workspace, the
Software Analyzer does not have the New_Configuration suboption. In this case,
highlight Software Analyzer and click the new icon on the toolbar (the first icon with
the+ sign).
7. The error reported here is reported in Software Analyzer Results. Go back to Software
Analyzer Results. In the Java Code Review tab, expand the WebLogic package
references category and right-click the Log.java entry. Click View Result (Figure 6-19).
153
11.Select the Clean all projects radio button and click OK (Figure 6-20).
12.From the Project menu, select the Build Automatically option. This option ensures that
projects are automatically built as you make changes.
All errors reported by Rational Application Developer are now fixed.
154
This action reruns the analysis tool with the saved configuration. The focus is returned to
the Software Analyzer Results view. The tool creates a report in the left frame of the view
with the date and time stamp.
155
2. Click the Java Code Review tab. Expand the Do not use Commons Logging system
level property under the WebLogic to WebSphere code migration category
(Figure 6-22).
3. Right-click the Log.java entry and select Quick Fix Preview. See Figure 6-22.
4. The Quick Preview editor tools window opens (Figure 6-22). Examine the code changes
before they are committed. In this case, there is no
weblogic.logging.commons.LogFactory system level properly in the left pane, so the tool
removes this line from Log.java after the quick fix (Figure 6-23).
156
5. Highlight the Log.java entry under the Do not use Commons Logging system level
property category. Right-click and select Quick Fix (Figure 6-24).
6. Click the Java Code Review tab. Expand the TradeBean.java entry under the Use
matching throws clause in EJB bean class category. Right-click the TradeBean.java entry
and select Quick Fix Preview (Figure 6-25).
7. In this case, the tool shows that it replaces the throws javax.jms.JMSException,
Exception with the throws javax.jms.JMSException, Exception in Tradebean.java.
8. Highlight the TradeBean.java entry under Use matching throws clause in EJB bean class
category. Right-click the TradeBean.java and select Quick Fix.
157
J2EE: For J2EE 1.4 and prior versions, bindings and extensions are created in XMI
files. In Java EE 5 and later, the bindings and extensions are in XML format files.
9. In the XML File Review tab, expand the Use WebSphere bindings to define EJB JNDI
names category (Figure 6-27).
158
10.Right-click the weblogic-ejb-jar.xml entry and select Quick Fix Preview (Figure 6-30 on
page 160).
The Quick Preview Editor tool is displayed. Examine the code changes before they are
committed. In this case, the tool creates the ibm-ejb-jar-bnd.xmi binding file and places
it in to the EJB module. This file did not exist because this application is a
WebLogic application.
11.Highlight the Use WebSphere bindings to define EJB JNDI names category, right-click,
and select Quick Fix All (Figure 6-29).
Important: If you select Quick Fix All, it applies every quick fix applicable in the
analysis. This feature is good if you already know what changes the tool does to the
application. This action is not suggested for a first time application migration.
159
The WebSphere binding file is created and the EJB JNDI names are copied from the
corresponding WebLogic deployment descriptor. Double-click the file and explore its
contents (Figure 6-30).
12.In the XML File Review tab, select the Use WebSphere binding to define EJB
reference names category, right-click, and select Quick Fix All.
This rule flags EJB references found in weblogic.xml and weblogic-ejb-jar.xml if the
corresponding quick fix is not already applied. After a quick fix is applied, the WebLogic
XML is marked with a comment that indicates that it is migrated. This quick fix is used to
determine whether to flag the issue during analysis. It can be used at the end of migration
to identify how much of the XML file is migrated.
The quick fix that is provided for this rule takes the EJB reference information that is
defined in the WebLogic-specific deployment descriptors and migrates it to the standard
deployment descriptors and the WebSphere bindings files ibm-ejb-jar-bnd.xmi or
ibm-web-bnd.xmi.
13.In the XML File Review tab, select the Use WebSphere bindings to define Message
Driven beans JNDI names category, right-click, and select Quick Fix All.
The provided quick fix copies the destination JNDI name from the weblogic-ejb-jar.xml
file to the ibm-ejb-jar-bnd.xmi file. The quick fix, however, does not set the
ActivationSpec JNDI name.
For more information about manual intervention, highlight the rule and press the F1
function key. This action opens the Help window. Click See details to show the preferred
practices for manually addressing issues such as the ActivationSpec JNDI name.
160
14.Repeat step 13 on page 160 for the Use WebSphere bindings to define resource
environment reference JNDI names and Use WebSphere bindings to define resource
environment reference names categories. From the context menu, select Quick Fix All.
15.Expand the remaining rules (Figure 6-31).
16.Review the help for the WebLogic Query language constructs by highlighting one of the
rules and pressing the F1 function key. This action opens the Help window. After you open
the window, click See details.
17.Double-click the weblogic-cmp-rdbms-jar.xml:126 rule in trade3EJB. This action shows
the weblogic-ql construct (Example 6-4). You should see that ORDERBY is used and is a
WebLogic construct and not an ejb-ql construct. The ebj-ql equivalent is ORDER BY, as
shown in the help, but the weblogic-ql does not accept this construct. Edit the ejb-jar.xml
file using step 23 on page 165.
Example 6-4 WebLogic Query Language construct
<weblogic-query>
<query-method>
<method-name>findByUserID</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<weblogic-ql>SELECT OBJECT(o) FROM Orders o WHERE
o.account.profile.userID = ?1 ORDERBY o.orderID DESC</weblogic-ql>
</weblogic-query>
</weblogic-rdbms-bean>
Table 6-12 explains the WebLogic specific files that are in the JNDI name and CMP fields
for EJB.
Table 6-12 Explanation of WebLogic specific file names
File
Description
weblogic-ejb-jar.xml
161
File
Description
weblogic-cmp-rdbms-jar.xml
18.To convert the CMP Mappings, right-click the rule and select Quick Fix.
19.The quick fix creates the Map.mapxmi file, which is used by WebSphere to map CMP fields
to EJB to database table columns.
162
20.Open the mapping editor to verify that everything is mapped. The file is in the following
folder:
/trade3EJB/ejbModule/META-INF/backends/DB2UDBNT_V95_1
See Figure 6-33.
163
21.Go back to mapping editor, right-click TradeEJBs, and click Create and map database
elements from EJB elements (Figure 6-35). After save the mapping file, the error
disappears on ejbModule.
Figure 6-35 Create and map database elements to the database table
22.To verify that all EJB elements are mapped to their corresponding table columns, navigate
to the following folder:
/trade3ejb/ejbModule/META-INF/backends/DB2UDBNT_V95_1
164
Open the Map.mapxmi file and enable the Show only the unmapped objects
option (Figure 6-36).
23.If you want to create CMP mappings manually, complete the steps in Creating the CMP
mappings manually on page 212 that were performed to migrate the MVC application.
CMP mappings: The Application Migration Tool performs CMP mappings by
examining the definitions in the weblogic-cmp-rdbms-jar.xml file and creates the
Map.mapxmi mapping editor and the database model named SAMLPLE.dbm. If you want to
map the CMP fields of the EJB object to database table and columns you explicitly
specify, complete the steps in Creating the CMP mappings manually on page 212.
24.Switch to the Source tab of the ejb-jar.xml and change ORDERBY to ORDER BY. Save
and close the EJB deployment descriptor editor.
25.Return to the Software Analyzer view, right-click the weblogic-ql rule, and select Ignore
Result. This action removes the rule from the view. It also enters a comment in the
weblogic-cmp-rdbms-jar.xml file to tell the analyzer to ignore the rule in the next iteration.
26.Run a project clean and review the Problems view. If you missed changing ORDERBY to
ORDER BY, Rational Application Developer flag this situation as an error with a red X.
Open the Source tab of the deployment descriptor and search for ORDERBY and make
the appropriate changes.
165
27.In the Class-Path Review tab, use the MANIFEST.MF file for the application class path
category (Figure 6-37) and click Quick Fix Preview to see what the Application Migration
tool changes in MANIFEST.MF of trade3EJB.
As you can see in Figure 6-38, the tool places the wlcommons-logging.jar definition into
the MANIFEST.MF file of the trade3EJB because the trade3wls EAR file contains the
wlcommons-logging.jar file under /trade3wls/APP-INF/lib. After examine the changes,
click Quick Fix. Repeat the same step for the other result.
28.In the XML Review tab, expand the WebLogic specific files category and expand all
suboptions. Those options are the WebLogic specific deployment descriptors files. Delete
them because you migrated all of their entries to the corresponding WebSphere
binding files.
166
29.In the Enterprise Explorer view, expand the EJB project and browse to the
/trade3EJB/ejbModule/META-INF folder and delete the following files:
weblogic-ejb-jar.xml
weblogic-cmp-rdbms-jar.xml
See Figure 6-39.
30.In the Enterprise Explorer view, expand the trade3web project and browse to the
/trade3web/webContents/WEB-INF folder. Delete the weblogic.xml file. See Figure 6-40.
All errors reported by the Migration Tool and Rational Application Developer v8.5 should now
be fixed.
167
The next window provides informational messages before you run the J2EE specification
migration wizard. Click Next.
168
2. In the J2EE version drop-down menu, select 1.4 and click Next (Figure 6-42).
3. In the EJB Module Migration window, ensure that trade3EJB is selected and click Next.
4. In the Web Projects window, ensure that trade3web is selected and click Finish.
169
5. Click OK.
170
After the server start, you configure WebSphere Application Server V8.5. To do so, open a
web browser and access the administrative console at the following URL:
http://localhost:9060/ibm/console
The major difference that is compared to Oracle WebLogic Server 10.3.6 is in how we
configure JMS. This difference exists because WebSphere Application Server V8.5 uses
Service Integration Bus, which is an ESB-like approach, as the back end for the default JMS
messaging engine that is based on JMS 1.1 specifications.
Service integration bus: A service integration bus in WebSphere supports applications
using message-based and service-oriented architectures (SOA). A bus is a group of one or
more interconnected servers or server clusters that are added as members of the bus.
Applications connect to a bus at one of the messaging engines that are associated with its
bus members. For more information about SIB, see Chapter 13, Messaging and service
integration, in WebSphere Application Server V8.5 Concepts, Planning, and Design
Guide, SG24-8022.
Configuring JMS
This section describes how to configure the components necessary for JMS messaging. In
our example, we use the browser-based administrative GUI, but this task can also be scripted
through the wsadmin command-line tool.
This task is broken into several parts. The following sections describe the overall process:
171
Creating a bus
To create a bus, complete the following steps:
1. Open the administrative console and click Service Integration Buses in the left
navigation pane.
2. On the following window, create an ESB. Specify bus as the name. Click OK.
3. Click Finish on the Summary window (Figure 6-44).
172
4. Save the changes that are made to the configuration by clicking Save at the top of the
window. You should see the newly created bus that is listed under buses (Figure 6-45).
173
Tip: Manual configuration is error-prone and difficult. Automating these tasks saves time.
Download the WebSphere version of the Trade application together with Jacl scripts for
the wsadmin scripting facility. Those scripts create all the necessary resources and perform
the application deployment in a clustered environment. Download it from the following
web page:
http://www.ibm.com/software/webservers/appserv/was/performance.html
For more information about the administrative scripting, see the WebSphere Information
Center at:
http://publib.boulder.ibm.com/infocenter/iisinfsv/v8r5/index.jsp
174
Values
Name
TradeBrokerQCF
JNDI name
jms/TradeBrokerQCF
Bus name
BUS
6. Click OK, and then save the changes that you made.
7. Navigate to Resources JMS JMS Providers.
8. Click Default messaging provider.
9. Click Topic connection factories in the Additional Properties section.
175
10.Click New, and create a JMS topic connection factory using the information in Table 6-14.
Table 6-14 JMS topic connection factory configuration
Parameter
Values
Name
TradeStreamerTCF
JNDI name
jms/TradeStreamerTCF
Bus name
BUS
Value
Name
TradeBrokerQueue
JNDI name
jms/TradeBrokerQueue
Bus name
BUS
Queue name
TradeBrokerJSD
Value
Name
TradeBrokerDirectQueue
JNDI name
jms/TradeBrokerDirectQueue
Bus name
BUS
Queue name
TradeBrokerDirect
176
Value
Name
TradeStreamerTopic
JNDI name
jms/TradeStreamerTopic
Bus name
BUS
Topic space
Trade.Topic.Space
Values
Name
TradeBrokerMDB
JNDI name
eis/TradeBrokerMDB
Destination type
Queue
jms/TradeBrokerQueue
Bus name
BUS
177
4. Create a second JMS activation specification with the information shown in Table 6-19.
Table 6-19 JMS activation specification configuration
Parameter
Value
Name
TradeStreamerMDB
JNDI name
eis/TradeStreamerMDB
Destination type
Topic
jms/TradeStreamerTopic
Bus
BUS
178
Parameter
Value
eis/tradeBrokerMDB
jms/TradeBrokerQueue
You have now configured the MDB to use the JCA Activation Specification and
Destination that is configured in Creating a JMS activation specification for the JMS
queues on page 177. See Figure 6-47.
JCA Adapter option: If you cannot see the JCA Adapter option under WebSphere
Bindings, verify that you changed the J2EE specification to 1.4 with the Specifications
Upgrade wizard that is described in Migrating the Trade Application J2EE level on
page 168. To check that the application J2EE level is 1.4, right-click the EAR file in the
Enterprise Explorer category, click Properties, and view the EAR version under Project
Facets, as shown in Figure 6-48.
179
4. Select TradeSteamerMDB from the list of EJBs. In the WebSphere Bindings section,
select JCA Adapter and specify the values that are shown in Table 6-21.
Table 6-21 Mailer MDBs WebSphere binding configuration
Parameter
Value
eis/tradeStreamerMDB
jms/TradeStreamerTopic
You have now completed the configuration of the MDBs and JMS messaging.
Value
Database type
DB2
Provider type
Implementation type
XA data source
11.We already defined the class path values for the database using WebSphere Variables,
so the values are already populated. Click Next.
12.The Summary window is displayed. Click Finish and save the changes.
180
With the JDBC provider defined and the DB2 JDBC driver path that is specified, the next step
is to create the actual data source and authentication alias by completing the following steps:
1. From the administration console, navigate to Resources JDBC JDBC providers,
and select the newly created JDBC provider by clicking its name, which is DB2 Universal
JDBC Driver Provider (XA).
JDBC Provider: We select JDBC Provider implementation type as our XA data source
instead of the Connection pool data source because the Trade application includes the
operations that are wrapped in a global 2-phase transaction and commit.
2. Click Data sources in the Additional properties section.
3. Click New, and create a data source using the information that is shown in Table 6-23.
Table 6-23 JDBC data source configuration
Parameter
Value
Driver type
Server name
localhost
Database name
trade3db
4. Click Next.
5. On the Setup security alias window, leave all the defaults and click Next.
6. The Summary window is displayed. Click Finish and save the changes.
7. Select the newly created data source by clicking its name, which is TradeDataSource.
8. Click JAAS J2C authentication data in the Related Items section.
9. Click New, and create an alias using the information that is shown in Table 6-24.
Table 6-24 J2C authentication alias configuration
Parameter
Value
Alias
TradeDataSourceAuthData
UserId
db2admin
Password
db2admin
10.Click Apply.
11.Click OK and go back to the data source. From the Component-managed authentication
alias drop-down menu, select the J2C alias.
12.Click OK and save your configuration.
13.Select the data source you created from the list and click Test connection.
Migrating EJBs
This section describes how to configure the Trade Session beans and Container Managed
beans to run on WebSphere Application Server V8.5. In our migration example, we use the
Deployment Descriptor Editor in Rational Application Developer V8.5 and the migration tool
to generate the WebSphere Application Server V8.5 specific deployment descriptors.
181
Value
AccountEJB
ejb/AccountEJB
3. Repeat step 2 for each EJB in the list, except for the MDBs. Specify a unique JNDI name
for each EJB in the format ejb/<EJBName> using the values that are shown in Table 6-26.
Table 6-26 Trade EJB JNDI names
EJB
AccountProfileEJB
ejb/AccountProfileEJB
HoldingEJB
ejb/HoldingEJB
KeyGenEJB
ejb/KeyGenEJB
OrderEJB
ejb/OrderEJB
QuoteEJB
ejb/QuoteEJB
KeySequenceEJB
ejb/KeySequenceEJB
TradeEJB
ejb/TradeEJB
6. Repeat steps 1 on page 182 through 5 on page 182 using the information in Table 6-27.
Table 6-27 EJB reference names
EJB to expand
Reference
JNDI name
AccountEJB
ejb/AccountProfile
ejb/AccountProfileEJB
KeySequenceEJB
ejb/KeyGen
ejb/KeyGenEJB
TradeEJB
ejb/Quote
ejb/QuoteEJB
TradeEJB
ejb/Account
ejb/AccountEJB
TradeEJB
ejb/Holding
ejb/HoldingEJB
TradeEJB
ejb/Order
ejb/OrderEJB
TradeEJB
ejb/KeySequence
ejb/KeySequenceEJB
TradeEJB
ejb/AccountProfile
ejb/AccountProfileEJB
TradeEJB
jdbc/TradeDataSource
jdbc/TradeDataSource
TradeEJB
jms/QueueConnectionFactory
jms/TradeBrokerQCF
TradeEJB
jms/TopicConnectionFactory
jms/TradeStreamerTCF
TradeEJB
jms/TradeBrokerQueue
jms/TradeBrokerQueue
TradeEJB
jms/TradeStreamerTopic
jms/TradeStreamerTopic
TradeBrokerMDB
ejb/Trade
ejb/TradeEJB
7. Save changes to the deployment descriptor by pressing Ctrl+s. Or, from the Rational
Application Developer Window menu, click File Save. Do not close the EJB
deployment descriptor editor.
Value
JNDI name
jdbc/TradeDataSource
183
5. Repeat steps 1 on page 183 through 4 on page 183 using the information in Table 6-29 for
the reference and JNDI names.
Table 6-29 Trade web application reference JNDI names
Reference
JNDI name
jdbc/TradeDataSource
jdbc/TradeDataSource
jms/QueueConnectionFactory
jms/TradeBrokerQCF
jms/TopicConnectionFactory
jms/TradeStreamerTCF
ejb/Trade
ejb/TradeEJB
ejb/Quote
ejb/QuoteEJB
jms/TradeBrokerQueue
jms/TradeBrokerQueue
jms/TradeStreamerTopic
jms/TradeStreamerTopic
ejb/LocalQuote
ejb/QuoteEJB
ejb/LocalAccountHome
ejb/AccountEJB
jms/TradeBrokerDirectQueue
jms/TradeBrokerDirectQueue
184
2. Under Available projects, select trade3wls and click Add. The trade3wls project is found
under the Configured projects.
3. Click Finish.
It takes a couple of minutes for the application to deploy to the server. You can expand the
server and verify that the application status is Started.
<security-constraint>
<web-resource-collection>
<web-resource-name>secure resources</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
Chapter 6. Migrating from Oracle WebLogic
185
<auth-constraint>
<role-name>threadUser</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>threadUser</role-name>
</security-role>
To map users/groups to security role, which is threadUser in our example, complete the steps
in the following sections.
2. Click OK.
186
3. Click Manage Users under Users and Groups and click Create to add a user
(Figure 6-51).
4. Complete the fields as shown in Figure 6-52. We used testuser/testuser as the user name
and password in our example.
187
6. Click Manage Groups under Users and Groups and click Create to add a group
(Figure 6-53).
188
10.Click Add Users and click Search. Select testuser and click Add (Figure 6-55).
11.You see the The users were added to the group successfully message. Click Close.
12.You see the window that is shown in Figure 6-56.
189
3. Click Deployment Descriptor of the EAR file and click the Security tab. Ensure that you
can see the threadUser role name. If you cannot see the role name, click Gather to let
Rational Application Developer get the role name from the trade web application web.xml
file (Figure 6-58).
190
4. Click the threadUser role name, click Users/Groups under WebSphere Bindings and
Add threadUserGroup, which you defined in Configuring security and creating user and
group on WebSphere on page 186. See Figure 6-59.
191
As we enabled basic authentication in our sample, we are prompted for the user name and
password (Figure 6-60).
Enter the user name and password (testuser in both cases) to log in to the application
(Figure 6-61).
192
Browse through the site to check that the application is running correctly.
To test the application, complete the following steps:
1. Click the Configuration option in the left navigation pane (Figure 6-62).
2. Click the (Re)-Populate Trade Database option under the Benchmark Configuration
Tools. This action populates the Trade database with fictitious users and stocks. Any
existing users are deleted, and a new set of users and stocks are created. (This action
might take some time to complete.)
3. Scroll down to the Trade Configuration section Order-Processing Mode. The three
choices are as follows:
Synchronous (the default selection)
Asynchronous_1-Phase
Asynchronous_2-Phase
The mode can be changed for subsequent runs of the Trade application by selecting
another mode and clicking Update Config.
4. Close this window and go back to the original Trade Application window.
5. While still in the Configuration utilities, select Reset Trade. Note the Order Processing
mode in the table.
For the next set of tests, access the following URL:
http://localhost:9080/trade3Web/scenario
This URL is handled by TradeScenarioServlet. The servlet emulates a population of users by
executing an action for a randomly chosen user upon each access to the URL.
Chapter 6. Migrating from Oracle WebLogic
193
6.5.4 Summary
We completed the migration of the Trade application with minimum changes to the Java
code. This application was originally developed for WebSphere, then ported to WebLogic,
and we ported it back to WebSphere. Trade is a fairly complex application and uses many
vendor-specific deployment descriptors with the same code base.
We redeployed the compiled EAR file without having to change much of the Java code. We
were able to demonstrate the following concepts:
Usage of the WebSphere Application Server Migration Tool V3.5 for Rational Application
Developer V8.5 for automatic migration of CMP EJB mappings and vendor-specific
deployment descriptors and package.
Configuration of JDBC provider and data source, Service Integration Bus, JMS queues,
and topics and application deployment tasks with WebSphere Application Server V8.5.
Basic development activities using Rational Application Developer V8.5.
Enabling and configuring basic authentication and performing mapping security
users/groups to the role name defined in application on WebSphere.
194
2. Specify the location of the EAR file and the target run time as WebSphere Application
Server V8.5. Click Finish.
195
3. You should have three projects in the Enterprise Explorer View (Figure 6-64).
Enterprise Application Project: MVC
J2EE EJB Project for MVC: MVCEJB
J2EE Dynamic Web Project containing servlets and JSPs: MVCWeb
Here we give a brief description of the EAR file and the contents of the application. An EAR
file is a standard JAR (and therefore a compressed file) with an .ear extension, with one or
more entries that represent the modules of the application, and a metadata directory that is
called META-INF, which contains one or more deployment descriptors.
Table 6-30 shows the contents of our example MVC projects.
Table 6-30 The contents of the MVC projects
196
Directory structure
Description
MVC.ear/META-INF/
MVC.ear/META-INF/application.xml
MVC.ear/META-INF/weblogic-applicatio
n.xml
MVC.ear/APP-INF/
MVC.ear /MVCEJB.jar
Directory structure
Description
MVC.ear /MVCWeb.war
MVCEJB.jar/META-INF/ejb-jar.xml
MVCEJB.jar/META-INF/weblogic-ejb-jar
.xml
MVCEJB.jar/ejbs/*
MVCWeb.war/WEB-INF/web.xml
MVCWeb.war/WEB-INF/weblogic.xml
MVCWeb.war/WEBINF/classes/com/ibm/mv
c/MVCController.class
MVCDemoweb.war/MVCView.jsp
197
The tool scans the XML files in the project and flags the potential problems with WebLogic
deployment descriptors by category/rule violation. You can expand each of the rules to
see the files in question and which project they belong to.
3. We convert the WebLogic specific JNDI mappings to WebSphere bindings. Right-click the
first result, Use WebSphere bindings to define EJB JNDI names
weblogic-ejb-jar.xml, and select Quick Fix Preview (Figure 6-66).
198
After you are satisfied with the change, you can select Quick Fix. This action makes the
change in your workspace.
4. Perform step 3 on page 198 for the other three results as well. Ignore the warnings about
the WebLogic files that exist, as they are only warnings.
5. Click the Java Code Review tab (Figure 6-68).
199
6. Fix the issues in Java reported by the Migration Toolkit and the problems reported by
Rational Application Developer when you first imported the MVC application. Open the
Problems view to view all errors and warnings reported by Rational Application
Developer V8.5 by clicking Window Show View Other Select General
Problems (Figure 6-69).
Fixing the errors and build path dependencies between the projects
These problems are because of dependencies between the MVCWeb project and the
MVCEJB project. We must configure the Build path to correct these errors. Complete the
following steps:
1. To fix the problem, right-click the MVCWeb application project and select Properties.
From the left pane in the Properties window, select Java Build Path. Click the Projects
tab and click Add. In the Required Project Selection dialog box, select MVCEJB and click
OK (Figure 6-70).
200
The Quick Fix Preview editor opens. You can examine the code changes before they are
committed. In this case, the editor wants to replace the call reference to
weblogic.jndi.WLInitialContextFactory with the WebSphere equivalent
com.ibm.websphere.naming.WsnInitialContextFactory (Figure 6-72).
Figure 6-72 The code changes that the Migration Tool finds
6. If you are satisfied with the quick fix change, you can choose the Quick Fix option to
make the change in your workspace.
7. Repeat this action for each error, or to fix all the results for the Do not Use
WebLogic-specific JNDI name values rule, you can select any result within the rule or
the rule name itself to start Quick Fix All.
8. In the Enterprise Explorer view, expand the MVCEJB project, browse to the
MVCEJB/ejbModule/META-INF folder, and delete the weblogic-ejb-jar.xml file.
9. Rerun the Application Migration Tool. All errors reported by the migration tool and Rational
Application Developer v8.5 should be fixed now.
Tip: You can look in the files to ensure that everything is migrated.
201
10.In the Enterprise Explorer view, expand the MVCWeb project, browse to the MVCWeb
/webContents/WEB-INF folder, and delete the weblogic.xml and
weblogic-ejb-jar.xml files.
11.In the Enterprise Explorer view, expand the MVC project, browse to the MVC/META-INF
folder, and delete the weblogic-application.xml file.
12.Fix the issues in Java reported by the Migration Toolkit and the problems reported by
Rational Application Developer when you first import the MVC application. Open the
Problems view to view all errors and warnings reported by Rational Application
Developer V8.5 by clicking Window Show View Other Select General
Problems. See Figure 6-69 on page 200.
202
6. On the Create a new JDBC Provider page, specify the following information (Figure 6-74):
7. Click Next.
203
9. Click Next.
10.Review the Summary and click Finish.
11.Click Save at the top of the window.
12.Click Data sources from the JDBC menu on the left side of the page.
13.In the Scope section, click Node=<nodename>, Server=<servername>.
14.Click New.
15.On the Create a data source page, specify the following values:
Data source name: DB2 Universal JDBC Driver DataSource.
JNDI name: jdbc/trade3db.
16.Click Next.
204
17.Select the Select an existing JDBC provider radio button, and choose the JDBC
provider that you created, that is, DB2 Universal JDBC Driver Provider (Figure 6-76).
18.Click Next.
19.Specify the following values (Figure 6-77):
Database name: trade3db.
Server name: localhost.
Port number: 50000.
20.Click Next.
21.Leave Step 4 blank for now, as you return to the security configuration later. If you already
created a security configuration for this database, you can select it under the
Component-managed authentication alias. Click Next.
22.Review the Summary and click Finish.
23.Click Save at the top of the page.
24.Click the newly create Data Source DB2 Universal JDBC Driver DataSource.
205
25.On the right side of the Configuration tab, under the Related Items header, click the link
JAAS J2C authentication data (Figure 6-78). Skip this step if you created
the authentication.
Here you specify the user name and password for the database. Click New.
Specify the following values (Figure 6-79):
Alias: db2admin.
User ID: <Database username>. In this example, it is db2admin.
Password: <Database password>. In this example, it is db2admin.
26.Click OK.
27.Click Save.
206
28.Return to the DB2 Universal JDBC Driver DataSource window. In the Security settings
section, specify the following values (Figure 6-80):
Component-manages authentication alias: <nodeName>/db2admin.
Mapping-configuration alias: (none).
Container-managed authentication alias: (none).
29.Click Apply.
30.Click Save.
31.From the Data sources main page, click DB2 Universal JDBC Driver DataSource and
click the Test connection (Figure 6-81).
207
208
209
Start the migration of the EJB module by importing the JAR file into Rational Application
Developer V8.5 by completing the following steps:
1. In Rational Application Developer Java EE Enterprise Explorer perspective, right-click and
select Import EJB JAR file (Figure 6-85).
2. Specify the location of the EJB JAR file and the target run time as WebSphere Application
Server V8.5. Click Finish.
3. You should have entityejbEAR Enterprise Application Project in addition to three MVC
Projects in the Enterprise Explorer View (Figure 6-86).
210
Here is a brief description of the JAR file, and the contents of the application. An Enterprise
JavaBeans (EJB) module is used to assemble one or more enterprise beans into a single
deployable unit. An EJB module is stored in a standard Java archive (JAR) file (Table 6-30 on
page 196).
Table 6-31 The contents of the EJB projects
Directory structure
Description
entityejb.jar/META-INF/ejb-jar.xml
entityejb.jar/META-INF/weblogic-ejbj
ar.xml
entityejb.jar/META-INF/weblogic-cmpr
dbms-jar.xml
As you can see, the tool scanned the XML files in the project and flagged the potential
problems with WebLogic deployment descriptors by category/rule violation. You can
expand each of the rules to see the files in question and which project they belong to.
3. Convert the WebLogic specific JNDI mappings to WebSphere bindings. Right-click the
first result (Use WebSphere bindings to define EJB JNDI names). Select
weblogic-ejb-jar.xml and then select Quick Fix Preview.
211
After you are satisfied with the change, select Quick Fix, which makes the change in
your workspace.
4. Perform step 3 on page 211 for the other three results as well. Ignore the warnings about
the WebLogic files that exist, as they are only warnings.
When you click Quick Fix for Use WebSphere extensions to define the CMP mappings rule,
the migration tool examines the weblogic-cmprdbms-jar.xml WebLogic specific file and
creates a Data Model named SAMPLE.dbm and map file named Map.mapxmi. You can map the
EJB beans and fields corresponding to tables and columns, as you did when you migrated
the Trade application, as shown in Figure 6-35 on page 164.
212
5. Clear Use default naming convention and enter TRADE3 as the Connection Name.
Select DB2 for Linux, UNIX, and Windows under the Select a database manager
category. Change the JDBC driver type, and enter a database name, user name, and
password (Figure 6-89). Click Save Password.
6. In Figure 6-89, click the blue triangle icon (to the right of the Drivers drop-down menu).
7. The Edit Driver Definition page is displayed. Click the Jar List tab.
8. Highlight the existing driver JAR files, one at a time, and click Remove JAR/Zip.
213
9. Click Add JAR/Zip and browse to the C:\DB2_97\IBM\SQLLIB\java directory. Select the
db2jcc.jar file and click OK. Repeat this step to add the db2jcc_license_cu.jar file
(Figure 6-90).
10.Click OK in the Edit Driver Definition dialog box. You should return to the Driver Properties
dialog box.
11.In the Driver Properties dialog box, click Test connection. You should see a
success message.
12.Click Next and click Finish. You have a database connection named TRADE3.
13.Click the TRADE3 database connection and click Next.
214
14.Select only CATALOG tables, as we want to map beans and CMP fields to the columns
under that table (Figure 6-91).
15.Click Next, and for Select Meet-in-the-Middle Mapping Options, select None.
16.Click Finish.
17.The wizard creates the Map.mapxmi file, which is used to map CMP fields to table columns.
The mapping editor is open. The file is in the following folder:
/entityejb/ejbModule/META-INF/backends/DB2UDBNT_V97_1
18.The data model is imported and in the following folder:
/entityejb/Data Models/TRADE3DB.dbm
Tip: If you look at the Problems view, you should see one or more errors that are
reported because of CMP mappings. This situation occurs because you have not
created the actual mapping of the EJBs attributes to table columns.
215
19.With the mapping editor still open, right-click the EJB project:entityejb and select Match
by Name (Figure 6-92). It should take a few seconds for the mapping to complete. Click
File Save to save the mapping file. All errors should disappear from the Problems view.
20.To verify that all EJB elements are mapped to their corresponding table columns, navigate
to the /entityejb/ejbModule/META-INF/backends/DB2UDBNT_V97_1 folder, open the
Map.mapxmi file, and enable the Show only the unmapped objects (Figure 6-93).
216
Important: Verify that the back end that you created is selected for the application.
Open the /entityejb/ejbModule/META-INF/ejb-jar.xml file with the Deployment
Descriptor Editor. On the Overview tab, scroll all the way down and verify that the
Backend ID is DB2UDBNT_V97_1, as shown in Figure 6-94.
Tip: You can use the Data Source Explorer option of Rational Application Developer to
see database-specific properties, such as schema, tables, roles, and groups of the
database profile that you defined so far.
22.Click the Deployment Descriptor, select the Bean tab, and click Catalog.
23.In the WebSphere binding section at the lower right, update the CMP connection factory
JNDI Name:jdbc/trade3db and Container authorization type to Per_Connection_Factory
(Figure 6-95).
217
Testing the CMP EJB Module using the IBM Universal Test Client
To test the CMP EJB Module using the IBM Universal Test Client, complete the
following steps:
1. Right-click ejbEAR Project in Rational Application Developer and select Run As
Run On Server. Select the WebSphere Application Server v8.5 server and
click Finish.
2. A Test Client opens. When prompted, enter the Administrator user name (wasadmin) and
password (wasadmin). You are now logged in to the Universal Test Client.
3. Using the JNDI Explorer, select com.ejb.CatalogHome to add it to the EJB Beans section
of the navigation pane. Select the homes create() method. Enter a value, such as 1111,
and click Invoke (Figure 6-97 on page 219).
4. In the Results window, there is an instance named com.ejb.Catalog. Click Work with
Object to add the instance to the EJB Beans list.
218
5. Use the available setter and getter methods to write and read the data (Figure 6-97).
6.6.4 Summary
You completed the migration of the MVC application, including the CMP-EJB beans by using
the Migration Toolkit and Rational Application Developer EJB to RDP mapping wizard.
You deployed the compiled EAR file without having to change much of the Java code. We
demonstrated manual mapping of CMP EJB mappings for developers who want to map an
EJB object and CMP fields to explicitly specified database table and columns.
219
220
Chapter 7.
221
7.1 Introduction
Oracle Application Server is a J2EE 1.4 compliant application-serving platform, which is one
of the products in the Oracle Fusion Middleware product family. The example application that
is used for the migration process was developed by the authors of this book, and it includes
the dependent features of Oracle Application Server to make the migration process realistic
enough to be taken as a reference for actual migration operations. We used the Application
Migration Tool - Oracle AS to WebSphere included within the Application Migration
Toolkit V3.5 for the migration process. We describe the details of the IBM WebSphere
Application Server Migration Toolkit in Chapter 4, Installation and configuration of the
Application Migration Tools on page 89.
222
Application Migration Tool - Oracle AS to WebSphere can help you in the following areas
when you migrate J2EE 1.4 applications from Oracle Application Server (starting with Oracle
Containers for J2EE V9.x) to WebSphere Application Server V7, V8, or V8.5:
Oracle Server Startup Classes: Detect the usage of Oracle startup and
shutdown interfaces
Deployment Descriptors: Detect and convert Oracle specific deployment descriptor
elements to IBM deployment descriptor elements
Oracle-specific APIs: Detect Oracle proprietary packages in Java code
Oracle-specific files: Detect Oracle proprietary XML files in the application
Oracle-specific properties: Detect Oracle proprietary properties that are used in Java code
JSPs: Detect Oracle proprietary tag libraries
Web services: Migrate Oracle web services
Cell
Node
Physical Machine
Node Agent
Server Instance
OC4J Instance
Deployment Manager
Cluster
OC4J groups
Base Server
OC4J Server
223
4. When the Specify File Locations window opens, provide the requested products list file as
the source, provide a name to the application server (the default is oracleas1), and specify
the installation directory (the default is C:\OraHome_1). Click Next.
5. Select Oracle Application Server 10g from the list of products, and click Next.
6. Select J2EE and Web Cache as the Installation Type (and other components as needed)
and click Next.
7. At the Pre-Installation Requirements window, make sure that you meet the requirements
listed first. Then, check the check box next to the requirements to confirm. Click Next.
8. Select the Configuration Options for the modules you selected to install. Click Next.
9. Specify the Port Configuration Options. The default is Automatic, which means Oracle
Application Server uses default ports automatically. You can also choose the Manual
option if you specify a staticports.ini file that includes the port information. Click Next.
10.Specify an instance name and the ias_admin password. Click Next
11.When the Summary window opens, check the summary and click Install.
12.If the installation is successful, the end of installation window opens and indicates that the
installation finished successfully. Click Exit to end the installation process.
You should now have a working copy of Oracle Application Server 10.1.2.i.
Value
Name
OracleDataSource
DataSource Class
com.evermind.sql.DriverManagerDataSource
JDBC URL
jdbc:oracle:thin:@//localhost:1521/SID_VALUE
JDBC Driver
oracle.jdbc.driver.OracleDriver
Schema
SCHEMA_NAME
7. Enter the appropriate user name and password in the DataSource user name and
password section.
8. Enter jdbc/OracleDBConnectionDS in the Location field in JNDI Locations section.
9. Click Apply.
Important: The SID_VALUE and SCHEMA_NAME are specific to your Oracle Database
installation. By default, Oracle creates an SID named XE, and a schema named OE
or HR.
225
Figure 7-1 The Markers view in Rational Application Developer after you import all the EAR files that make up the sample
application
We resolve these problems to have a clean workspace in which to run the Application
Migration Tool and to do the deployment to WebSphere Application Server V8.5.
226
Figure 7-2 The remaining problems after the target run time is set
The first problem, the syntax error, indicates that the Java compiler compliance level for the
project is still set to 1.4 and must be updated to 1.6. Check (and correct if necessary), the
Java compiler compliance level on all three of the Java projects (ejb2, webapp1, and
WebServices). To do so, complete the following steps:
1. Right-click ejb2 and select Properties.
227
2. Select the Java Compiler properties in the left pane and change the Java compiler
compliance level to 1.6 (Figure 7-3).
3. The Project Facets properties also must be updated to indicate that you are using a Java
6 run time and that you are deploying to WebSphere Application Server V8.5. Click
Project Facets in the left pane and change the version of the Java facet to 1.6. In
addition, check the WebSphere Web (co-existence) and WebSphere Web (Extended)
facets.
4. Repeat steps 1 on page 227 to 3 for the other two projects.
5. Click OK to accept the new properties and then Yes when Rational Application Developer
prompts you to do a full project rebuild now.
WebService project: When we performed this task on the WebService project in our
example, Rational Application Developer added an issue to the Markers view to indicate
that, by default, WebSphere Application Server V7.0 and above does not scan for JAX-WS
annotations without a change to the manifest.mf file. This problem is addressed in Web
Service problems on page 229.
The remaining three Java Problems are all warnings, which you do not have to resolve now
(they do not affect the running of the application).
228
XML problems
The final problem is an XML problem in the applications persistence.xml file. This problem
is one that the Oracle Application Server tolerates, while WebSphere Application Server V8.5
requires that the persistence.xml file conform to the schema defined for the
persistence.xml file. You must correct persistence.xml to match the schema. The problem
is that the persistence-unit stanza ends too soon and should include the provider stanza
that immediately follows it. You must correct this XML so that the persistence-unit stanza
includes the provider stanza (Example 7-1).
Example 7-1 The corrected peristence.xml file
229
3. Click the Rules tab and then use the Rule Sets: drop-down menu to select the Oracle
Application Migration rule set. Click Set....
4. In the Rule set configuration window, select the Target application server as WebSphere
Application Server V8.5, as shown in Figure 7-4.
5. Click OK.
6. Back in the Software Analyzer Configurations wizard, click Analyze to get the Application
Migration Tool to analyze all the projects.
A total of four problems are reported: three XML problems and one Java problem.
Figure 7-5 The Java Code Review results from the Application Migration Tool
230
2. Click the light bulb/warning triangle to open a menu of possible fixes and click Add
generated serial version ID to apply the quick fix (Figure 7-6).
Figure 7-6 Applying a quick fix to resolve the Java serialization warning
Fixing the first result is straightforward: Delete the file. WebSphere Application Server V8.5
does not need this file to determine the web services operations that must be made available
through SOAP. Instead, WebSphere Application Server V8.5 makes all the operations
available. The oracle-webservices.xml file can be in the WEB-INF directory of the
WebService project.
231
The next code review result is for the usage of the orion-application.xml. When you
double-click that result to open that file, you discover that it is empty apart from an empty
orion-application stanza. This file can be deleted as well and can be found in the META-INF
directory of the SampleWebService-GetDates-WS project.
To resolve the last remaining problem is more complicated, as you must convert the Oracle
web service deployment descriptor into a WebSphere Application Server deployment
descriptor. The Application Migration Tool can help you do this conversion. To do the
conversion, complete the following steps:
1. Right-click webservices.xml and select the Generate Ant script. This action creates an
Ant script (called build-ibm-ws.xml) that you must run to generate a new WSDL file to use
with WebSphere Application Server V8.5 and to update webservices.xml for use on
WebSphere Application Server V8.5.
2. To run the Ant script, open a command-line interface (CLI) and then run the command
from within the Rational Application Developer workspace:
a. Open a CLI and navigate to the root directory of your WebSphere Application Server
V8.5 installation.
b. Change to the bin directory.
c. Run the following command:
ws_ant.bat -f $WORKSPACE/WebServices/build-ibm-ws.xml
genService_GetDatesWSSoapHttpPort
Command syntax: You must replace $WORKSPACE in the command with the location
of your Rational Application Developer workspace. WebServices is the name of
the project where build-ibm-ws.xml was created by the Application Migration
Toolkit. genService_GetDateWSSoapHttpPort is the name of the target in that
build.xml, which performs the relevant conversion for the GetDateWS web service.
One of these targets is generated for each port that is listed in the original
webservices.xml file, and you must repeat this process for each target generated.
3. After the Ant script completes successfully, return to Rational Application Developer,
right-click the WebService project, and select Refresh.
4. You see that a new folder, ibm-ws-gen, is created by the Ant script. Find the
webservices.xml file inside ibm-ws-gen/src/WEB-INF. As you have only the single web
service, you can copy that file to the real WEB-INF directory.
Multiple services: If you have more than one service, you must copy the contents of
the generated webservices.xml in to the real webservices.xml, overwriting each
original web services as you copy over the changes.
232
2. Select Add and Remove Projects from the menu (Figure 7-8).
3. Move all resources to the right to configure them on the server and click Finish.
4. Right-click WebSphere Application Server v8.5 at localhost and select Publish.
In our sample application, you see that the SampleEJBClient failed to start. When you
look at the logs, you find the error java.lang.ClassNotFoundException:
oracle.adf.share.logging.ADFLogger. This class is included in the adfshare.jar file. The
absence of this JAR file is expected, as adfshare.jar is deployed as a part of the ADF
runtime libraries. You should add this JAR file in to the build path of the application.
233
5. After you add adfshare.jar in to the Web App Libraries of webapp1 and publishing
SampleEJBClient again, the SampleEJBClient starts successfully (Figure 7-9).
You can start and stop the server and application by using the WebSphere Application Server
console. To reach the console, enter the URL http://<hostname>:9080/ibm/console or click
Start Programs IBM WebSphere IBM WebSphere Application Server V8.5
Profiles AppSrv01 Administrative console.
The application that is imported from Rational Application Developer can be controlled in
WebSphere Application Server. You can also import EAR files through this console.
7.6.6 Summary
In this chapter, we explained the process for migrating J2 EE applications from Oracle
Application Server 10.1.2 to WebSphere Application Server V8.5 using a sample application
that was created by the authors of this book. We used Application Migration Tool - Oracle AS
to WebSphere to automate most of the migration steps. The tool was able to catch and fix the
incompatibilities between Oracle Application Server and WebSphere Application Server in
the code.
234
Chapter 8.
235
Legal disclaimer: IBM does not warrant or represent that the code provided is complete
or up-to-date. IBM does not warrant, represent or imply reliability, serviceability, or function
of the code. IBM is under no obligation to update content nor provide further support.
All code is provided "as is," with no warranties or guarantees whatsoever. IBM expressly
disclaims to the fullest extent permitted by law all express, implied, statutory and other
warranties, guarantees, or representations, including, without limitation, the warranties of
merchantability, fitness for a particular purpose, and non-infringement of proprietary and
intellectual property rights. You understand and agree that you use these materials,
information, products, software, programs, and services, at your own discretion and risk
and that you will be solely responsible for any damages that may result, including loss of
data or damage to your computer system.
In no event will IBM be liable to any party for any direct, indirect, incidental, special,
exemplary or consequential damages of any type whatsoever related to or arising from use
of the code found herein, without limitation, any lost profits, business interruption, lost
savings, loss of programs or other data, even if IBM is expressly advised of the possibility
of such damages. this exclusion and waiver of liability applies to all causes of action,
whether based on contract, warranty, tort or any other legal theories.
236
JBoss proprietary Java packages and files: Detect JBoss proprietary packages and files
Web services: Migrate JBoss JAXRPC web services
8.2.1 Comparison of the JBoss V7.1.1 and WebSphere Application Server V8.5
terminology
Here are some of the similarities and differences in terminology between JBoss V7.1.1 and
WebSphere Application Server V8.5. WebSphere Application Server and JBoss use different
structures for managing distributed environments, which host many application server
instances that work together as clusters to provide enterprise level quality of services, such
as high availability and load distribution. A comparison in terminology can be found in
Table 8-1.
Table 8-1 Terminology comparison
WebSphere Application Server V8.5
JBoss V7.1.1
Cell
Domain
Server Instance
Server or Node
Node
N/A
Node agent
N/A
Deployment Manager
Cluster
Server Group
237
2. Set the environment variables by clicking Start Control Panel System. Click
Advanced Environment Variables. We want to use the same JRE as our integrated
testing environment, so in our scenario, in the user variables section, we set the
JAVA_HOME variable as follows:
JAVA_HOME=C:\Program Files (x86)\IBM\SDP\jdk
3. Set the ANT_HOME user variable to the folder that you specified in step 1 on page 237. In our
case, we set it as follows:
ANT_HOME=C:\Ant
4. Add Java and Ant scripts to your path by appending the following code to your PATH user
variable or creating one if it does not exist:
PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
5. Verify the environment variables and Ant installation by opening a new command prompt
and checking the outputs of the following commands:
java -version
ant -version
The output shows the current versions of the tools.
238
239
240
8.4.3 Importing the EAR file and source code to Rational Application
Developer
To import the EAR file and source code to Rational Application Developer, complete the
following steps:
1. Start Rational Application Developer by clicking Start IBM Software Delivery
Platform IBM Rational Application Developer 8.5 Rational Application
Developer.
2. Start the import wizard by clicking File Import. Expand the web node in the import
source tree and select the WAR file.
3. In the WAR window, browse to the location of the WAR file that is generated by the Ant
build, which might be found at the following location:
<quickstarts_home>\kitchensink\target\jboss-as-kitchensink.war
See Figure 8-1. Click Next to continue.
Figure 8-1 Importing the WAR file for Kitchensink application using the import wizard
4. On the WAR Import: Web libraries window, click Finish to continue without selecting any
of the JAR files to be imported as a utility project.
241
5. Click Finish on the WAR Import: Web libraries window. The Import wizard runs and
creates the necessary project and module structure (Figure 8-2).
6. If you are not already in the Web perspective, a prompt asks if you want to switch to the
Web perspective. Click Yes.
242
7. Expand jboss-as-kitchensink WebContent WEB-INF lib and delete all the JAR
files in this node (Figure 8-3).
243
8. Import the source code for the web module. As shown in Figure 8-4, you must replace
classes that are imported in compiled form with their respective source codes. Click Java
Resources/src under the web module, and then click File Import from the
main menu.
Figure 8-4 Replacing the class file with the respective source files in the web module
9. On the Import window, clicking General File System displays the File System Import
window. Click Browse and select the folder that contains the source code of our project:
<quickstarts_home>\kitchensink\src\main\java
10.Select the Java node. Click Finish.
Importing source files: When you import source files to replace classes imported by
the import wizard, the following rules apply:
In an EJB module, source files must be added under the ejbModule node.
In a web module, source files must be added under the Java Resources/src node.
11.Because we imported the source files, we can now remove the compiled class files that
are imported by the import wizard for the same classes. Expand Web App Libraries
Imported Classes. Select all packages in this node. Click File Delete from the main
menu. Click OK on the deletion confirmation dialog box that opens. The web module
should now look like the right pane Figure 8-4.
244
245
3. On the next page, click Add... in the URL Mapping section, and add the pattern *.jsf. See
Figure 8-6. Click Finish.
4. You should now see the new mapping in the Enterprise Explorer window.
246
4. Click Set ... to select the JBoss rules in the Analysis Rules and Domains area. Set the
Target Application Server to WebSphere Application Server V8.5 and the Source Java
version to Java 6. Click OK. See Figure 8-7.
Figure 8-7 Software Analyzer configuration with JBoss migration rule set
5. Click Analyze. After the analysis is complete, the Software Analyzer Results view is
displayed (attached to the bottom pane).
In the Software Analyzer Results view, you can see a tab for each domain of analysis. In
our case, we see a tab for ClassPath Review, Java Code Review, XML File Review, and
JSP Code Review.
247
In Figure 8-8, Application Migration Tool warns us about the package naming convention and
usage of the Hibernate framework. In following sections, we migrate Hibernate JPA provider
to OpenJPA, which is provided with the WebSphere Application Server v8.5.
248
Including libraries: Because injected code like Hibernate Validator depends on SLF4J,
not including these libraries might cause problems with the injected resources, and it might
be difficult to determine that the root cause of the problem is the missing libraries.
8.4.7 Migrating to the WebSphere built-in JPA provider and the default data
source
Two persistence providers are included in WebSphere Application Server:
JPA for WebSphere Application Server persistence provider
Apache OpenJPA persistence provider
The JPA for WebSphere Application Server persistence provider is the default provider for
WebSphere Application Server. You can use one of the two providers, or a third-party
persistence provider, as the default provider. In this exercise, we migrate our application to
use OpenJPA JPA provider, which is included in WebSphere Application Server V8, instead
of Hibernate JPA provider, which is included in JBoss Application Server.
Complete the following steps:
1. Click the jboss-as-kitchensink web module. Open the persistence.xml file in an editor
by double-clicking it at Java Resources/src/META_INF/persistence.xml.
2. To use the WebSphere Application Server V8.5 default data source that is based on
Derby, change the jta-data-source element value from
<jta-data-source>java:jboss/datasources/KitchensinkQuickstartDS</jta-data-sourc
e> to <jta-data-source>DefaultDatasource</jta-data-source>.
249
3. Remove all property elements and add the following property elements to the properties
element. These elements set the schema to use and create and synchronize the schema
as defined in the persistence units and database:
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)" />
<property name="openjpa.jdbc.Schema" value="APP"/>
4. Save the persistence.xml file by clicking File Save.
To use JPA-related views, complete the following steps to activate the JPA project facet:
1. Right-click the web module node and select Properties.
2. In the Properties dialog box, select Project Facets, and select the JPA check box
(Figure 8-10).
250
You can see the JPA node, which also lists the persistence units and entities in Enterprise
Explorer. See Figure 8-11.
Figure 8-11 Enterprise Explorer after you enable the JPA project facet
The validation error Member.java, stating class Member is mapped, but is not included in
any persistence units occurs. Because you know that the Member entity is defined in JPA
context, you can ignore this exception. To do so, complete the following steps:
1. Click Window Preferences.
2. Click Java Persistence Errors/Warnings from left pane, and change the type from
error to warning for your specific problem (Figure 8-12).
251
Figure 8-13 Adding factory class path for annotation processing at compile time
3. Click Java Compiler Annotation Processing. Click New... and add the following
property:
openjpa.metamodel=true
252
253
2. After the application is deployed to the test environment, an embedded web browser is
displayed in the main docking area, presenting the entry page of the Kitchensink
application. Follow the links to test the application functionality. Things to check are form
validations and JAX-RS endpoints, which can be used for both query and
creation purposes.
8.4.9 Summary
While we migrate the Kitchensink Quickstart sample application, we demonstrated the
following concepts:
Source migration to Rational Application Developer for WebSphere Software as a build
and test environment
Use of Application Migration Tool
Migrating from third-party JPA providers to WebSphere Open JPA built-in provider
The main points to highlight during this migration are as follows:
Libraries that ship with JBoss Application Server distributions and not with WebSphere
Application Server create more runtime dependencies that must be taken care of.
Different built-in data sources that are used in this example made it necessary to modify
the persistence settings.
JAX-RS did not need configuration changes and worked as expected.
254
2. Create a database for the application using DB2 and populate the database with data.
3. Import the EAR file that is built for JBoss to IBM Rational Application Developer for
WebSphere Software, to create the project structure. Import source files into projects that
are created from the source distribution.
4. Check the source code and configuration files with the Application Migration Tool.
5. Analyze and fix problems that are reported by the build environment.
6. Build the Online Brokerage sample application using IBM Rational Application Developer
for WebSphere Software. Deploy and test the application on the integrated WebSphere
Application Server V8.5 test environment.
255
2. Enter the text that is shown in Example 8-2 in the command area, which is based on the
<brokerage_home>/db/db.sql file.
Example 8-2 Command area code snippet
"."USERS"
"."STOCKS"
"."USERSTOCKS"
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INSERT
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
INTO
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
stocks
VALUES('00000002','Hitech Software',2.00);
VALUES('00000003','Bill s Cold Storage',3.00);
VALUES('00000004','Colonel s Fried Chicken',300.00);
VALUES('00000005','Toyo Motors',30.00);
VALUES('00000006','Timbuctoo Airlines',53.00);
VALUES('00000007','Happy Undertakers',73.00);
VALUES('00000008','Wacko Brothers',54.00);
VALUES('00000009','Mental Studios',456.00);
VALUES('00000013','ASFG',54.89);
VALUES('00000023','BFG',564.50);
VALUES('00000033','Mack',3444.50);
VALUES('00000043','Ronan & Sons',7.50);
VALUES('00000053','Bulls & Bears',553.40);
VALUES('00000343','HGHU',456.00);
VALUES('00000603','TTTM',77.00);
VALUES('00000463','GRASF',88.00);
COMMIT WORK;
CONNECT RESET;
TERMINATE;
3. Click Execute. A progress indicator is displayed. After the operations are completed, the
results view displays the output (Figure 8-15).
Figure 8-15 Creating the brkrgdb database for the sample application
257
8.5.4 Importing the EAR file and source code to Rational Application
Developer
There are several alternatives for importing components in the HAR files in to our project:
Reuse the generated HAR file in its binary form. Choose this alternative if you prefer to
use other means of generating HAR files rather than Rational Application Developer for
WebSphere Software.
Create a utility module that contains contents of the HAR file, and on the web module add
a dependency to this project. This alternative migrates all source code to Rational
Application Developer for WebSphere Software as a second alternative, while keeping
persistence-related classes at a separate place. This action is the main reason for using a
HAR file.
Import the contents of the HAR file (in our case, the com.dev.trade.bo package and
hbm.xml files) in to a web module with other source code. This action results in a simpler
project structure, as the web module contains all the source code.
In the following procedures, we demonstrate the second alternative. To do so, complete the
following steps:
1. Start Rational Application Developer for WebSphere Software by clicking Start IBM
Software Delivery Platform IBM Rational Application Developer 8.5 IBM
Rational Application Developer.
2. Start the Import wizard by clicking File Import. Expand the Java EE node in the import
source tree and select the EAR file.
3. In the Enterprise Application Import window, browse to the location of the EAR file at
<brokerage_home>/jboss-artifact/brokerage.ear. Click Finish.
4. Upon inspection, you might see that the brokerage_WEB module imported classes under
Java Resources/Libraries/Web App Libraries/ ImportedClasses. We import the source
files of these classes to the Java Resources/src folder in the same module and remove
the class files from the project. Figure 8-16 shows the module structure before and after
source code importation.
Figure 8-16 brokerage_WEB module before and after the source code import
258
5. Click the Java Resources/src node in the brokerage_WEB module, and click File
Import from the main menu.
6. In the Import window, click General File System. The File system import window is
displayed. Browse to the C:\brokerage\src folder and import the source code
(Figure 8-17).
Importing source code: We are not importing the com.dev.trade.bo package source
code, as this package is packaged into the brokerage.har file, and is not a part of the
web module.
259
3. Click Set.... The respective rules become selected in the Analysis Rules and Domains
area. You see the dialog to choose WebSphere Application Server V8.5 after you
click Set....
4. Click Analyze. After the analysis is complete, the Software Analyzer Results view opens,
and is attached to the bottom pane. Inside the Software Analyzer Results view, you can
see a tab for each domain of analysis. In our example, there are tabs are named Java
Code Review, XML File Review, and Class-path Review.
5. Expand the Java Code Review section and the results in this section. Note the Check for
Hibernate framework warning. You are going to perform some changes in the next part to
make the Hibernate framework run on the WebSphere Application Server. See
Figure 8-18.
6. Expand the XML file review section and the results in this section. Under Use
WebSphere bindings to define resource reference names, right-click jboss-web.xml:5
found in brokerage_WEB and select Quick Fix. See Figure 8-19.
260
261
5. Click Browse and navigate to the folder that contains the library and select the library to
import. Do this step for each library that is shown in Table 8-2.
Table 8-2 Required libraries
Location
Library
<hibernate_home>
hibernate-core-4.1.3.Final.jar
<hibernate_home/lib/required
antlr-2.7.7.jar
<hibernate_home/lib/required
dom4j-1.6.1.jar
<hibernate_home/lib/required
javassist-3.15.0-GA.jar
<slf4j_home>
slf4j-api-1.6.4.jar
<slf4j_home>
sl4j-simple-1.6.4.jar
262
263
264
265
266
13.The resource properties window opens. Define the databaseName and serverName
values. Specify brkrgdb for databaseName. Similarly, define localhost for serverName.
Click Finish.
The Data Sources section of WebSphere Application Server Deployment window now
looks like Figure 8-23. Press Ctrl+s to save your changes.
Figure 8-23 Data Sources window of the WebSphere Application Server deployment
14.Attach the data source to the defined resource reference in the web module. Open the
brokerage_WEB module deployment descriptor in the editor by double-clicking
brokerage_WEB/Deployment Descriptor: brokerage.
15.Switch to the References tab and click Add. The Reference window opens.
16.Select Resource Reference and click Next.
17.On the References view, click ResourceRef jdbc/HibernateDB.
267
18.In the WebSphere Bindings section, enter jdbc/HibernateDB in the JNDI name field.
See Figure 8-24.
268
269
270
6. In the Properties window, click Java EE Module Dependencies. Switch to the Web
Libraries tab. Clear the check box next to the brokerage.jar and select the check box next
to brokerage_persistence module. See Figure 8-28. Click OK.
Summary
While migrating our sample generated application, we demonstrated the following concepts:
Source a migration to Rational Application Developer for WebSphere Software as a build
and test environment.
Several alternatives for organizing the project structure for Hibernate applications using
HAR archives.
Configuration of Hibernate for WebSphere.
Using Hibernate for persistence requires transaction a strategy configuration specific to
WebSphere Application Server.
Initializing session factories is not automatic on WebSphere Application Server. You must
explicitly initialize session factories by using startup beans or other means.
271
272
Chapter 9.
Introduction
Application Migration Tool - Apache Tomcat to WebSphere
IBM Redbooks Publications Sample Application
MvnForum migration
Easy JSP Forum migration
Summary
273
Legal disclaimer: IBM does not warrant or represent that the code provided is complete
or up-to-date. IBM does not warrant, represent or imply reliability, serviceability, or function
of the code. IBM is under no obligation to update content nor provide further support.
All code is provided "as is," with no warranties or guarantees whatsoever. IBM expressly
disclaims to the fullest extent permitted by law all express, implied, statutory and other
warranties, guarantees, or representations, including, without limitation, the warranties of
merchantability, fitness for a particular purpose, and non-infringement of proprietary and
intellectual property rights. You understand and agree that you use these materials,
information, products, software, programs, and services, at your own discretion and risk
and that you will be solely responsible for any damages that may result, including loss of
data or damage to your computer system.
In no event will IBM be liable to any party for any direct, indirect, incidental, special,
exemplary or consequential damages of any type whatsoever related to or arising from use
of the code found herein, without limitation, any lost profits, business interruption, lost
savings, loss of programs or other data, even if IBM is expressly advised of the possibility
of such damages. this exclusion and waiver of liability applies to all causes of action,
whether based on contract, warranty, tort or any other legal theories.
9.1 Introduction
Apache Tomcat 7.0.27 is an open source implementation of the Oracle Java EE web
container. It implements the Java Servlet and JavaServer Pages specifications. Tomcat is
developed by a community of developers under the umbrella of the Apache Software
Foundation (ASF). Tomcat is widely used by many websites. It is popular for its small
footprint, simplicity, and the many toolkits and frameworks that run on it.
Applications tend to grow over time and need a higher quality of service (QoS) and more
sophistication than Tomcat can offer (such as centralized administration for clustered
topologies, failover, advanced role-based security for users and administrators, script-based
administration, advanced monitoring tools, portal infrastructure, page fragment and
distributed Java caching, and transactions). Then, applications must be redeployed or
migrated into enterprise-grade application servers, such as WebSphere Application Server,
using either the full profile or the Liberty profile.
The transition to running applications on WebSphere Application Server can be made easier
by using the Application Migration Tool - Apache Tomcat to WebSphere (Application
Migration Tool). The toolkit provides the capability to identify common issues with migrating
applications, and provides a number of automatic fixes (called quick fixes) to reduce the
manual intervention that is involved in migration. Both Application Migration Tool and the
WebSphere Application Server V8.5 Liberty Profile Developer Tools (referred to as the
developer tools) can be installed independently into the Eclipse IDE for Java EE Developers
Version 3.7, which is freely available from the Eclipse website. For this reason, we used
Eclipse, with Application Migration Tool and the developer tools installed, as our development
and deployment environment throughout this chapter.
274
WebSphere Application
Server V8.5 Liberty profile
Creates users in a
tomcat-users.xml file using
role and user elements.
File Monitoring.
275
You should also be familiar with the Java EE specification and architecture, and be able to
understand and run basic SQL commands. You must also be familiar with Apache Tomcat
7.0.27.
The following software should be installed before you start the migration:
Java SE 6
For our example source environments, we use Oracle Java Development Kit (JDK) 6. It is
supported by both Apache Tomcat 7.0.27 and WebSphere Application Server V8.5 Liberty
profile. However, the WebSphere Application Server V8.5 full profile supports IBM JDK 6
and IBM JDK 7. To demonstrate the migration of applications that are compatible with
both the full profile and Liberty profile, we use the IBM JDK 6 that is provided as part of the
IBM Installation Manager installation process of WebSphere Application Server V8.5. If it
is not possible to use this JDK, or if you installed the Liberty profile from the archive
installation process, you must install a supported JDK.
Apache Tomcat 7.0.27
This version is the latest version available at the time of the writing of this book.
IBM WebSphere Application Server V8.5 Liberty profile
Before you migrate to WebSphere Application Server V8.5 Liberty profile, familiarize
yourself with the sample applications shipped with the product. Also, examine the
publications that are listed in Related publications on page 437.
IBM DB2 Universal Database 10.1
WebSphere Application Server V8.5 Liberty profile supports many databases, but for our
example, we use DB2 for MvnForum in its source environment and all applications when
using WebSphere Application Server V8.5 Liberty profile.
WebSphere Application Server V8.5 Liberty Profile Developer Tools
WebSphere Application Server V8.5 Liberty profile Developer Tools (referred to as the
developer tools) and the Application Migration Tool are used for all three applications in
our example. For Easy JSP Forum, the official distribution available at
http://www.sourceforge.net does not use an enterprise package application model, so
you must import the application into the Eclipse to create the EAR file.
Application Migration Tool
The Application Migration Tool is used throughout this chapter to analyze the applications
that we migrate. The Application Migration Tool works best with the source code of an
application, so, where possible, we scanned the source code and provided details of the
results. For binary only packages, such as MvnForum, the Application Migration Tool
provides information about the non-compiled elements, such as JSP and XML files.
Although this information is useful, analyze the source code when possible, as it improves
the ease of migration.
276
Detailed instructions for installing, configuring, and managing Apache Tomcat 7.0.27 are
provided in the product documentation guides available at the following web page:
http://tomcat.apache.org/tomcat-7.0-doc/index.html
The following steps illustrate the process that we use to install and configure Apache Tomcat
7.0.27, and then to create a Tomcat server in Eclipse:
1. Download the Apache Tomcat 7.0.27 binary distribution from the following web page:
http://tomcat.apache.org/download-70.cgi
The file that is downloaded is apache-tomcat-7.0.27.zip (7.72 MB).
2. Extract all archives into the same directory (referred to as <tomcat_home>):
C:\apache-tomcat-7.0.27
3. Open Eclipse.
4. Right-click in the Servers view and select New Server.
5. When prompted to select the server type, click Apache Tomcat v7.0 Server.
6. Click Next.
7. In the Tomcat installation directory, click Browse to navigate to <tomcat_home>.
8. Click Installed JREs....
9. In the Installed JREs Preferences page, click Add....
10.Select Standard VM and click Next.
11.Click Directory, and navigate to the root of your Oracle JVM.
12.Click OK.
13.Provide a JRE name, for example, Oracle_JVM.
JRE name: If this JRE name is used by another installed JRE, you might receive an
error message that says that the JRE is in use. If so, you must provide a different name
and be aware of this name when you perform the later steps.
14.Click Finish.
15.Click OK to close to preferences page.
16.In the JRE: drop-down menu, select Oracle_JVM and click Finish.
17.Install the DB2 JDBC driver. The DB2 driver is used by our applications for connecting to
IBM DB2 Universal Database 10.1. Copy db2jcc4.jar and db2jcc_license_cu.jar from
the <db2_home>\java directory to the <tomcat_home>\lib directory.
277
Figure 9-1 The developer tools for operating a Liberty profile server from Eclipse
Figure 9-2 The security warning when you install the developer tools
278
279
280
281
282
Workspace: In our example, we use the same workspace to migrate the application from
Tomcat to the Liberty profile, highlighting tasks such as changing the targeted run time for
a project. However, you should have a back-up of your workspace and application before
you start the migration. Remove the application from the Tomcat server and stop Tomcat
before you start the migration.
283
7. Click the Apache Tomcat Application Migration rule set and click Set (Figure 9-4). This
action opens a prompt to select more detailed migration options.
8. Set the Target application server to WebSphere Application Server V8.5, the Source Java
version to Java 6, and the Target Java version to Java 6 (Figure 9-5).
Figure 9-5 Settings for the configuration of the target WebSphere version, and the source and
target JVM levels
IBM JVM: In our example, we ran this application on an IBM JVM, so we did not select
the Final target is a Liberty profile server running on Oracle JVM check box. You
should select this check box only if you are moving the application to the Liberty profile
and using only the Oracle JVM.
284
285
Manual adjustments
The remaining XML issue relates to using the context valve component. This component is
an Tomcat specific feature, which is used in the application to generate a log of all HTTP
requests that are made to the application, and the servers response. Currently, there is no
equivalent feature available in the Liberty profile, although you can use the full profile to
configure HTTP access logs. Therefore, although the logs are not generated, the warning can
be ignored without affecting the functionality of the booking system. To flag the issue as
ignored, complete the following steps:
1. Expand the Apache Tomcat to WebSphere deployment descriptor migration category
in the XML File Review tab of the Software Analyzer Results view.
2. Expand the Do not use the context valve component rule.
3. Right-click the context.xml result, and select Ignore Result. This action tags the result as
ignored and removes it for the reported results.
The next step is to update the Java code. Application Migration Tool highlights the usage of
org.apache.tomcat.dbcp.dbcp.BasicDataSource in the DataSourceManager class. This usage
is not compatible with WebSphere Application Server. To correct this issue, change the
reference to javax.sql.DataSource. Using javax.sql.DataSource is more portable than the
BasicDataSource, which is Tomcat specific.
286
To fix the issue of using Tomcat specific APIs, click Java Code Review Apache Tomcat
to WebSphere code Migration and expand the rule labeled Do not use Apache Tomcat
packages and APIs. This action opens the menu as shown in Figure 9-6. Double-click the
result for BuildDatabases. This action opens the BuildDatabases class, and moves the cursor
to the reported line. In this case, the application uses a Tomcat specific class when it outputs
server version information, but this class is not critical to the application. To fix this issue,
comment out this line. Currently, the Liberty profile does not provide an equivalent
mechanism.
The last two issues that are reported are checks to ensure that the correct context lookups
are defined in the deployment descriptors. For lookups in the DataSourceManager class, the
process of performing the quick fixes adds all the resource references to the web.xml file. For
the BuildDatabases class, the quick fix adds this class to the web.xml file of the application. If
the quick fixes were applied, you can now flag these results as ignored. To clear these
results, expand the rule, right-click each result, and select Ignore Result. This action flags
the result as ignored and removes it from the reported results.
Deployment descriptor bindings: You can see from the migration steps that the
necessary deployment descriptor bindings are created, so you can ignore these tasks.
When you analyze an application for the first time, these settings should be checked to
ensure that the required deployment descriptor bindings are n created where they
are required.
You can rerun Application Migration Tool by right-clicking the project in Eclipse and selecting
Software Analyzer IBM Redbooks Library Migration. This action should return
no results.
287
Example 9-3 The commands that are required to create the necessary DB2 databases
288
Password field editing: The Password field cannot be directly edited. You must
click Edit....
6. Create the Books data source:
a. Right-click Server Configuration in the Configuration Structure window and select
Add Data Source.
b. Set the ID to BooksDS. This value is useful for debugging purposes, as it means that
the Liberty server identifies this resource uniquely in output messages.
c. Set the JNDI name to DefaultDatasource.
JNDI name: The JNDI name for the BooksDS data source does not start with jdbc/.
It is important that the JNDI name is entered exactly as shown in the instructions,
including case, or the application throws an exception at run time.
d. Set the JDBC driver to the JDBC Driver you created (in our example, this drive is
DB2JDBCDriver).
e. Right-click the data source in the Configuration Structure window and select Add
Properties for DB2 JCC.
f. Click the Properties for DB2 JCC section to open it.
g. Set the Database Name to BOOKS.
h. Set the Server name to the host name of your server.
i. Set the User and password fields as required.
Password field: The Password field cannot be directly edited. You must
click Edit....
7. Create the Style data source:
a. Right-click Server Configuration in the Configuration Structure window and select
Add Data Source.
b. Set the ID to StyleDS. This value is useful for debugging purposes, as it means that the
Liberty profile server identifies this resource as unique in output messages.
c. Set the JNDI name to jdbc/globalStyleSettings.
d. Set the JDBC driver to the JDBC Driver you created (in our example, it is
DB2JDBCDriver).
e. Right-click the data source in the Configuration Structure window and select Add
Properties for DB2 JCC.
f. Click the Properties for DB2 JCC section to open it.
g. Set the Database Name to STYLES.
h. Set the Server name to the host name of your Liberty profile server.
i. Set the User and Password fields as required.
289
290
When prompted for login details, use the details of the user you created in the Basic
User Registry.
Testing: To perform any of the Test functions, ensure that the inTesting environment
variable is set to true. This variable can be found in the WEB-INF/web.xml file of your
application. If this variable is set to anything other than true, you cannot create the test
database and test data.
After this action runs successfully, go back to the main page and click Populate the
Database with test data. Again, this action requires a user in the test role, although if this
action is done from the same browser window, it is likely that your credentials are
remembered from the previous action.
After this action runs successfully, go back to the main page, attempt to log in with a user ID
of user1 and a password of password1, set the foreground and background colors, and return
a book. In addition, you can search for a book and borrow it. Although this test is a
satisfactory one in a development environment, in a production environment, a more rigorous
test process is expected.
291
For this particular project, we decide to import the application in to Eclipse after it is compiled,
rather than importing the source code first and compiling within Eclipse. Here we take
advantage of the applications pre-existing build process, which is developed by a team
already familiar with the application and preferred practices in building it. When you test the
application with WebSphere Application Server, we found that all the tested functionality
worked as expected, so we are satisfied in this case. However, we did perform a scan of the
source code, which we describe later. In addition, in the case of a migration for a production
system, running the Application Migration Tool on the source of the application has a
significant effect on reducing the complexity of a migration.
292
After the import is complete and the workspace is rebuilt, Eclipse reports a number of
potential problems with the application:
A number of broken links. These broken links are in the original MvnForum application.
A number of HTML warnings about the usage of obsolete HTML tags. This usage is from
the original MvnForum application.
A number of reported JSP problems.
Few Javascript Tasks. These issues are caused by FIXME : tags in the original
MvnForum application.
Few XML problems, including an error reported in a file that is downloaded from the
following URL:
http://www.mvnforum.com/dtd/mvnforum_1_0_rc2.dtd
These warnings and errors do not prevent the application from running in Tomcat or from
using the Liberty profile, so they do not need to be addressed as part of the migration. The
errors and warnings can be suppressed by configuring the Markers view. To do this task,
complete the following steps:
1. Select Configure Contents from the View menu, as shown in Figure 9-7.
293
3. In the Types listing, find and clear the following items to suppress all the existing warnings:
Broken Link
HTML Problem
JSP Problem
JavaScript Task
XML Problem
<driver_class_name>com.ibm.db2.jcc.DB2Driver</driver_class_name>
<database_url>jdbc:db2://localhost:50000/MVNFORUM</database_url>
<database_user>db2admin</database_user>
<database_password>your_password</database_password>
4. Save mvncore.xml.
294
295
8. Change the Working directory radio button to Other, and click FileSystem to navigate to
the webapps folder that is created inside your server location
(C:\tomcatServerLocation\webapps in our example).
9. Click Apply Close and then restart the Tomcat server.
To deploy the application, right-click the project in Eclipse, select Run As Run On Server,
and restart the server if prompted. After Tomcat and the application start, a browser opens
and shows the MvnForum application.
296
Considering that the application works with DB2 using the default connection pool, you must
change the connection pool mechanism. The default connection pool that is provided in
MvnForum is not designed for production use, so you must use the WebSphere provided
connection pool.
There are many benefits to using the WebSphere connection pool implementation. The
connections are obtained through JNDI from the WebSphere data source and automatically
participate in the container-managed transactions of the server.
To implement these changes, you must update the mvncore.xml configuration file. To use
WebSphere Application Server data sources, you must change two XML parameters. The file
is in the src directory of the Java Resources window in the MvnForum project in Eclipse. The
required updates are described in Example 9-6.
Example 9-6 Define data source in mvncore.xml
<paramoptions>
<context_path>/mvnforum/mvnforum</context_path>
<server_path>http://localhost:9080</server_path>
</paramoptions>
...
<mvncoreconfig>
...
<allow_http_referer_prefix_list>
http://localhost:9080;http://127.0.0.1:9080
</allow_http_referer_prefix_list>
...
</mvncoreconfig>
297
<mvnforum_home>apps/MvnForum.war/WEB-INF/mvnForumHome</mvnforum_home>
File locations: For this scenario, we use the file location to which the files are placed by
Eclipse. This scenario assumes that you use the default project name when you import the
WAR file into Eclipse. If you choose to change the project name, you must update the
mvnforum.xml file and use the new project name. By using this technique, you can avoid
using an absolute path to the configuration file, which prevents the application from
working if the location of the Liberty profile server is moved.
298
299
By investigating the issues that are raised, we could determine the areas likely to cause
issues to our migration. After we analyzed the issues, we decided we were happy to use the
application without any changes. We see this situation as a beneficial exercise, as it enabled
us to act to address issues before we attempted a deployment.
When you migrate any application, any potential issues that are highlighted by the Application
Migration Tool should be investigated and researched thoroughly. These actions provide a
good understanding of potential problems and how they should be addressed.
300
Parameter
Value
ID
DB2DriverFileSet
Base directory
Includes pattern
Value
Database name
MVNFORUM
Server name
localhost
Port number
50000
User
db2admin
Password
your_password
301
<featureManager>
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
</featureManager>
<fileset id="DB2DriverFileset" dir="<DB2_driver_location>" includes="db2jcc4.jar,
db2jcc_license_cu.jar"/>
<library filesetRef="DB2DriverFileset" id="DB2DriverSharedLibrary"/>
<jdbcDriver id="DB2Driver" libraryRef="DB2DriverSharedLibrary"/>
<dataSource jdbcDriverRef="db2Driver" jndiName="jdbc/dsmvnforum">
<properties.db2.jcc databaseName="MVNFORUM" password="your_password"
user="db2admin"/>
</dataSource>
<application id="MvnForum" location="MvnForum.war" name="MvnForum" type="war"/>
To run the MvnForum application without using the developer tools, configure the server.xml
file of your server (in our example, server1) to contain the contents listed in Example 9-9.
Extract the MvnForum.war file into <liberty_home>/usr/servers/server1/apps/MvnForum.war
(ensuring that the directory name has .war at the end). Start the server by running the
following command:
<liberty_home>/bin/server start server1
302
Easy JSP Forum implements the JSP 2.0 and Servlet 2.4 specifications. In the distribution
code, the application connects to a Microsoft Access database under an ODBC data source.
In this example, we migrate the Easy JSP Forum to a DB2 database under a WebSphere
Application Server data source using a type 4 driver. Easy JSP Forum is included in this book
for the following reasons:
Easy JSP Forum is an interesting migration example because it is implemented with several
technologies and requires both database adjustments and source code updates.
303
6. Using the Browse button, navigate to the directory where you extracted the
easyjspforum.zip file.
7. Select all the folders under the forum folder except for the beans and WEB-INF folders. Also,
select the index.jsp and popup.jsp files, as shown in Figure 9-9, and click Finish.
The WEB-INF folder: In most cases, the WEB-INF folder is included in the list of files to
import, as it often contains the web.xml deployment descriptor file. However, in this
case, the file is not included in the application. During migration, you must create and
edit a web.xml file, so you generate one when you must.
Figure 9-9 Files selection - do not select the forum folder itself
8. Now open the forum project and right-click the src folder in Java Resources (Figure 9-10)
and select New Package. Set the package name to forum and click Finish.
9. Right-click the new package and select Import.... Expand the General list, select File
System, and click Next.
10.Using the Browse button, navigate to the directory where you extracted the
easyjspforum.zip file.
304
11.Select all the Java files in the beans folder (Figure 9-11) and click Finish.
Figure 9-11 Files selection from beans directory - do not select the beans directory itself
12.This action updates the package to forum.beans. To switch this setup back, right-click the
forum.beans package and select Refactor Rename.... Set the new name to forum and
click OK.
The application is now successfully created in Eclipse.
305
9.6.5 Migrating the Easy JSP Forum application to the Liberty profile
This section describes the necessary steps for migrating the application from Tomcat to the
Liberty profile. The steps of this migration involve IBM DB2 Universal Database 10.1
database creation, WebSphere Application Server data source configuration, source code
changes to connect to WebSphere Application Server data sources, and SQL syntax fixes.
The last part of this section describes how to configure the resources that are required by the
Easy JSP Forum to run in WebSphere Application Server V8.5 Liberty profile, and how to
deploy and test the migrated application.
306
Next, create a file that is called easyJSP_DB2.sql and copy the data in Example 9-11 into the
file. This action creates the data structure and the initial sample data. After this file is
populated, run it from the DB2 prompt by running the following command:
db2 -tvf easyJSP_DB2.sql
Example 9-11 Creating the data structure and sample data of the EasyJSP database
307
import javax.naming.*;
import javax.sql.*;
To connect to the data source, you must change the connection parameters. Example 9-13
shows how you should perform this operation.
Example 9-13 Changing the connection parameters
File Boxes.java
Line 121 : String query = "INSERT INTO Boxes (box_id, member_id, [box_name],
[sort_desc]) " +
File Members.java
Line 75 : String query = "SELECT member_id FROM Members WHERE [username]='" +
username + "'";
Line 133 : String query = "INSERT INTO Members (member_id, [username], [password],
[firstname], [lastname], [email], [regdate], [type]) " +
Line 166 :
"email='" + email + "' WHERE [username]='" + username + "'";
Line 211 : String query = "SELECT * FROM Members WHERE [username]='" + username +
"'";
308
File Threads.java
Line 220 : String query = "INSERT INTO Threads (thread_id, parent_id, box_id,
member_id, [subject], [post_text], post_date) " +
Line 244 : String query = "INSERT INTO Threads (thread_id, parent_id, box_id,
member_id, [subject], [post_text], post_date) " +
3. Enter a name for the configuration, such as Easy JSP Forum Migration.
4. In the new Software Analyzer configuration, change the scope to cover the forum project
by selecting the Analyze selected projects radio button and then selecting the
forum project.
5. Now change to the Rules tab in the Software Analyzer Configurations wizard.
6. Select the Apache Tomcat Application Migration Rule set and click Set....
7. In the Rule Set configuration dialog box, set the Target application server to WebSphere
Application Server V8.5, the Source Java version to Java 1.4, and the Target Java version
to Java 6, and click OK.
8. Click Apply and then click Analyze.
Java rules: For this scenario, we are interested only in rules specific to our application
migration. However, you can select all the Java rules if you want. We found that for
Easy JSP Forum, the remaining rules generated no errors and many suggestions to
use preferred practices. These items are the ones that we would choose to implement if
possible, as they are designed to improve performance and stability where possible.
309
The results of the analysis report no problems in either XML or JSP files and 31 results for the
Ensure that JNDI lookups have corresponding deployment descriptor entries option.
Investigating these results shows that they are all due to no deployment descriptor entry for
the JNDI lookup on jdbc/easy. As the web.xml file that contains the resource references did
not exist in the original application, you must generate this file and populate it with the
required resource reference. To do this task, complete the following steps:
1. Right-click the forum project and select Java EE Tools Generate Deployment
Descriptor Stub.
2. Open the web.xml file that is created in the WebContent/WEB-INF folder of the
forum project.
3. In the Source view, add the information from Example 9-15.
Example 9-15 The resource reference to add to the deployment descriptor
<resource-ref>
<res-ref-name>jdbc/easy</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
These actions do not remove the results that are shown, but you now have the definition that
you needed to check for, so no further action is required.
310
Parameter
Value
ID
DB2DriverFileSet
Base directory
Includes pattern
Value
Database name
EASY
Server name
localhost
Port number
50000
User
db2admin
Password
your_password
311
9.7 Summary
This chapter provided steps to migrate three applications from Apache Tomcat 7.0.27 to
WebSphere Application Server V8.5 Liberty profile. To assist with this task, we used the
Application Migration Tool. The toolkit provides useful instructions for simple applications,
and it shows an even greater benefit when migrating applications that use many features and
configurations specific to Apache Tomcat 7.0.27. In these cases, using quick fix processes
and issuing highlighting enables a faster migration and a reduction in the complexity of the
task. In addition to using Application Migration Tool, we also provided manual steps to
address specific issues where required.
We addressed a number of issues that users might see with their applications, such as a
difference between an applications current working directory under different configuration
and different servers. We found that some interesting issues were uncovered by our testing
process, a situation that is likely to apply to all migrations. In a production environment, you
would expect a migrated application to undergo a thorough testing process to ensure that the
migration is complete.
312
10
Chapter 10.
Application Framework
migration
This chapter describes the migration of two sample applications, one written for Seam and
the other for Spring, to WebSphere Application Server V8.5.
This chapter describes the following topics:
Migrating a Seam Framework application
Migrating a Spring Framework application
313
Legal disclaimer: IBM does not warrant or represent that the code provided is complete
or up-to-date. IBM does not warrant, represent or imply reliability, serviceability, or function
of the code. IBM is under no obligation to update content nor provide further support.
All code is provided "as is," with no warranties or guarantees whatsoever. IBM expressly
disclaims to the fullest extent permitted by law all express, implied, statutory and other
warranties, guarantees, or representations, including, without limitation, the warranties of
merchantability, fitness for a particular purpose, and non-infringement of proprietary and
intellectual property rights. You understand and agree that you use these materials,
information, products, software, programs, and services, at your own discretion and risk
and that you will be solely responsible for any damages that may result, including loss of
data or damage to your computer system.
In no event will IBM be liable to any party for any direct, indirect, incidental, special,
exemplary or consequential damages of any type whatsoever related to or arising from use
of the code found herein, without limitation, any lost profits, business interruption, lost
savings, loss of programs or other data, even if IBM is expressly advised of the possibility
of such damages. this exclusion and waiver of liability applies to all causes of action,
whether based on contract, warranty, tort or any other legal theories.
315
2. Enter the information that is highlighted in bold in Example 10-1 into the interactive script.
Replace the databases user name and password with the ones for your environment.
Example 10-1 Code snippet
issue database manager commands and SQL statements from the command
For example:
=> connect to sample
=> bind sample.bnd
= DB2/NT 10.1.0
= DB2ADMIN
= TESTDB
316
317
[input] Enter the Java package name for your entity beans [com.mydomain.mypr
oject.model] [com.mydomain.myproject.model]
[input] Enter the Java package name for your test cases [com.mydomain.myproj
ect.test] [com.mydomain.myproject.test]
[input] What kind of database are you using? [hsql] ([hsql], mysql, derby, o
racle, postgres, mssql, db2, sybase, enterprisedb, h2)
db2
[input] Enter the filesystem path to the JDBC driver jar [] []
C:/IBM/SQLLIB/java/db2jcc.jar
[input] Enter the filesystem path to the license jar [] []
C:/IBM/SQLLIB/java/db2jcc_license_cu.jar
[input] Enter the Hibernate dialect for your database [org.hibernate.dialect
.DB2Dialect] [org.hibernate.dialect.DB2Dialect]
[input] Enter the JDBC driver class for your database [com.ibm.db2.jcc.DB2Dr
iver] [com.ibm.db2.jcc.DB2Driver]
[input] Enter the JDBC DataSource class for your database [com.ibm.db2.jcc.D
B2SimpleDataSource] [com.ibm.db2.jcc.DB2SimpleDataSource]
[input] Enter the JDBC URL for your database [jdbc:db2:test] [jdbc:db2:test]
jdbc:db2://localhost:50000/TESTDB
[input] Enter the database username [sa] [sa]
db2admin
[input] Enter the database password [] []
passw0rd
[input] Enter the database schema name (Enter '-' to clear previous value) [
] []
db2admin
[input] Enter the database catalog name (Enter '-' to clear previous value)
[] []
[input] Are you working with tables that already exist in the database? [n]
(y, [n])
[input] Do you want to recreate the database tables and execute import.sql e
ach time you deploy? [n] (y, [n])
[propertyfile] Creating new property file: c:\jboss-seam-2.2.2.Final\seam-gen\bu
ild.properties
[echo] Installing JDBC driver jar to JBoss AS
[copy] Copying 2 files to C:\Program Files\jboss-5.1.0.GA\server\default\li
b
init:
init-properties:
[echo] C:/Program Files/jboss-5.1.0.GA
validate-workspace:
validate-project:
settings:
[echo] JBoss AS home: C:/Program Files/jboss-5.1.0.GA
[echo] GlassFish home: C:/Program Files/glassfish-v2.1
[echo] Project name: myproject
318
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
[echo]
BUILD SUCCESSFUL
3. Run seam new-project to generate a new project. You should see a BUILD
SUCCESSFUL message.
4. Run seam generate-entities to generate the components for our database table. You
should see a BUILD SUCCESSFUL message.
5. Run seam deploy to deploy the application to JBoss Application Server. You should see a
BUILD SUCCESSFUL message.
Our example application is now packaged as an EAR file in C:\Projects\myproject\dist,
which we defined as our project directory during script execution.
10.1.5 Importing the EAR file and source code to Rational Application
Developer
To import the EAR file and the source code to Rational Application Developer, complete the
following steps:
1. Start the Rational Application Developer for WebSphere Software by clicking Start IBM
Software Delivery Platform IBM Rational Application Developer 8.5 IBM
Rational Application Developer.
319
2. Start the Import wizard by clicking File Import. Expand the JavaEE node in the import
source tree and select EAR file. See Figure 10-1.
320
3. In the Enterprise Application Import window, browse to the location of the EAR file that is
generated by seam-gen, which can be found at
C:\Projects\myproject\dist\myproject.ear. See Figure 10-2. The location of this file is
determined by the choices we made during the seam setup script execution. Click Next.
4. Click Next on the Utility JARs and Web Libraries window without selecting any libraries.
321
5. On the EAR Module and Utility JAR Projects window, clear the check box next to the
jboss-seam.jar. See Figure 10-3. Click Finish.
6. Import the source files to the project structure. Upon inspection, you see that the
myProject_EJB module imported the classes. Import the source files of these classes to
the ejbModule folder and remove the class files from the project.
Figure 10-4 shows the module structure before and after the source code import.
Figure 10-4 EJB module structure before and after source code import
322
7. Click the ejbModule node in the myproject_EJB module and select File Import.
8. Click General File System in the Import window. The File System Import window
opens. Import the source code from two locations:
C:\Projects\myproject\src\hot
C:\Projects\myproject\src\main
9. Click Browse and select the C:\Projects\myproject\src\hot folder that contains the
source code files for the com.mydomain.myproject.action package. Select all source files,
as shown in Figure 10-5. Click Finish.
10.Repeat step 9 for the C:\Projects\myproject\src\main folder, which contains the source
code for the com.mydomain.myproject.model package.
11.Delete the packages under the ImportedClasses node by selecting them, clicking Delete,
and confirming the deletion.
The project structure looks like the right pane of Figure 10-4 on page 322.
Analyzing the web module, we can see that there are no imported classes that we must
replace with source files. Resources such as html and xhtml files, style sheets, and
images are imported automatically during the EAR import.
323
Figure 10-6 Before and after libraries in EAR moved to a shared library
324
For our project, the additional dependencies in Table 10-1 must be copied to
<shared_lib_dir> from C:\Projects\myproject\lib.
Table 10-1 Shared dependencies to be copied
antlr.jar
antlr-runtime.jar
bsh.jar
cglib-nodep.jar
commons-collections.jar
concurrent.jar
dom4j.jar
gwt-servlet.jar
hibernate-annotations.
jar
hibernate-commonsannotations.jar
hibernate-core.jar
hibernate-entitymanager
.jar
hibernate-validator.jar
javassist.jar
jboss-common-core.jar
jboss-seam-flex.jar
jsf-api.jar
jsf-impl.jar
log4j.jar
slf4j-api.jar
slf4j-log4j12.jar
6. Click the myproject application module. Right-click and select Java EE Open
WebSphere Application Server Deployment to open the WebSphere Application Server
Deployment window.
7. Scroll down to the Shared Library section. Expand the section and click Add.
8. Enter the Name and Description fields. We used SeamSharedLibs as the shared
library name.
9. Click Browse on the Class Path section of the window. A file selection dialog box is
displayed (Figure 10-7). Select <shared_lib_folder> and click OK.
We must modify the application class loading mechanism because we are using a
third-party persistence provider. The hibernate-entitymanager.jar file and its
dependencies serve this purpose.
325
326
327
6. Expand the XML File Review section and the results in this section. The Application
Migration Tool detects Hibernate as a persistence provider, and the Seam framework
(Figure 10-10).
328
9. The Class-Path Review highlights several classpath issues that can be quick fixed
(Figure 10-12).
10.Expand the Class-Path Review section and the results in this section. Right-click one of
the result lines and click Quick Fix All. You may also preview changes that are performed
through quick fixes (Figure 10-13).
329
<ejb-local-ref>
<description></description>
<ejb-ref-name>EjbSynchronizations</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
<ejb-link>EjbSynchronizations</ejb-link>
</ejb-local-ref>
330
2. To enable the WebSphere transaction manager lookup, add the following property to the
persistence.xml file:
<propery name=hibernate.transaction.manager_lookup_class
value=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup />
331
8. Click Add External JARs. A file selection dialog box is displayed. Navigate to the
C:\IBM\SQLLIB\java folder and select the following JARs and click OK to add them:
db2jcc.jar
db2jcc_license_cu.jar
The JDBC provider settings window (Figure 10-14) opens. Click Finish.
9. The new JDBC provider is listed in the JDBC providers list. Click this line to select DB2
JDBC Provider, and then click Add in the data sources subsection.
332
10.Select DB2 Universal JDBC Driver Provider in the Create Data Source window
(Figure 10-15). Click Next. The Data Source details window opens.
333
334
13.In the Create Resource Properties window (Figure 10-17), select the databaseName
Resource Property. In the value field for this property, enter TESTDB. Select the
serverName property. In the value field for this property, enter localhost. Click Finish.
335
14.The Data Sources section of the WebSphere Application Server Deployment window now
looks like Figure 10-18. Press Ctrl+s to save your changes.
336
5. Select the myproject_EJB check box (Figure 10-19) and click OK to continue.
6. Open the copied persistence.xml file in the editor. Switch to the Source tab for
faster editing.
7. Add the following snippet to persistence.xml, beneath the <jta-data-source> element:
<jar-file>myproject.jar</jar-file>
8. Remove the following line from persistence.xml:
<property name="jboss.entity.manager.factory.jndi.name"
value="java:/myprojectEntityManagerFactory"/>
9. Add the following line inside the <properties> element in persistence.xml:
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
10.Press Ctrl+s to save your changes.
11.Fix the persistence unit reference in the web module. Open
myproject_WEB/WebContent/WEB-INF/web.xml in the editor. Switch to the Source tab.
12.Replace the line
<persistence-unit-name>../myproject.jar#myproject</persistence-unit-name> with
<persistence-unit-name>myproject</persistence-unit-name>.
337
10.1.7 Summary
While we migrate our sample seam-gen generated application, we demonstrated the
following concepts:
A source migration to Rational Application Developer for WebSphere Software as a build
and test environment
Using the Application Migration Tool
Using shared libraries for managing dependencies
The main points to highlight during this migration are as follows:
Differences in default JNDI bindings require rework on JNDI lookups. Seam frameworks
require a fair amount of configuration to work with WebSphere default JNDI bindings.
Libraries that ship with JBoss Application Server distributions and not with WebSphere
Application Server create more runtime dependencies that must be corrected.
Using Hibernate for persistence requires a transaction strategy configuration specific
to WebSphere.
Using a third-party JPA provider requires changes to the classloading configuration.
Using an old JSF implementation requires changes in the classloading configuration and
the addition of the corresponding listener to web module configuration.
338
339
We use Version 10.8.2.2 in our environment, which is the latest version at the time of the
writing of this book. Extract the downloaded file to a suitable location. We use
C:\db-derby-10.8.2.2-bin as the directory.
340
To implement this fix, for all classes that can be retrieved as a set with a result of a
one-to-may relationship (in our case, IBMRedBook, Chapter, and Participant), open the
source file at C:\sample\src\main\java\test\ibmredbookproject\domain folder in your
project folder, and override the hashCode and equals methods, as shown in
Example 10-5. The example code is for the IBMRedBook class. You may append the
same block of code to all three classes just by changing the class name in the equals
method. Be careful to establish only the equality and hashCode methods on the name
fields of these classes.
Example 10-5 Overriding hashCode and equals methods
@Override
public int hashCode() {
return (name == null) ? 0 : name.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IBMRedBook other = (IBMRedBook) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
8. Edit src\main\resources\META-INF\spring\database.properties and add a user name
and password for the Derby database by inserting the following lines:
database.username=derbyuser
database.password=derbyuser
9. Before you build the project, make sure that the database is running, because the Maven
build process involves running automated tests, some of which require a connection to the
database. To start the database, complete the following steps:
a. Open a new command prompt and change the directory to
C:\db-derby-10.8.2.2-bin\lib.
b. Enter java -jar derbyrun.jar server start and press Enter.
c. Leave the comment prompt open for the rest of the exercise.
10.To build the generated source code, enter mvn install at the command prompt in the
project directory and press Enter.
11..Verify the application at the Jetty server by entering mvn jetty:run-exploded and
pressing Enter. After the necessary libraries are automatically downloaded, you may
check the application at http://localhost:8080/ibmredbookproject/ and try creating,
listing, or modifying Chapters and IBMRedBooks. At the time of the writing of this book,
dialog components were not being properly handled and there were some outstanding
issues with using PrimeFaces modal dialogs in Internet Explorer Version 8.
341
10.2.5 Importing the EAR file and source code to Rational Application
Developer
To import the WAR file and source code to Rational Application Developer, complete the
following steps:
1. Start Rational Application Developer for WebSphere Software by clicking Start IBM
Software Delivery Platform IBM Rational Application Developer 8.5 IBM
Rational Application Developer.
2. Start the Import wizard by clicking File Import. Expand the Web node in the import
source tree and select WAR file. See Figure 10-20.
342
3. In the Enterprise Application Import window, browse to the location of the WAR file that is
generated by Spring Roo, which can be found at
C:\sample\target\ibmredbookproject-0.1.0.BUILD-SNAPSHOT.war. See Figure 10-21.
Click Next.
4. Click Finish on the Utility JARs and Web Libraries window without selecting any libraries.
343
2. The WAR file contains numerous libraries, including libraries for Hibernate and Spring,
under the WebContent/WEB-INF/lib node. Move these libraries to a shared library. Select
all of the libraries by pressing and holding the Ctrl key.
3. Copy these libraries to the clipboard by right-clicking and selecting Copy. Paste the
copied libraries in to <shared_lib_dir>.
4. Delete the selected libraries from the EAR module by selecting Delete.
5. Delete the following JAR files from <shared_lib_dir>, because classes contained in these
libraries are provided by WebSphere Application Server:
hibernate-jpa-2.0-api-1.0.1.Final.jar
jta-1.1.jar
validation-api-1.0.0.GA.jar
6. Click the myproject application module. Right-click and select Java EE Open
WebSphere Application Server Deployment to open the WebSphere Application Server
Deployment window.
7. Scroll down to Shared Library section. Expand the section and click Add.
8. Complete the Name and Description fields. We used SharedLibsRoo as the shared
library name.
9. Click Browse on the Class path section of the window. A file selection dialog box is
displayed (Figure 10-22). Using the dialog box, select <shared_lib_folder> and click OK.
You must modify the application class loading mechanism because you use a third-party
persistence provider. The hibernate-entitymanager-3.6.9.Final.jar file and its
dependencies that we added serve this purpose.
We are also using a third-party JSF implementation. WebSphere Application Server
supports JSF 2.0, but our application is built with JSF 2.1. Therefore, we add the JSF
implementation libraries to the shared library, as we added jsf-api-2.1.2.jar and
jsf-impl-2.1.2.jar in the previous section. More information about the JSF
implementation configuration can be found at the following website:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was
-nd-mp&topic=twebjsf
344
10.Scroll down to the Application section and change the Classloader mode to
PARENT_LAST.
11.Press Ctrl+s to save your changes.
345
5. Click Analyze. After the analysis is complete, the Software Analyzer Results view is
displayed. Inside the Software Analyzer Results view, you can see a tab for each domain
of analysis. In our case, the tabs are named Class-path Review, XML File Review, JSP
Review, and Java Code Review.
6. Expand the XML file review section and the results in this section. In Figure 10-24,
Application Migration Tool detected the usage of Hibernate as a persistence provider, and
Spring framework usage, and shows their respective configuration files. Also, as a part of
Spring preferred practices rules, you are reminded to check the configuration of
LocalContainerEntityManagerFactoryBean Spring Framework configuration element.
346
347
The JDBC provider settings window (Figure 10-25) opens. Click Finish.
9. The new JDBC provider is listed in the JDBC providers list. Click this line to select DB2
JDBC Provider, and then click Add in the data sources subsection.
348
10.Select Derby Network Server Using Derby Client in the Create Data Source window
(Figure 10-26). Click Next. The Data Source details window opens.
349
350
13.In the Create Resource Properties window (Figure 10-17 on page 335), select the
databaseName Resource Property. In the value field for this property, enter
ibmredbookproject. Select the serverName property. In the value field for this property,
enter localhost. Click Finish.
351
10.2.7 Summary
While we migrated our sample Spring Roo generated application, we demonstrated the
following concepts:
Using Rational Application Developer for WebSphere Software as a build and test
environment
Using WebSphere Application Server Migration Tool
Using shared libraries for managing dependencies
352
353
354
Part 4
Part
355
356
11
Chapter 11.
357
The migration process can involve modifying Java source code, JavaServer Pages (JSP),
and deployment descriptors. The Application Migration Tool helps perform these types of
code changes. The Application Migration Tool scans for a number of known issues in
applications that are being migrated from WebSphere Application Server Versions 5.1, 6.0,
6.1, or 7.0 to WebSphere Application Server Versions 7.0, 8.0, or 8.5. Where possible, a
quick fix is provided to change the application code to address the changes
between versions.
For WebSphere Application Server version migration, the tool supports migration from:
to:
WebSphere Application Server Version 7.0
WebSphere Application Server Version 8.0
WebSphere Application Server Version 8.5
358
New Java and XML rules to migrate to WebSphere Application Server Version 8.5
New Java SE 7 rules to flag Java 7 compatibility changes if you choose to use Java 7
A new dynamic rule set dialog box, which simplifies rule selection and ease of use
New depreciation rules
Chapter 11. Installation and configuration of the Application Migration Tool - WebSphere Version to Version
359
3. From the search results window (Figure 11-1), click the Install button next to the section
that includes IBM WebSphere Application Server Migration Toolkit.
360
4. Select the Application Migration Tool check box, which selects both the main feature
and the other included features, as shown in Figure 11-2.
C:\Program Files\IBM\SDP\eclipsec.exe
-application org.eclipse.equinox.p2.director
-metadataRepository
jar:file:C:/<amtDownloadDir>/Application_Migration_Tool_WebSphere_Version_to_Versi
on_vn.n.n.zip!/
-artifactRepository
jar:file:C:/<amtDownloadDir>/Application_Migration_Tool_WebSphere_Version_to_Versi
on_vn.n.n.zip!/
-installIU com.ibm.ws.appconversion_feature.was2was.feature.group
-nosplash
The corresponding uninstall command is shown in Example 11-2.
Example 11-2 Uninstall
C:\Program Files\IBM\SDP\eclipsec.exe
-application org.eclipse.equinox.p2.director
-uninstallIU com.ibm.ws.appconversion_feature.was2was.feature.group
-nosplash
Chapter 11. Installation and configuration of the Application Migration Tool - WebSphere Version to Version
361
Figure 11-3 Install the Migration Toolkit using Rational Application Developer V8.5
362
5. In the Install window, select the plug-in that you want to install (Figure 11-4). Click Next.
6. Accept the license agreement and click Finish to begin the installation.
7. After the installation is completed, click Restart Now to restart Rational Application
Developer.
Chapter 11. Installation and configuration of the Application Migration Tool - WebSphere Version to Version
363
364
12
Chapter 12.
Concepts
Plants by WebSphere sample application migration
Migration of Plants By WebSphere
Probability Distribution Sample
Web services Axis 2 stock quote
365
12.1 Concepts
For most applications, migrating from one version of the WebSphere Application Server to a
later version is straightforward and occurs when the version of the application server that is
used to host the application is upgraded. However, that upgrade of the installed application
server is only a small part of the overall version to version migration effort.
366
Assessment
Planning
Skills
Runtime environment
Development environment
Test, production, and review
Assessment
Assessment is the first step of migration planning and is important, as it identifies all factors
that have an impact on the migration plan. It is requirements gathering based on each
individual companys situation. It has the following steps:
Identify the stakeholders and identify a core migration team (especially in the case of large
migration projects).
Identify the education requirements for both developers and administrators. Hardware
requirements should be assessed during this phase and any possible upgrade should be
considered. A hardware upgrade should be planned for production systems and any
systems that are used for development. A possible hardware upgrade could be 32-bit
systems to 64-bit systems.
Identify the level of WebSphere Application Server to migrate to. The factors that affect
this decision are requirements for any specific Java EE and Java SE version, any
requirements of third-party applications or other WebSphere products and any
architectural or compatibility changes in WebSphere Application Server. During this step,
the vendor applications should be assessed for readiness to execute the version of
WebSphere Application Server to which migration is being planned. The application
should be assessed for the topology for downtime tolerance and failover support. Then,
the application should be assessed for Java EE specification changes and JRE changes.
Review the testing practices to determine if there is adequate coverage. The amount of
automated testing is also important to ensure repeatable success.
Planning
A migration plan should be built that takes each of the assessment results into account. It has
the following steps:
Acquire and plan for upgrading hardware requirements.
Upgrade any prerequisite software, such as the operating system and web server levels.
Address your education needs.
Identify early adopters of the migrated application, so that the lessons learned may be
applied to further iterations with other teams. While you work with the early adopters, pilot
projects that can be used to drive the migration process should be identified.
Create an application rollout strategy. From the information is collected so far, build an
execution timeline, taking the availability requirements, the maintenance window, and
lockdown periods into consideration.
Include and practice a rollback plan before you attempt the migration of production
systems. The WebSphere Application Server configuration migration runtime tools and
techniques provide a good rollback plan by not destroying the old WebSphere Application
Server environment before you install the new WebSphere Application Server
environment. This situation enhances the ease of supporting a rollback plan.
367
Skills
Various techniques can be used for education, including formal classes and online education.
The aspects of education that should be considered are new development tooling, changes in
WebSphere Application Server administration model, changes in the new version of
WebSphere Application Server, and new standards, such as Java EE.
Runtime environment
The migration of the runtime environment covers the migration of the application servers
configuration. We touch on aspects of this part of the migration process. In addition, the
runtime environment migration is covered in more detail in WebSphere Application Server V7
Migration Guide, REDP-4635.
Most organizations have more than one runtime environment, including development test,
system test, performance, and pre-production environments. For the migration period, you
need parallel test environments in most if not all of the test environments so that you can
maintain applications that are not migrated, but also to support testing for the new version. It
is also important to use some of these test systems to test your migration plan, especially
those systems that are the closest to representing the production environment.
Development environment
A development environment or application migration is one of the most time-consuming parts
of the version to version process.
Moving to the next version of WebSphere Application Server may require a change in
integrated development environment (IDE). Iteration can be useful in this transition as well.
There is usually no need to upgrade applications to the latest J2EE specification level
supported by the version of WebSphere Application Server that you use. Support is also
provided to run applications that are written to these earlier level J2EE specifications.
There might be no development that is required to change existing applications, but this
situation is not always the case. If changes are required, it is important to try and keep the
changes minimal, and make only those changes that are required to get the application
migrated and running on the new version. After a successful and stable migration to the
WebSphere Application Server, it is safe to use the new features and functions of the latest
version. Also, deprecation should be addressed at some point in time.
368
369
370
JPA changes
Here are the JPA changes:
Change in the JPA cascade strategy: There is a behavior change for entity relationships
that use cascade types PERSIST, MERGE, and ALL. The previous release checks the
database for the existence of the related Entity before it persists the relationship to that
Entity. This action resulted in an extra Select being sent to the database. In the current
release, code is added so that when you cascade a persist to a related Entity without a
persistence state, the persist (insert) happens without first checking the database. This
action might result in an EntityExistsException if the related Entity exists in the
database. To revert this behavior to the previous release, set the value of the
openjpa.Compatibility property CheckDatabaseForCascadePersistToDetachedEntity
to true.
JPA MetaModel code generation that concerns ListAttribute changed. In previous
releases, the MetaModel implementation generated a ListAttribute for every array. This
behavior is correct if the array is annotated as a PersistentCollection, but not correct for
unannotated arrays (for example, byte[], char[]). This behavior is corrected so that arrays
that are not stored as PersistentCollections use a SingularAttribute instead of a
ListAttribute. The behavior can be reverted by setting the Compatibility property
<UseListAttributeForArrays to true in persistence.xml to the property
name="openjpa.Compatibility" value="UseListAttributeForArrays=true".
Moving to Java EE 6
WebSphere Application Server V8.0 conforms to Java EE 6, and the migration of applications
should consider changes in Java EE 6 when you migrate to V8.0.
EJB changes
Table 12-1 describes the EJB changes that must be considered.
Table 12-1 EJB changes
Interface
Detail
Old behavior
New behavior
EJB
EJBs in web
modules.
Ignored
@ApplicationException
inherit=false
inherit=true. Can
impact the subclassing
exceptions behavior.
371
JAX-WS changes
Table 12-2 describes the JAX-WS changes that must be considered.
Table 12-2 JAX-WS changes
Interface
Detail
Old behavior
New behavior
JAX-WS client
WebServiceException
is thrown on the
invoked method with
an empty message.
The Handlers
handleFault message
is called with a
SOAPFaultException.
JAX-WS client
Handling of
Policy:Addressing in
WSDL.
Ignored.
Processed.
SOAPMessage
There is
getSOAPHeader and
getSOAPBody
behavior if there are no
headers present.
No error.
Throws a
SOAPException.
JCA enhancements
Table 12-3 describes the JCA enhancements that must be considered.
Table 12-3 JCA enhancements
Interface
Detail
Old behavior
New behavior
Always returned 0
2147117569
JPA changes
Table 12-4 describes the JPA changes that must be considered.
Table 12-4 JPA changes
372
Interface
Detail
Old behavior
New behavior
EntityManager
The refresh()
method passes a null.
No error
An IllegalArgument
exception is thrown.
detach(Objectentity)
A new method on
numerous APIs, JPA
1.x has a similar
method: <T> T
detach(<T> pc).
JSF changes
Here are the JSF changes:
The default JSF implementation is changed from SUN RI to MyFaces. MyFaces is at JSF
Version 2.0. SUN RI is left at JSF Version 1.2 and is used only for compatibility with earlier
versions. If you want to take advantage of JSF 2.0 features, you must rewrite your JSPs to
use Facelets.
More exceptions are passed on in JSF 2.0 that would not have surfaced in JSF 1.2.
JSP changes
Table 12-5 describes the JSP changes that must be considered.
Table 12-5 JSP changes
Interface
Detail
Old behavior
New behavior
JSP-Property-Groups
Matching JSPs
only
OSGi changes
Table 12-6 describes the OSGi changes that must be considered.
Table 12-6 OSGi changes
Interface
Detail
Old behavior
New behavior
Composite bundles
(.cba)
SIP changes
Table 12-7 describes the SIP changes that must be considered.
Table 12-7 SIP changes
Interface
Detail
Old behavior
New behavior
SIPFactory
The createRequest
and
createAddress(String
sipAddress) with URI
as input or return
parameters should be
enclosed within
brackets (<>).
Brackets ignored
WebSphere removals
Here are the features that are removed from WebSphere Application Server V8.5:
Apache SOAP implementation is removed and standard WebServices support can be
used instead.
com.ibm.websphere.ant.tasks.StopServer.setHost (java.lang.String host).
373
com.ibm.websphere.rsadapter.WSConnectJDBCDataStoreHelper.
com.ibm.websphere.servlet.error.ServletErrorReport.getCause( ).
Moving to JRE 6
The following section describes the impact of moving to JRE 6:
Applications using the new language features and JRE 6 can be deployed only to
WebSphere Application Server V7.0 nodes. When you compile applications, you can
specify '-source' and '-target' modes for earlier JRE targets. For example, '-source 1.4',
and 'target 1.4'.
Java Serialization is not compatible across JRE 1.4 and earlier releases. Force UUIDs as
a preferred practice.
Any new features in Java that result in new classes can cause ambiguous references if
these new classes match ones that are defined in your program.
For more information, see the Java SE 6 website at:
http://java.sun.com/javase/6/
Non-class files are moved from rt.jar in Java SE 6. Java applications that specify
-Xbootclasspath:<path to rt.jar> and request any resource files fail, because these
resources are now in a different JAR file called resources.jar.
For example:
JSP is upgraded to 2.1 from 2.0.
EJB is upgraded to 3.0, but EJB 2.1 applications still run at 2.1.
For complete details about specification level options, see:
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.web
sphere.base.doc/info/aes/ae/rovr_specs.html
375
376
With annotations, more file types are processed as part of the scanning, for example,
encrypted compressed files that used to be ignored before WebSphere Application Server
V7.0. Some problems can be avoided in WebSphere Application Server v7.0.0.7 by
completing the following steps:
1. Log in to the administrative console of the Deployment Server and click Application
servers <deployment server name> Java and Process Management
Process Definition Control Java Virtual Machine Custom Properties. Add
com.ibm.websphere.application.migration.disabled to the list of custom properties, with its
value set to true, and save the configuration.
2. Navigate to the <profile_home>/properties/wsadmin.properties file, edit it, and add
com.ibm.websphere.application.migration.disabled=true.
For more information, see:
http://www-01.ibm.com/support/docview.wss?uid=swg1PK92880
New property
com.ibm.security.SAF.unauthenticatedId
com.ibm.security.SAF.unauthenticated
com.ibm.security.SAF.useEJBROLEAuthz
com.ibm.security.SAF.authorization
com.ibm.security.SAF.useEJBROLEDelegation
com.ibm.security.SAF.delegation
377
New class
com.ibm.websphere.servlet.session.UserT
ransactionWrapper
com.ibm.websphere.rsadapter.DataDirectD
ataStoreHelper
com.ibm.websphere.rsadapter.ConnectJDBCDat
aStoreHelper.
com.ibm.websphere.rsadapter.MSSQLDataSt
oreHelper
com.ibm.websphere.rsadapter.MicrosoftSQLDa
taStoreHelper.
Moving to JRE 5
Here are the major considerations for moving to JRE 5:
Applications using the new language features and JRE 5 can be deployed only to
WebSphere Application Server V6.1 nodes. When you compile applications, you can
specify '-source' and '-target' modes for earlier JDK targets. For example, -source 1.4',
and
'target 1.4'.
Serialization is not compatible across JRE 1.4 and earlier releases.
Any new features in Java that result in new classes can cause ambiguous references, if
these new classes match ones that are defined in your program.
378
The BigDecimal toString() method behaves differently than in earlier versions. J2SE 5.0
added toPlainString() to BigDecimal, which behaves exactly like the toString()
method in earlier versions.
Direct use of private implementations of XML and XSL parsers is discouraged. Existing
classloader support to use an application class path can be used instead of a Java virtual
machine bootstrap class path.
Description
URL
MustGather: Analyzing
Verbose GC Output for
-Xgcpolicy:gencon
Format of verbose GC
output from the gencon
GC policy
http://www-01.ibm.com/support/
docview.wss?uid=swg21222486
MustGather: Analyzing
Verbose GC Output for
-Xgcpolicy:optavgpaue
Format of verbose GC
output from
optavgpause GC policy
http://www-01.ibm.com/support/
docview.wss?rs=727&uid=swg2122
2459
MustGather: Analyzing
Verbose GC Output for Xgcpolicy:optthruput
Format of verbose GC
output from optthruput GC
policy
http://www-01.ibm.com/support/
docview.wss?rs=727&uid=swg2122
2443
379
380
Plant by WebSphere is included with WebSphere Application Server in all versions greater
than 5.0. Although this chapters instructions can be applied to several versions of
WebSphere Application Server, this chapter assumes an installation of WebSphere
Application Server V6.1 and, therefore, the provided directory paths and application
commands may be incorrect if used with earlier versions.
The directory location of the source is <WAS_DIR>\samples\bin\PlantsByWebSphere. The code
can be modified in any development environment. However, it may be more convenient to
take advantage of the functionality that is provided by an IDE that supports
J2EE applications.
For example, Eclipse V3.2 and later with the WebSphere Application Server Developer Tools
work well because you can import the source code easily while you offer seamless integration
with WebSphere Application Server. Further information about this environment can be found
at the Eclipse Foundation Webtools website or WebSphere developer tools website. To
download the tool, go to:
https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download_wd
t?lang=en
The Plants by WebSphere application is supported through a series of JSP pages and HTML
pages. These pages communicate with the following servlets: AccountServlet,
ShoppingServlet, ImageServlet, and AdminServlet. The servlets use the various enterprise
bean business methods, which in turn access data from the database as needed. In general,
stateless session beans are used to interface with the entity beans, to reduce the number
of transactions.
381
Servlets
This section provides information about the servlets that are used in the Plants by
WebSphere application.
ShoppingServlet
The ShoppingServlet servlet processes most of the interactions between the browser and
the enterprise beans. This interaction includes inventory, shopping cart, and order
functions. Selecting a shopping category to browse uses a Catalog session bean, which is
used to find and display all of the relevant Inventory objects. Displaying the details of an
item can also be done by using a Catalog session bean to obtain information from an
Inventory CMP entity bean.
Adding an item to the shopping cart creates a ShoppingCart stateful session bean. A
Catalog session bean obtains the Inventory data, and places the item in the ShoppingCart
bean. Viewing and updating the shopping cart is done using the ShoppingCart stateful
session bean. After you enter billing and shipping information, the ShoppingCart bean
creates an Order CMP entity bean. Upon completing the checkout procedure, a Mailer
stateless session bean is created to send a confirmation email, using the JavaMail API.
ImageServlet
The ImageServlet servlet obtains and places product images into the database. The
servlet obtains images from the JSP pages and the HTML pages from the database and
serves back to the browser through the HTTP response.
AdminServlet
The AdminServlet servlet processes the requests from a user (browser) for inventory back
orders, database repopulation, and supplier configuration. During a customer checkout
procedure, the inventory quantity is checked. When the inventory quantity reaches a
minimum threshold, the Inventory bean creates a BackOrder CMP entity bean. An
administrator can process this back order in the Plants by WebSphere
administrative pages.
382
When processing requests from the supplierconfig.jsp page, the AdminServlet servlet
creates a Suppliers stateless session bean, which is used to pass requests to a Supplier
CMP 2.0 bean. The Supplier configuration information includes name, address, phone,
and a web service web address. The backorder requests are sent to the Supplier through
a web service that is at this web address.
When it processes repopulation requests from the help.jsp page, the AdminServlet servlet
creates a bean-managed persistence (BMP) bean called ResetDB. This bean deletes all
database tables and repopulates the tables with initial data values from the
pbw.properties properties file.
Enterprise beans
This section provides information about the enterprise beans that are used in Plants by
WebSphere application.
Catalog
Catalog is a stateless session bean. It is the primary access to the Inventory
container-managed persistence entity bean (CMP). Stateless session beans generally
access entity bean data, while limiting the number of transactions used. The Catalog
session bean has business methods to obtain information from one or more Inventory
beans. Methods exist to add and remove an Inventory item. The Catalog session bean
also has methods to modify existing Inventory beans.
Customer
Customer is a 2.0 CMP entity bean. It contains and manages the account data that is
needed for a customer. The Customer entity bean has methods for creating, finding, and
updating customer information, and verifying a password and getting fields in the
Customer entity bean.
Inventory
Inventory is a 2.0 CMP entity bean. This entity bean contains and manages inventory item
data. Methods are available for finding, creating, getting, and setting data fields.
Login
Login is a stateless session bean. This session bean interfaces with the Customer CMP
entity bean to create and update customer accounts.
Mailer
Mailer is a stateless session bean. This session bean creates and sends an order
confirmation email using the JavaMail API.
Order
Order is a CMP entity bean. This session bean contains and manages order data.
Methods are available for finding, creating, and getting data fields.
OrderItem
OrderItem is a CMP entity bean. This entity bean contains and manages a single order
item. Methods are available for finding, creating, and getting data fields.
ReportGenerator
ReportGenerator is a stateless session bean. This session bean generates reports that
are based on information that is found in orders. The ReportGenerator session bean
interfaces with the Order CMP entity bean. The reports consist of top-selling items for a
set date range, and top-selling postal codes for a set date range.
383
ShoppingCart
ShoppingCart is a stateful session bean. This session bean maintains a list of inventory
items to purchase throughout the HTTP session. The ShoppingCart session bean has
business methods to add, remove, and update inventory items. The ShoppingCart session
bean also has a method to create an Order CMP entity bean when the customer is ready
to complete a purchase.
BackOrder
BackOrder is a CMP entity bean. This entity bean contains and manages inventory
backorder data. Methods are available for finding, creating, and getting data fields.
BackOrderStock
BackOrderStock is a stateless session bean. This session interfaces with the BackOrder
CMP bean to create and process inventory backorder items.
Supplier
Supplier is a CMP entity bean. This entity bean contains and manages supplier
configuration data. Methods are available for finding, creating, and getting data fields.
Suppliers
Suppliers is a stateless session bean. This session interfaces with the Supplier CMP bean
to create and process Supplier configuration information.
ResetDB
ResetDB is a BMP entity bean. This entity bean deletes all rows in the database tables.
384
Modified sample: The Plants By WebSphere sample from WebSphere Application Server
Version 6.1 is modified to suit the purpose of demonstrating the migration process. You can
download the application with this minor modification by following the instructions in
Appendix B, Additional material on page 435.
cd <profile_root>\bin
setupCmdLine
where <profile_root> represents the profile installation directory.
wsadmin -conntype none -c "$AdminApp uninstall PlantsByWebSphere"
Note: install_root/bin must be in set in your PATH
385
cd <profile_root>/bin
. ./setupCmdLine.sh
where <profile_root> represents the profile installation directory.
wsadmin.sh -conntype none -c "\$AdminApp uninstall PlantsByWebSphere"
3. Reinstall the Plants by WebSphere sample by completing the following steps:
a. Change the directory to the profile_root/samples/lib/PlantsByWebSphere directory.
b. Locate the PlantsByWebSphere.ear file.
c. Run the commands that are illustrated in following examples.
Example 12-4 illustrates the command to install the Plants By WebSphere sample
application on a Windows operating system.
Example 12-4 Command to install the PlantsByWebSphere sample application on Windows
386
4. Map the Application Modules to the target Application Server (Figure 12-4).
387
388
A unique email address and password for the Plants by WebSphere sample can be created
by clicking Register on the Login window (Figure 12-6).
389
Once logged in to the account, the customer can start shopping and can add items into the
shopping cart (Figure 12-7).
After the required items are added to the shopping cart, the customer can proceed to check
out by providing the billing and shipping information. A message is shown with the order
number and expected date of arrival for the items purchased.
390
Figure 12-8 Exporting the PlantsByWebSphere.ear file from the WebSphere Application Server
administration console
391
392
393
3. In the Ear Module and Utility JAR Projects window, make sure that all three modules are
selected (Figure 12-11) and click Finish.
Figure 12-11 EAR modules and Utility JAR projects during application import
394
2. Right-click the Software Analyzer and select New option to create a New_configuration
under Software Analyzer. You can also highlight Software Analyzer and click the New icon
on the toolbar (the first icon with the+ sign). The right side changes to show the
explanation of the basic configuration options available.
3. In the Name field, enter PlantsVersiontoVersion as the name of the configuration.
395
4. In the Scope tab, leave the Analyze entire workspace radio button selected
(Figure 12-13).
396
6. Select WebSphere Application Server Version Migration from the Rules Sets
drop-down menu, and click Set (Figure 12-14).
7. You see the Rule set configuration dialog box (Figure 12-15). Set the Source application
server to WebSphere Application Server V6.1 and the Target application Server to
WebSphere Application Server V8.5. Source Java Version. The Target Java Version
category may be selected, as depicted in Figure 12-15. Click OK.
Rules: The default is that no rules are selected until the user selects the ones that are
of interest and clicks Set. After the configuration is set, it can be reused.
397
8. The Application Migration Tool is now configured and the rules are set. You can run the
analysis against the Plants By WebSphere sample. You can expand any of the analysis
domains to see which rules are selected (Figure 12-16).
9. Click Analyze to analyze all the projects in the workspace. The Software Analyzer view is
opened at the bottom of the window. It contains three tabs. Each tab corresponds to one
of the analysis domains selected, based on the Rule Set selection that was made earlier.
The Java Code Review tab lists Java code-related issues.
The XML File Review tab lists issues with deployment descriptors.
The JSP Code Review tab lists issues that are found in JSP files, commonly
associated with web projects.
The result of the analysis is shown in Figure 12-17.
398
You can right-click any of the flagged files under a specific rule to see a list of available
options in the menu. For example, under the Java Code Review tab, expand the Java SE
Version Migration and right-click any of the files in the list. Then, select View Results. The
Java file in question is opened and the cursor is at the code problem line.
399
Fixing the errors reported under the Java Code Review tab
Expanding the Java Code Review section shows the details of the Java SE 6 compatibility
impact results. Right-clicking individual results gives access to options, such as viewing the
source code where the problem occurred or correcting the problem with a provided fix.
To fix the errors reported under the Java Code Review tab, complete the following steps:
1. Right-click a result and select View result.
2. An editor opens that shows the source file that triggered the rule. The cause of the
problem is highlighted, and a rule violation icon is shown in the left margin of the editor.
(Figure 12-20).
Duration d = df.newDuration(duration);
Duration zero = df.newDuration(0);
if (!d.equals(zero))
This rule flags the use of the equals(Object param) method on
javax.xml.datatype.Duration or javax.xml.datatype.XMLGregorianCalendar. Java 6 now
returns false if the parameter passed is null. It used to throw a NullPointerException in
earlier versions of Java. Check the application logic to see if the code must be tested for
false instead of NullPointerException.
400
public MyClass {
private void doX(){
XMLGregorianCalendar c = getCalendar();
boolean b = c.equals(someObject);
}
}
Because the code does not require a fix, ignoring the result and rerunning the analysis results
in clearing the Java Code Review results (Figure 12-21).
401
Fixing the errors reported under the XML File Review tab
Based on the reported results, you should avoid using the deprecated method level access
intent for entity beans. This rule flags the configuration of method level access intent for entity
beans. Method level access intent was deprecated because it might run into data access
problems, such as a deadlock. To fix reconfigure entity beans to, use bean level access
intent, as shown in Figure 12-22.
402
The Plants By WebSphere application actually has such a problem in one of its JSP files. The
error.jsp file has a section of Java code, as shown in Example 12-9, that uses Java
reflection to invoke the getStackTrace method on the ServletErrorReport class that is
provided by the WebSphere Application Server. This method was modified in WebSphere
Application Server V5.1 to avoid a conflict that is caused by a change in Java 1.4 to the
Throwable class. This particular change falls into all three of the categories of potential
application migration problems that are not detected by the application migration tools.
Example 12-9 A snippet from the error.jsp file included in the PlantsByWebSphere
12.3.5 Exporting the fixed Plants By WebSphere application and running the
application on WebSphere Application Server V8.5
This section describes the steps to export the migrated PlantsByWebSphere. Complete the
following steps:
1. From Eclipse IDE, right-click the PlantsByWebSphereEAR project from the Enterprise
Explorer perspective.
2. Select Export
3. Choose the directory you to want export the PlantsByWebSphere.ear file to and save
the application.
4. Start the WebSphere Application Server V 8.5 server.
5. Log in to the Administration Console and browse to Applications Install
New Application.
403
404
405
4. In the Rule set configuration window, set the Source application server to WebSphere
Application Server V6.1 and the Target application server to WebSphere Application
Server V8.5 (Figure 12-23) and click OK.
Figure 12-23 Configuring the Application Migration Toolkit for the Probability Distribution Sample application
406
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: IBM Corporation
Specification-Title: JavaServer Faces
Implementation-Title: JSF Widget Library (JWL) - Base
Implementation-Version: JWL v3_1_13
Implementation-Vendor: IBM
Build-Version: 20120425.1128
Build-Date: April 25 2012
Copyright-Info: Copyright (c) 2003,2008, International Business Machines
Corporation. All Rights Reserved.
407
The version of the JWL used in the Probability Distribution Sample is Version 3.1.13, which
supports running on a JSF 2.0 run time. If the version is earlier than Version 3.1.6, you must
replace the version of the JWL used in the application with the latest version of JWL provided
with Rational Application Developer V8.5.
As you verified that the application work with JSF 2.0, you can return to the Software
Analyzer results page and right-click the Check for a behavior change in JavaServer
Faces (JSF) Applications problem and click Ignore Result to remove this entry from the
Software Analyzer results.
409
12.5.1 Overview
This section shows an example of an application that uses a third-party web services engine,
specifically the Axis 2 web services engine. The application is simple (in fact, it provides just
two web services), but demonstrates the potential problems of migrating such an application.
The application provides a stock quote service that a client can use to discover stock prices
by providing the symbol of the required stock price as input. You use the Axis Object Model
(AXIOM) to allow arbitrary pieces of XML to be passed and returned in the body of the web
services messages. In this example, a simple Plain Old Java Object (POJO) could be used as
the implementation of the web service together with a suitable definition of the web service.
The developer of this particular application chose to use the AXIOM style for the web service.
410
Figure 12-24 Installing the Axis 2 application on WebSphere Application Server V6.1
4. Click Next.
5. On Step 1. Select installation options, click Next.
6. On Step 2. Map modules to servers, click Next.
7. On Step 3. Map virtual hosts for Web modules, click Next.
8. On Step 4. Map context roots for Web Modules, click Next.
9. On Step 5. Summary, click Finish.
10.After the application installation process is complete, click Save to save the server
configuration changes to the master configuration.
Now that the application is installed, it must be started so that it can be tested. To do so,
complete the following steps:
11.Click Enterprise Applications in the list of tasks in the left pane.
12.Select the entry for the stock_quote_example_axis2_war and click Start.
411
412
413
4. In the Rule set configuration window, set the Source application server to WebSphere
Application Server V6.1 and the Target application server to WebSphere Application
Server V8.5, as shown in Figure 12-25. Click OK.
Figure 12-25 Configuring the Application Migration Toolkit for the Stock Quote Axis2 application
414
<parametername="EnableChildFirstClassLoading">false</parameter>
Manifest-Version: 1.0
DisableIBMJAXWSEngine: true
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: sagara
Build-Jdk: 1.6.0_22
Disabling annotation scanning: As an alternative to modifying the
META-INF/MANIFEST.MF file, you can turn off annotation scanning for the entire WebSphere
Application Server instance by setting a JVM property through the administration console.
To do this task, click Application Server Server Process Definition Java
Virtual Machine and then add the following line to the Generic JVM arguments field:
-Dcom.ibm.websphere.webservices
Exporting the WAR file that is ready for installation on Version 8.5
As the application is packaged as a simple WAR file, it cannot be directly installed on the
application server from Eclipse. It must be exported as a WAR file. To do this task, complete
the following steps:
1. Right-click the stock_quote_example_axis2 project and click Export....
2. Provide a file name for the exported WAR file. Do not specify the same name and location
as the original WAR file that is installed onto WebSphere Application Server Version 6.1
so that you still have the original WAR file if you need to reimport the application into
Eclipse. In our example, we call the file stock_quote_example_axis2_85.war.
3. Click Finish.
415
416
3. Use the Class loader order drop-down menu to select Classes loaded with local class
loader first (parent last), as shown in Figure 12-26, and then click OK.
Figure 12-26 Selecting the parent last option for class loader order
417
418
Part 5
Part
Appendixes
419
420
Appendix A.
Migration questionnaires
This appendix contains sets of questions that you can use to build your own questionnaire
that is based on the unique challenges you foresee. It is not intended to be a final
questionnaire, but a base from which you can learn how migration questionnaires are built.
Other specific questionnaires might be required (such as SOA and Web 2.0 questionnaires).
For more information, see 2.5.2, Getting help on page 53.
This appendix describes the following topics:
Business requirements
General information
Application architecture
Code
Development migration questionnaire
Runtime migration questionnaire
Testing migration questionnaire
421
Business requirements
Business requirements questions are as follows:
1. What is motivating the business to make this change?
2. Is the application business critical?
3. What is the target version of WebSphere Application Server?
4. What other WebSphere products are involved in this migration?
WebSphere Portal Server and WebSphere Edge Server possible are examples.
5. By what date must this application migration be complete?
6. What is the risk to the business if the change cannot be implemented by that date?
7. What is the risk to the business when the application is not running?
8. Is this migration part of a new application release/version?
9. Describe any important milestones for the migration. Include dates for development, QA,
and so on.
10.How do you describe a successful migration?
General information
General information questions are as follows:
1. What is the name of the application?
2. What URL is used to access the application?
3. What is the current version of the application?
4. What is the audience for the application: internal, external, or both?
5. What is the primary function of the application?
6. What services does this application provide?
7. Who are the users of the application?
8. Describe any upgrades that are considered part of this migration?
These upgrades might include such things as platform infrastructure (OS or related stack
components) or exploitation of features that are provided by Java EE.
9. Can the migration be partitioned?
10.Can the application be divided into smaller pieces that can individually be migrated?
Staged migration of the database, JSP, EJB, and so on, enables incremental migration,
providing greater opportunity for quality control and isolation of unexpected problems.
11.How frequently do you schedule an independent review of your application code?
Application architecture
General application architecture questions are as follows:
1. Does the application architecture conform to the Model 2 architecture that is prescribed by
Java EE?
2. Describe the application's use of established design patterns.
422
3. Does the application, for example, employ well-known patterns such as Facade,
Command, Strategy, or Proxy?
Dependencies
Dependency questions are as follows:
1. Are there dependency cycles between packages?
A dependency cycle results when two or more types are involved in a cycle of references
that binds them tightly to each other. Dependency cycles are not always bad. Cycles are
often wanted between two or more types. Dependency cycles become a problem,
however, when they exist between packages or modules. The danger is that they
introduce a tight coupling between those packages or modules, which makes the code
generally more unreliable and difficult to change. The point of this question is to
understand if any such cycles exist between packages.
2. Are there dependency cycles between Java EE modules?
A common dependency cycle between Java EE modules involves an EJB module that
makes reference to helper classes in a Java utility module that, in turn, makes references
back to the EJB module. Such helper classes are typically used as convenience methods
for finding EJB homes, for example.
3. Describe any classloading dependencies in the application.
Class loading issues and dependencies to libraries are common in older Java EE-style
applications. The earlier versions of the specifications did not state clearly how the class
loading must happen and how the library classes must be accessed.
Persistence
There is one question that is related to persistence:
1. How is persistence of application data implemented?
This question is concerned with understanding how application data is made persistent.
Typically, application data is stored in a database and a layer in the application is
responsible for moving that data from the database into Java objects and back again.
Persistence might be implemented using EJB CMP entity beans, a third-party product
such as TopLink for Java, or a custom implementation of a Data Access Object (DAO)
pattern. It might also be implemented in an ad hoc fashion using JDBC statements
throughout the application code.
National language
National language questions are as follows:
1. What national languages are supported by the application?
2. How is language determined by the application?
The application might use the language attribute from the HTTP Request Header, or
perhaps profile information that is provided by a user using a combination of cookies and
HTTP session data.
3. How is language data stored by the application?
423
Code
This section has questions that are related to code. Approximate answers suffice for these
questions. However, accurate answers yield more accurate results
Java
Java questions are as follows:
1. How many custom classes are defined in the application?
A custom class is one that was created by your development team. Do not include classes
that are part of the standard Java libraries, middleware, or third-party supplied libraries.
Also, do not include classes that are generated by the container to support your
application in run time.
2. How many custom classes in the application are declared as abstract?
3. How many custom interfaces are in the application?
A custom interface is one that was created by your development team. Do not include
interfaces that are part of the standard Java libraries, middleware, or third-party
supplied libraries.
4. How many lines of code are in the application?
Provide an indication of useful lines of code (exclude comment lines from this value).
EJB usage
EJB usage questions are as follows:
1. What version of the EJB specification is used?
2. Do all the enterprise beans in the application conform strictly to this version of the
specification?
3. How many Stateless Session beans are in the application?
4. How many Stateful Session beans are in the application?
5. How many CMP Entity beans are in the application?
6. How many BMP Entity beans are in the application?
7. How many Message Driven beans are in the application?
7. Do all the servlets in the application conform strictly to this version of the specification?
8. How many servlets are in the application?
9. Approximately how much data is maintained in the HttpSession?
This information can be difficult to estimate, especially if the size of the session data varies
widely. One possible way to get an accurate measure of a session at a particular moment
in time is to build a servlet that uses an ObjectWriteStream to dump the contents of the
HttpSession to a file. The size of the file is a good approximation (though not a precise
measure of the session size.
10.Are all objects that are stored in the HttpSession serializable?
The application server uses serialization to pass data between servers (JVMs). An object
is serializable if it implements the java.io.Serializable interface.
Answer Yes to this question only if all objects are serializable, which includes objects that
are indirectly included in the HttpSession through references from other objects.
11.Describe any issues that might prevent sharing data your application stores in the
HttpSession across servers in a cluster.
Web services
Web services questions are as follows:
1. Enumerate the external web services your application accesses.
By external, we mean external to the application, which includes any web services that are
hosted by other applications regardless of the language or platform they are running on. If
possible, provide a description of each web service that is used and note any potential
issues that you are aware of that might affect the migration.
2. Enumerate the internal web services your application accesses.
An internal web service is one that is part of your application. Your application might, for
example, use a web service to implement the Facade pattern between your servlet and
EJB layers.
3. Enumerate the web services your application implements.
For this answer, list the web services that your application provides for internal or external
clients. If possible, provide a description of the function that each web service provides.
4. Are the web services implemented by your application WS-I compliant? If so, indicate the
WS-I version.
Database access
Database access questions are as follows:
1. What version of the JDBC specification is used?
2. Does the usage of JDBC conform strictly to this version of the specification?
3. How many distinct JDBC queries does the application make?
4. What database managers are used by the application?
5. Do the JDBC queries use vendor-specific SQL extensions?
6. Does the application make direct use of DriverManager?
7. Does the application use J2EE connection pooling through data sources?
8. Describe any third-party connection pooling mechanisms in use.
9. Does the application make use, for example, of Oracle Connection Pooling?
10.Are all JDBC connections explicitly closed?
425
JMS
JMS questions are as follows:
1. What version of the JMS specification is used?
2. Does the usage of JMS conform strictly to this version of the specification?
3. How many queues does the application use?
4. How many topics does the application use?
5. What data is passed through JMS?
For example, plain text, XML, or serialized objects
6. Does the application write to JMS queues?
7. Does the application read from JMS?
8. Does the application do blocking reads from JMS?
9. Does the application do blocking reads from JMS in Session or Entity beans?
JNDI naming
JNDI naming questions are as follows:
1. Does the application use JNDI to access resources other than EJB Homes?
2. Do the application's deployment descriptors contain local JNDI resource references?
JNDI resource references sections are in web.xml and ejb-jar.xml.
3. Describe a typical JNDI access from the application. Provide a code snippet if possible.
4. Are all JNDI resources (InitialContexts) closed inside finally clauses?
Code that is contained in a finally block of an exception handler runs (whether an
exception occurs or not). By closing these shared resources in a finally clause, you
ensure that these resources can be kept available.
426
Struts
If the application does not use Struts, skip this section. Struts questions are as follows:
1. What version of Struts is used?
2. How many custom ActionForms are in the application?
3. How many custom ActionHandlers are in the application?
4. Describe any modifications that you made to Struts.
5. Struts is an open source framework and is customized by organizations to provide
extended functionality. If you extended Struts, describe that extension.
Transactions
Transactions questions are as follows:
1. Are transactions managed implicitly or explicitly?
2. Does the application require two-phase commits (2PC)?
3. What transactional systems does the application interact with?
Threads
This section is concerned with the application's direct manipulation of threads. This section is
not concerned with threads managed by the application server.
Thread questions are as follows:
1. Does the application create threads?
2. Does the application create daemon threads?
3. Does the application explicitly stop threads using the stop() method?
4. List any third-party thread pool libraries that are used by the application. Include version
numbers if possible.
5. Describe any custom thread pool libraries that are used by the application.
6. Describe how the application usesthreads.
This question is concerned with how your application makes explicit use of threads. For
example, does your application create threads to perform work in parallel, or to provide
timeouts for various services? If it is the latter, indicate what services the threads are
providing timeouts for.
Sockets
Skip this section if your application does not make direct use of sockets. This section is
concerned with sockets created and used directly by your application; it is not concerned with
sockets managed by the application server.
Socket questions are as follows:
1. Describe how the application makes direct use of sockets.
2. Does your application create any daemon sockets?
3. Does your application use secure sockets (SSL)?
427
XML
XML questions are as follows:
1. What XML libraries does the application use? Include version information.
2. What XSLT libraries does the application use? Include version information.
Workstation configuration
Workstation configuration questions are as follows:
1. What hardware is used?
2. What operating system and version is used?
3. How much RAM is installed?
428
Development methodology
Development methodology questions are as follows:
1. What development methodology is used?
2. How long is a typical development cycle?
3. How frequently are internal releases of the application delivered?
These deliveries include releases for internal testing or user acceptance testing.
4. How frequently are external releases of the application delivered?
5. How often are new versions of application delivered into the production environment?
Ant
Skip this section if you do not use Ant for builds.
1. What version of Ant is used?
2. Does your build process use one or many Ant scripts?
One
Many
3. What optional Ant tasks do you use as part of your build?
429
General
General questions are as follows:
1. Will the existing runtime infrastructure be migrated?
2. Will you support the existing runtime infrastructure after the migration?
Answer Yes if you expect to migrate only your current applications and leave them running
on the current infrastructure.
3. Does your runtime infrastructure include a dedicated pre-production staging environment?
Your pre-production environment might be called the Quality Assurance environment.
Regardless of the given name, this environment is used to test the overall quality of your
environment and applications before you move those applications into the
production environment.
4. Does your runtime infrastructure include a dedicated performance testing environment?
Describe the separate runtime environments (production, pre-production, system test,
development test, performance test, and so on) that are included in your
runtime infrastructure.
Current hardware
Questions about the current hardware are as follows:
1. Describe the hardware that is used to run your current application server.
If your environment is heterogeneous, describe each hardware configuration. Indicate the
quantity of each configuration. Also, indicate the operating system and version in use.
2. How many production machines currently host the production application?
Describe any additional hardware that is used in the production environment. Include all
the details from firewalls, IP sprayers, web servers, clustering manager, database servers,
firewall, intrusion detection systems, and so on. Indicate software in use (if any) on these
systems, including operating system and version.
3. Describe how the configuration of the pre-production environment differs from the
configuration of the production environment.
4. Is the pre-production environment configured with a similar complexity, but at a smaller
scale? Are there key elements that are missing from the pre-production environment?
5. Describe the hardware that you plan to use to run the migrated applications.
If your environment is heterogeneous, describe each hardware configuration. Indicate the
quantity of each configuration. Also, indicate the operating system and version in use.
6. How many production machines are used to host the production application?
Describe any additional hardware that is used in the production environment. Include all
the details from firewalls, IP sprayers, web servers, clustering manager, databases,
firewall, intrusion detection systems, and so on. Indicate software in use (if any) on these
systems, including operating system and version.
430
Software
Questions about software are as follows:
1. Which version of Java Runtime Environment (JRE) do your production hosts use?
2. Provide the name of the provider of the JRE, which might be Sun, IBM, or another
JRE vendor.
3. Describe other software that is installed and used on the same production hardware as
the application servers.
4. Describe the infrastructure of the host bridge network if the application employs the
connection services to host systems (for example, CICS).
HTTP Server
HTTP Server questions are as follows:
1. What HTTP Server is used?
2. Is the HTTP Server configured to provide affinity to a particular application server
instance?
3. How many servers host the web servers?
IBM WebSphere Application Server can work with almost all web servers in the market
today. It is important to understand how the current web server is being used and what is
the impact if WebSphere Application Server continues to use the same web server during
the production switch.
4. Describe any other services that are provided by the HTTP server, which includes
services beyond serving static content and fronting for the application server. Does your
HTTP server, for example, provide additional functionality using CGI/Perl?
5. Describe the infrastructure for secure network propagation.
6. Enabling HTTPS on the web server is one way of doing it from the browser to the web
server end. Enterprises also use hardware accelerators to improve the speed of the SSL
encryption and the decryption process. If so, how does it integrate with the web server?
7. Is the communication from the HTTP server plug-in to the application server secure in the
current environment?
Network edge
Network edge questions are as follows:
1. What load balancing technologies are used?
2. Is the load balancer configured to provide affinity to a particular HTTP server instance?
3. Describe how failover is provided for your load balancer.
431
Availability
Availability questions are as follows:
1. Describe any existing service level agreements that are concerned with the availability of
the applications, which determines the availability and the amount of flexibility to switch to
a WebSphere Application Server run time.
2. Describe how clustering is provided in the current environment. Explain your
clustering environment.
3. Describe the process for the production release rollout of an application?
If the process differs for various applications, describe each of the processes.
4. What is the current backup strategy when a node or server fails or breaks down?
Explain in detail your failover strategy.
Rollout issues
Questions about rollout issues are as follows:
1. Will old applications need to coexist with migrated applications?
2. Does the migration include all the applications on the production server? If not, is there a
plan to migrate those applications as well?
Co-existence is important, especially when migrating common frameworks and application
development models into a new platform. There can be application dependencies that
must o be maintained when moved into the new platform.
3. Are there any other software updates scheduled to be done to the production machines
during the migration process?
Migration of the production environment is an important task and mitigation of risk is key
during the migration. Hardware and software updates are only preferred when they are
required as part of the migration. They should be decoupled to keep the variables to
a minimum.
Administration
Administration questions are as follows:
1. How many administrators do you have to support the production environment?
2. Do you have dedicated administrators for your production infrastructure?
3. Describe the skill level and experience of the administrators of the
production environment.
4. How do you deploy the applications?
5. Do the production administrators use deployment scripts to accomplish this task? Does it
involve custom scripting? Explain the process.
6. Describe any custom scripts that are used for administering the application servers.
7. Do you use any custom scripts for administering the current setup? If so, what are they
used for?
8. Is the production environment set up to take care of log rotation and file
system maintenance?
432
9. Log files can become large and consume the available space within the production host.
Is there a procedure or a process in place to handle file system maintenance?
Security
Security questions are as follows:
1. How important is security in your production runtime infrastructure?
Critical
Very important
Important
Not important
Hardware
Questions about the hardware that is used are as follows:
1. Is dedicated hardware available specifically for user acceptance testing?
2. Is dedicated hardware available specifically for quality assurance testing?
3. Is dedicated hardware available specifically for performance testing?
4. Describe how the testing hardware is different in configuration from the
production hardware.
433
434
Appendix B.
Additional material
This book refers to additional material that can be downloaded from the Internet as described
in the following sections.
Description
WebLogic_migration.zip
OracleAS_migration.zip
435
Tomcat_migration.zip
WASV2V_migration.zip
20 MB minimum
Linux or Windows
436
Related publications
The publications that are listed in this section are considered suitable for a more detailed
discussion of the topics that are covered in this book.
IBM Redbooks
The following IBM Redbooks publications provide more information about the topic in this
document. Some publications referenced in this list might be available in softcopy only.
Experience JEE Using Rational Application Developer V7.5, SG24-7827
Getting Started with WebSphere Application Server Feature Pack for Service Component
Architecture, REDP-4633
Oracle to DB2 Conversion Guide: Compatibility Made Easy, SG24-7736
Rational Application Developer for WebSphere Software V8 Programming Guide,
SG24-7835
WebSphere Application Server V6.1: Classloader Problem Determination, REDP-4307
WebSphere Application Server V7: Competitive Migration Guide, SG24-7870
WebSphere Application Server V8.5 Concepts, Planning, and Design Guide, SG24-8022
You can search for, view, download, or order these documents and other Redbooks,
Redpapers, Web Docs, draft and more materials, at the following website:
ibm.com/redbooks
Other publications
This publication is also relevant as a further information source:
Migrating a Microsoft Access 2000 Database to IBM DB2 Universal Database 7.2
Online resources
These websites are also relevant as further information sources:
Apache Tomcat 7.0.27 download website
http://tomcat.apache.org/download-70.cgi
Apache Tomcat 7.0.27: Instructions for installing, configuring, and managing
http://tomcat.apache.org/tomcat-7.0-doc/index.html
Hibernate Validator distribution download page
http://www.hibernate.org/subprojects/validator/download
IBM developerWorks article on typesafe queries on JPA 2.0
http://www.ibm.com/developerworks/java/library/j-typesafejpa
437
IBM Education Assistant - IBM WebSphere Application Server Migration Toolkit V3.5
http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.wasm
t/wasmt/3.5/Overview.html
IBM Passport Advantage
http://www-01.ibm.com/software/support/probsub.html
IBM WebSphere Developer Services - How to raise a PMR
http://www.ibm.com/isv/tech/remoteEmail/entryForm.jsp
Java EE specification
http://www.oracle.com/java
Java Specification Request (JSR) 286 compliant portlets
http://jcp.org/en/jsr/detail?id=286
JBoss download website
http://www.jboss.org/jbossas/downloads/
Online information about the Migration Toolkit
http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/index.html
OSGi applications
http://www.osgi.org/About/WhatIsOSGi
Oracle Java Application Verification Kit (AVK)
http://java.sun.com/j2ee/verified/avk_enterprise.html
Oracle WebLogic Server 10.3.6 installation instructions
http://www.oracle.com/technology/software/products/ias/htdocs/wls_main.html
Quickstarts distribution download page
http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.CR2/jboss-as-quickstarts-7
.1.1.CR2-dist.zip
Shrinkwrap library
http://www.jboss.org/shrinkwrap
SLF4J distribution download page
http://www.slf4j.org/download.html
Spring Framework introduction
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was
-nd-mp&topic=cspr_intro
Using Spring and Hibernate with WebSphere Application Server article
http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott
.html
WebSphere Application ServerBase V8.5
http://www.ibm.com/software/webservers/appserv/was/
WebSphere Application ServerExpress V8.5
http://www.ibm.com/software/webservers/appserv/express/
WebSphere Application Server for Developers V8.5
http://www.ibm.com/software/webservers/appserv/developer/index.html
438
Related publications
439
440
(0.5 spine)
0.475<->0.873
250 <-> 459 pages
Back cover
WebSphere Application
Server V8.5 Migration Guide
This IBM Redbooks publication helps you plan and execute the
migration of J2EE applications that are developed for Oracle WebLogic
Server, Oracle Application Server, JBoss, and Apache Tomcat, so that
they run on IBM WebSphere Application Server V8.5. In addition, this
book covers migration from earlier versions of WebSphere Application
Server to WebSphere Application Server V8.5.
This book provides detailed information to plan migrations, suggested
approaches for developing portable applications, and migrating
working examples for each of the platforms from which we migrated in
our examples. The primary tool that is used in the migration scenarios
that are covered in this book is the IBM WebSphere Application Server
Migration Toolkit V3.5.
It is not our intention to provide a feature-by-feature comparison of
these application servers versus WebSphere Application Server, but to
produce practical technical advice for developers who must migrate
applications from these vendors to WebSphere Application Server
V8.5.
This publication is an update of WebSphere Application Server V7:
Competitive Migration Guide, SG24-7870.
The book is intended as a migration guide for IT specialists who are
working on migrating applications that are written for other application
servers or earlier versions of WebSphere Application Server to
WebSphere Application Server V8.5.
INTERNATIONAL
TECHNICAL
SUPPORT
ORGANIZATION
BUILDING TECHNICAL
INFORMATION BASED ON
PRACTICAL EXPERIENCE
IBM Redbooks are developed
by the IBM International
Technical Support
Organization. Experts from
IBM, Customers and Partners
from around the world create
timely technical information
based on realistic scenarios.
Specific recommendations
are provided to help you
implement IT solutions more
effectively in your
environment.
ISBN 0738437247