Download presentation
Presentation is loading. Please wait.
Published byMelissa Green Modified over 9 years ago
1
2002 Prentice Hall. All rights reserved. Chapter 21 Application Servers Outline 21.1 Introduction 21.2 J2EE Specification and Benefits 21.3 Commercial Application Servers 21.3.1 BEA WebLogic 6.0 21.3.2 iPlanet Application Server 6.0 21.3.3 IBM WebSphere Advanced Application Server 4.0 21.3.4 JBoss 2.2.2 Application Server 21.4 Deploying the Deitel Bookstore on BEA WebLogic 21.5 Deploying the Deitel Bookstore on IBM WebSphere 21.6 Internet and World Wide Web Resources
2
2002 Prentice Hall. All rights reserved. 21.1 Introduction Java 2 Enterprise Edition BEA WebLogic IBM WebSphere iPlanet Application Server JBoss open-source application server
3
2002 Prentice Hall. All rights reserved. 21.2 J2EE Specification and Benefits Java 2 Enterprise Edition –Portable application-server platform J2EE specification –API support –Security –Transaction management –Deployment processes
4
2002 Prentice Hall. All rights reserved. 21.2 J2EE Specification and Benefits (Cont.)
5
2002 Prentice Hall. All rights reserved. 21.3 Commercial Application Servers Popular application servers –BEA WebLogic –iPlanet Application Server –IBM WebSphere –JBoss
6
2002 Prentice Hall. All rights reserved. 21.3.1 BEA WebLogic 6.0 WebLogic features –Data pools –Hot deployment –Failover support –Multi-pooling –Advanced security
7
2002 Prentice Hall. All rights reserved. 21.3.2 iPlanet Application Server 6.0 iPlanet features –Web connector Sticky load balancing –Lightweight Directory Access Protocol (LDAP) Download –www.iplanet.com/ias_deitel
8
2002 Prentice Hall. All rights reserved. 21.3.3 IBM WebSphere Advanced Application Server 4.0 WebSphere features –Failover support –Data pooling –User-level security controls
9
2002 Prentice Hall. All rights reserved. 21.3.4 JBoss 2.2.2 Application Server JBoss features –Hot deployment –Small memory footprint
10
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic Installation –WebLogic e-docs.bea.com/wls/docs60/install/instprg.html –Cloudscape CLASSPATH –weblogic_sp.jar –weblogic.jar –cloudscape.jar Administration console –localhost:7001/console
11
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.) Fig. 21.2WebLogic administration console. (Courtesy BEA Systems.)
12
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.) JDBC data pool and data source configuration Fig. 21.3JDBC Connection pool properties. (Courtesy of BEA Systems, Inc.)
13
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.) Deployment descriptors –bookstore.ear –jar xvf bookstore.ear
14
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. Lines 6-8 Lines 11-356 Lines 13-71 Line 14 Lines 17-21 Line 18 Line 19 Lines 24-42 Lines 26-34 Lines 27-29 Lines 31-33 1 2 3 4 5 6 <!DOCTYPE weblogic-ejb-jar PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'> 9 10 11 12 13 14 Customer 15 16 17 18 100 19 Read-Write 20 0 21 22 23 24 25 26 27 28 WebLogic_CMP_RDBMS 29 30 5.1.0 31 32 META-INF/weblogic-cmp-rdbms-jar-Customer.xml 33 34 35 Specify the DTD for the descriptor. Element weblogic-ejb-jar contains deployment information for all EJBs in the EJB JAR. Element weblogic-enterprise-bean contains deployment information for the Customer EJB. Element ejb-name specifies the name of this bean. Contain the descriptions of caching properties Element mac-beans-in-cache defines the maximum number of active instances the container should allow. Element cache-strategy sets how EJBs should cache data. Element persistence-descriptor defines the EJBs persistence properties. Element persistence-type contains the elements type-identifier, which must be WebLogic_CMP_RDBMS. Element type-storage specifies the location of the CMP descriptor.
15
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. Lines 36-41 Lines 50-66 36 37 38 WebLogic_CMP_RDBMS 39 40 5.1.0 41 42 43 44 45 46 200 47 48 49 50 51 52 ejb/Order 53 ejb/Order 54 55 56 57 ejb/SequenceFactory 58 ejb/SequenceFactory 59 60 61 62 ejb/Address 63 ejb/Address 64 65 66 67 68 69 ejb/Customer 70 Tell WebLogic to use the persistence given in the previous element. Element reference-descriptor maps each reference to the current JNDI name.
16
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 71 72 73 74 75 76 SequenceFactory 77 78 79 80 100 81 20 82 Read-Write 83 0 84 85 86 87 88 89 90 WebLogic_CMP_RDBMS 91 92 5.1.0 93 94 META-INF/weblogic-cmp-rdbms-jar-Sequence.xml 95 96 97 98 99 100 WebLogic_CMP_RDBMS 101 102 5.1.0 103 104 105
17
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 106 107 108 200 109 110 111 112 ejb/SequenceFactory 113 114 115 116 117 118 119 Order 120 121 122 123 100 124 20 125 Read-Write 126 0 127 128 129 130 131 132 133 WebLogic_CMP_RDBMS 134 135 5.1.0 136 137 META-INF/weblogic-cmp-rdbms-jar-order.xml 138 139 140
18
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 141 142 143 WebLogic_CMP_RDBMS 144 145 5.1.0 146 147 148 149 150 151 200 152 153 154 155 156 157 ejb/SequenceFactory 158 ejb/SequenceFactory 159 160 161 162 163 ejb/OrderProduct 164 ejb/OrderProduct 165 166 167 168 ejb/Customer 169 ejb/Customer 170 171 172 173 ejb/Order 174 175
19
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 176 177 178 179 Address 180 181 182 183 100 184 20 185 Read-Write 186 0 187 188 189 190 191 192 193 WebLogic_CMP_RDBMS 194 195 5.1.0 196 197 META-INF/weblogic-cmp-rdbms-jar-address.xml 198 199 200 201 202 203 WebLogic_CMP_RDBMS 204 205 5.1.0 206 207 208
20
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 209 210 211 200 212 213 214 215 216 217 ejb/SequenceFactory 218 ejb/SequenceFactory 219 220 221 222 223 ejb/Address 224 225 226 227 228 229 OrderProduct 230 231 232 233 100 234 20 235 Read-Write 236 0 237 238
21
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 239 240 241 242 243 WebLogic_CMP_RDBMS 244 245 5.1.0 246 247 META-INF/weblogic-cmp-rdbms-jar-orderProduct.xml 248 249 250 251 252 253 WebLogic_CMP_RDBMS 254 255 5.1.0 256 257 258 259 260 261 262 ejb/Product 263 ejb/Product 264 265 266 267 268 ejb/OrderProduct 269 270 271 272
22
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 273 274 275 Product 276 277 278 279 20 280 Read-Write 281 0 282 283 284 285 286 287 288 WebLogic_CMP_RDBMS 289 290 5.1.0 291 292 META-INF/weblogic-cmp-rdbms-jar-product.xml 293 294 295 296 297 298 WebLogic_CMP_RDBMS 299 300 5.1.0 301 302 303
23
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. Lines 315-354 304 305 306 200 307 308 309 310 ejb/Product 311 312 313 314 315 316 ShoppingCart 317 318 319 320 100 321 20 322 Read-Write 323 0 324 325 326 327 328 329 /config/deitel/ 330 331 332 333 334 335 200 336 337 Stateful session EJB ShoppingCart requires slightly different deployment information.
24
2002 Prentice Hall. All rights reserved. Outline Fig. 21.4 Weblogic-ejb- jar.xml defines WebLogic deployment properties for Bookstore case study. 338 339 340 341 342 ejb/Product 343 ejb/Product 344 345 346 347 ejb/Order 348 ejb/Order 349 350 351 352 ejb/ShoppingCart 353 354 355 356
25
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.) Fig. 21.5(Part 1 of 3) Optional tags for weblogic-ejb-jar.xml not used in text
26
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.) Fig. 21.5(Part 2 of 3) Optional tags for weblogic-ejb-jar.xml not used in text
27
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.)
28
2002 Prentice Hall. All rights reserved. Outline Fig. 21.6 Weblogic-cmp- rdbms-jar- address.xml defines WebLogic CMP database properties for EJB Address. Line 11 Line 14 Line 17 Lines 21-24 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 BookstorePool 15 16 17 Address 18 19 20 21 22 zipCode 23 zipCode 24 25 26 27 state 28 state 29 30 31 32 addressID 33 addressID Element weblogic-rdbms-bean is the base element for the descriptor. Element pool-name must contain the name for a data pool already defined in WebLogic. EJB Address writes to table Address. Element object-link contains the mappings between the EJB fields and database fields for zipCode.
29
2002 Prentice Hall. All rights reserved. Outline Fig. 21.6 Weblogic-cmp- rdbms-jar- address.xml defines WebLogic CMP database properties for EJB Address. 34 35 36 37 streetAddressLine2 38 streetAddressLine2 39 40 41 42 country 43 country 44 45 46 47 streetAddressLine1 48 streetAddressLine1 49 50 51 52 city 53 city 54 55 56 57 firstName 58 firstName 59 60 61 62 lastName 63 lastName 64 65 66 67 phoneNumber 68 phoneNumber
30
2002 Prentice Hall. All rights reserved. Outline Fig. 21.6 Weblogic-cmp- rdbms-jar- address.xml defines WebLogic CMP database properties for EJB Address. 69 70 71 72 73 false 74 75 76
31
2002 Prentice Hall. All rights reserved. Outline Fig. 21.7 WebLogic-cmp- rdbm-jar- Customer.xml defines WebLogic CMP database properties for EJB CustomerEJB. 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 BookstorePool 15 16 17 Customer 18 19 20 21 22 23 24 customerID 25 customerID 26 27 28 29 30 creditCardExpirationDate 31 creditCardExpirationDate 32 33
32
2002 Prentice Hall. All rights reserved. Outline Fig. 21.7 WebLogic-cmp- rdbm-jar- Customer.xml defines WebLogic CMP database properties for EJB CustomerEJB. 34 35 36 shippingAddressID 37 shippingAddressID 38 39 40 41 42 billingAddressID 43 billingAddressID 44 45 46 47 48 passwordHint 49 passwordHint 50 51 52 53 54 creditCardName 55 creditCardName 56 57 58 59 60 firstName 61 firstName 62 63 64 65 66 password 67 password 68
33
2002 Prentice Hall. All rights reserved. Outline Fig. 21.7 WebLogic-cmp- rdbm-jar- Customer.xml defines WebLogic CMP database properties for EJB CustomerEJB. Lines 91-120 Line 95 Lines 96-98 70 71 72 lastName 73 lastName 74 75 76 77 78 userID 79 userID 80 81 82 83 84 creditCardNumber 85 creditCardNumber 86 87 88 89 90 91 92 93 94 95 findByUserID 96 97 java.lang.String 98 99 100 101 102 103 104 Element finder-list contains finder methods for the customer EJB. Element method-name is a string that matches a finder method defined in the home interface. Element method-params contains element method-param, which specifies the fully qualified type of any passed parameters.
34
2002 Prentice Hall. All rights reserved. Outline Fig. 21.7 WebLogic-cmp- rdbm-jar- Customer.xml defines WebLogic CMP database properties for EJB CustomerEJB. Lines 107-118 105 106 107 108 findByLogin 109 110 java.lang.String 111 java.lang.String 112 113 114 115 116 117 118 119 120 121 122 123 124 false 125 126 127 128 Define findByLogin, which takes two arguments and returns only the fields that match both.
35
2002 Prentice Hall. All rights reserved. 21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.)
36
2002 Prentice Hall. All rights reserved. Outline Fig. 21.9 Weblogic-cmp- rdbms-jar- order.xml defines WebLogic CMP database properties for EJB OrderEJB. 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 15 BookstorePool 16 17 18 19 CustomerOrders 20 21 22 23 24 25 26 27 orderDate 28 orderDate 29 30 31 32 33
37
2002 Prentice Hall. All rights reserved. Outline Fig. 21.9 Weblogic-cmp- rdbms-jar- order.xml defines WebLogic CMP database properties for EJB OrderEJB. 34 shipped 35 shipped 36 37 38 39 40 41 customerID 42 customerID 43 44 45 46 47 orderID 48 orderID 49 50 51 52 53 54 55 56 57 findByCustomerID 58 59 java.lang.Integer 60 61 62 63 64 65 66 67 68
38
2002 Prentice Hall. All rights reserved. Outline Fig. 21.9 Weblogic-cmp- rdbms-jar- order.xml defines WebLogic CMP database properties for EJB OrderEJB. 69 70 71 72 false 73 74 75 76
39
2002 Prentice Hall. All rights reserved. Outline Fig. 21.10 Weblogic-cmp- rdbms-jar- orderProduct.xml defines WebLogic CMP database properties for the OrderProduct EJB. 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 BookstorePool 15 16 17 OrderProduct 18 19 20 21 22 23 24 quantity 25 quantity 26 27 28 29 30 ISBN 31 ISBN 32 33
40
2002 Prentice Hall. All rights reserved. Outline Fig. 21.10 Weblogic-cmp- rdbms-jar- orderProduct.xml defines WebLogic CMP database properties for the OrderProduct EJB. 34 35 36 orderID 37 orderID 38 39 40 41 42 43 44 45 46 47 findByOrderID 48 49 java.lang.Integer 50 51 52 53 54 55 56 57 58 59 60 61 62 false 63 64 65
41
2002 Prentice Hall. All rights reserved. Outline Fig. 21.11 Weblogic-cmp- rdbms-jar- product.xml defines WebLogic CMP database properties for the Product EJB. 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 BookstorePool 15 16 17 Product 18 19 20 21 22 23 24 pages 25 pages 26 27 28 29 30 author 31 author 32 33
42
2002 Prentice Hall. All rights reserved. Outline Fig. 21.11 Weblogic-cmp- rdbms-jar- product.xml defines WebLogic CMP database properties for the Product EJB. 34 35 36 publisher 37 publisher 38 39 40 41 42 price 43 price 44 45 46 47 48 image 49 image 50 51 52 53 54 ISBN 55 ISBN 56 57 58 59 60 title 61 title 62 63 64 65 66 67
43
2002 Prentice Hall. All rights reserved. Outline Fig. 21.11 Weblogic-cmp- rdbms-jar- product.xml defines WebLogic CMP database properties for the Product EJB. 68 69 70 findAllProducts 71 72 73 74 75 76 77 78 79 80 findByTitle 81 82 java.lang.String 83 84 85 86 87 88 89 90 91 92 93 94 95 96 false 97 98 99
44
2002 Prentice Hall. All rights reserved. Outline Fig. 21.12 Weblogic-cmp- rdbms-jar- sequence.xml defines WebLogic CMP database properties for the SequenceFactory EJB. 1 2 3 4 5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN' 8 'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms- persistence.dtd'> 9 10 11 12 13 14 BookstorePool 15 16 17 SequenceFactory 18 19 20 21 22 23 24 tableName 25 tableName 26 27 28 29 30 nextID 31 nextID 32 33
45
2002 Prentice Hall. All rights reserved. Outline Fig. 21.12 Weblogic-cmp- rdbms-jar- sequence.xml defines WebLogic CMP database properties for the SequenceFactory EJB. 34 35 36 37 false 38 39 40
46
2002 Prentice Hall. All rights reserved. Outline Fig. 21.13 Weblogic.xml Web application deployment descriptor. Lines 22-29 1 2 3 4 5 6 <!DOCTYPE weblogic-web-app PUBLIC 7 "-//BEA Systems, Inc.//DTD Web Application 6.0//EN" 8 "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd"> 9 10 11 12 13 14 15 Bookstore servlets 16 17 18 19 20 21 22 23 24 25 ejb/ShoppingCart 26 27 28 ejb/ShoppingCart 29 30 31 32 33 ejb/Product 34 ejb/Product 35 Map the ShoppingCart EJB reference to its JNDI name.
47
2002 Prentice Hall. All rights reserved. Outline Fig. 21.13 Weblogic.xml Web application deployment descriptor. 36 37 38 39 ejb/Customer 40 ejb/Customer 41 42 43 44 45 ejb/Order 46 ejb/Order 47 48 49 50 51 52
48
2002 Prentice Hall. All rights reserved. 21.5 Deploying the Deitel Bookstore on IBM WebSphere Installation –Cloudscape –WebSphere application server –IBM HTTP Server XML parser and XSL transformer –xalan.jar and xerces.jar Application server admin –Localhost:9090/admin JDBC driver and data source configuration Deployment descriptors
49
2002 Prentice Hall. All rights reserved. 21.5 Deploying the Deitel Bookstore on IBM WebSphere (Cont.)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.