Hungry minds BEA weblogic server bible feb 2002 ISBN 0764548549 pdf

741 232 0
Hungry minds BEA weblogic server bible feb 2002 ISBN 0764548549 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

BEA WebLogic Server Bible Joe Zuffoletto Gary Wells, Brian Gill, Geoff Schneider, Barrett Tucker, Rich Helton, Michael Madrid, Sunil Makhijani Published by Hungry Minds, Inc 909 Third Avenue New York, NY 10022 http://www.hungryminds.com/ Copyright © 2002 Hungry Minds, Inc All rights reserved No part of this book, including interior design, cover design, and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or otherwise) without the prior written permission of the publisher Library of Congress Control Number: 2001118280 ISBN: 0−7645−4854−9 Printed in the United States of America 10 1B/RV/QS/QS/IN Distributed in the United States by Hungry Minds, Inc Distributed by CDG Books Canada Inc for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty Ltd for Australia and New Zealand; by TransQuest Publishers Pte Ltd for Singapore, Malaysia, Thailand, Indonesia, and Hong Kong; by Gotop Information Inc for Taiwan; by ICG Muse, Inc for Japan; by Intersoft for South Africa; by Eyrolles for France; by International Thomson Publishing for Germany, Austria, and Switzerland; by Distribuidora Cuspide for Argentina; by LR International for Brazil; by Galileo Libros for Chile; by Ediciones ZETA S.C.R Ltda for Peru; by WS Computer Publishing Corporation, Inc., for the Philippines; by Contemporanea de Ediciones for Venezuela; by Express Computer Distributors for the Caribbean and West Indies; by Micronesia Media Distributor, Inc for Micronesia; by Chips Computadoras S.A de C.V for Mexico; by Editorial Norma de Panama S.A for Panama; by American Bookshops for Finland For general information on Hungry Minds’ products and services please contact our Customer Care department within the U.S at 800−762−2974, outside the U.S at 317−572−3993 or fax 317−572−4002 For sales inquiries and reseller information, including discounts, premium and bulk quantity sales, and foreign−language translations, please contact our Customer Care department at 800−434−3422, fax 317−572−4002 or write to Hungry Minds, Inc., Attn: Customer Care Department, 10475 Crosspoint Boulevard, Indianapolis, IN 46256 For information on licensing foreign or domestic rights, please contact our Sub−Rights Customer Care department at 212−884−5000 Table of Contents BEA WebLogic Server Bible Part I: Preparing Your Enterprise for WebLogic In This Part .5 Chapter 1: A Quick Tour of WebLogic Server Introducing WebLogic Server Taking WebLogic for a Spin Spotting WebLogic in the Real World 10 Sparks.com 12 Surveying WebLogic’s Features, Services, and Architecture .12 HTTP server 12 J2EE containers .13 Gateway to the J2EE APIs 13 Web Services 14 J2EE Connector Architecture 14 CORBA support 14 Security services .15 Clustering services 16 Management and monitoring tools 16 Understanding WebLogic’s Role in the Enterprise .17 Is WebLogic Right for Your Project? 18 Summary 18 Chapter 2: Assembling and Managing a WebLogic Development Team 20 What WebLogic Developers Need to Know .20 Object−oriented programming in Java 20 J2EE 21 Object−Oriented Analysis and Design 21 HTML and JavaScript .22 XML 22 TCP/IP networking and distributed systems 22 Relational databases and SQL 23 Legacy systems .23 Collaborative discipline 24 Project Team Roles and Responsibilities .26 Project manager 26 Application architect .27 Database designer/database administrator 27 User Interface (UI) designer 28 Java/J2EE developer .28 Quality Assurance (QA) team 29 Documentation team .30 WebLogic administrator 30 Project Management Strategies 31 Gathering requirements 31 Designing the solution 32 Managing development 32 Planning the rollout 33 Keeping morale high .34 Summary 35 Table of Contents Chapter 3: Designing WebLogic Applications .36 Overview 36 Understanding Multitier Applications 36 How J2EE separates applications into tiers 36 The Model−View−Controller design pattern 37 Model−View−Controller in action: An ATM machine 38 Model−View−Controller as a methodology for designing multitier applications 38 Building Multitier Applications with J2EE: Containers and Components 39 Containers .39 Components 40 Organizing Components into Applications 41 Model tier patterns 42 View tier patterns 43 Controller tier patterns 44 Deploying Components in WebLogic’s Containers 46 Designing an Example Application: WebLogic Online Brokerage .47 Identifying requirements 47 Organizing requirements by user role .49 Expressing requirements in use case diagrams .51 Exploding use cases into activity diagrams 52 Mapping functionality to MVC with swimlanes 53 Selecting appropriate J2EE components and modeling their interactions 55 Other considerations .56 Summary 58 Chapter 4: Creating a WebLogic Environment 59 Overview 59 Configuring a Computer for Development 59 Obtaining a Copy of WebLogic Server .60 Installing WebLogic Server 60 Running the installer .61 Starting WebLogic Server 65 Running the WebLogic Console .66 Shutting down WebLogic Server 66 Optimizing the WebLogic Server startup process for development .67 Examining the environment 68 Adding domains for testing and production 70 Installing JDBC Drivers .73 Selecting an IDE to use with WebLogic Server 74 Summary 74 Part II: WebLogic and the J2EE APIs 75 In This Part 75 Chapter 5: Working with WebLogic JDBC 76 Overview 76 Understanding JDBC 76 JDBC versions and packages 76 JDBC architecture 77 Understanding WebLogic JDBC 83 WebLogic and third−party drivers 83 MultiPools .85 Table of Contents Chapter 5: Working with WebLogic JDBC DataSources 86 Clustered JDBC 87 Configuring WebLogic JDBC .87 Configuring connection pools 87 Configuring MultiPools 93 Configuring DataSources 95 Configuring Tx DataSources 97 Programming WebLogic JDBC 97 Obtaining connections 98 Using Connections to execute Statements and process Results 101 Closing connections 102 Summary 103 Chapter 6: Working with WebLogic JTA 104 Overview 104 Understanding Transactions .104 What is a transaction? 104 Transactions and the ACID test 105 Resources and resource managers 105 Local and distributed transactions 105 Transaction isolation levels 106 Transaction demarcation .108 Two−phase commit and the XA interface 109 Understanding JTA 109 JTA versions and packages 110 JTA architecture 110 Transaction−aware resource managers 110 Configuring WebLogic JTA 112 Programming WebLogic JTA 113 Programming a local transaction with the WebLogic JTS driver 113 Programming a distributed transaction with the Oracle XA driver 116 Summary 120 Chapter 7: Working with WebLogic JNDI 121 Overview 121 Understanding JNDI 121 JNDI versions and packages 121 JNDI architecture 122 Programming WebLogic JNDI 125 Obtaining a reference to WebLogic’s context 125 Binding objects to the WebLogic JNDI tree 127 Using subcontexts to organize the JNDI tree 127 Performing lookups on objects bound to the WebLogic JNDI tree 128 Performing lookups against an LDAP directory 129 Using WebLogic JNDI to Deploy Objects in a Clustered Environment 133 Write an RMI proxy for the custom object 134 Pin the custom object to one server 134 Deploy the custom object separately to all servers .134 Summary 135 Table of Contents Chapter 8: Working with WebLogic RMI 136 Overview 136 Understanding RMI 136 RMI versions and packages 136 RMI architecture 138 Comparing WebLogic RMI to JavaSoft RMI 140 Ease−of−use 141 Performance and scalability 141 Writing Your First WebLogic RMI Application .144 Write the remote interface 145 Write the server .145 Compile the remote interface and the server 146 Generate stubs and skeletons for the server 147 Write a client that remotely calls the server 147 Compile the client 148 Configure the RMI server as a WebLogic startup class .148 Stop and restart WebLogic Server 150 Verify correct deployment of the RMI server 150 Run the client and test the server 151 Using WebLogic RMI with JNDI and Multiple Clients 152 Building a server 152 Building the clients .155 Invoking Client Methods from RMI Servers .161 Calling EJBs from RMI Servers 166 Summary 168 Chapter 9: Working with WebLogic JMS 169 Understanding JMS 169 JMS versions and packages 169 JMS architecture 169 Configuring WebLogic JMS 173 Creating a connection factory .174 Defining a file backing store 176 Defining a JDBC backing store 177 Defining destination keys .178 Defining templates 179 Defining a JMS server 180 Creating a message queue .181 Creating a message topic 182 Programming WebLogic JMS 183 Sending messages 183 Receiving messages synchronously 191 Receiving messages asynchronously 196 Receiving messages concurrently using session pools 202 Filtering incoming messages 205 Browsing messages in a queue .207 Creating durable subscribers to topics 208 Working with Transactions 210 Working with JMS transacted sessions 210 Working with JTA transactions 211 Summary 219 Table of Contents Chapter 10: Working with WebLogic JavaMail 221 Understanding JavaMail 221 JavaMail versions and packages 221 JavaMail architecture 221 Configuring WebLogic JavaMail 226 Creating a mail session 226 Adding POP3 to WebLogic 227 Sending Messages with WebLogic JavaMail 228 Obtaining a mail session via JNDI .228 Sending a simple message 229 Deployment descriptor for the examples 229 Example: Send Mail servlet 230 Overriding mail session properties .232 Authenticating a mail session .233 Sending an enclosure using a MimeMultipart 234 Example: Send Mail servlet .234 Sending a message to multiple recipients (bulk mail) 237 Navigating stores 238 Retrieving and Displaying Messages with WebLogic JavaMail .241 Listing messages 242 Example: Display messages 242 Analyzing message flags 246 Deleting a message .247 Expunging messages .247 Example: Displaying message details 248 Summary 253 Part III: Developing Web Components 254 In This Part 254 Chapter 11: Developing Servlets 255 Overview 255 Understanding Servlets 256 The servlet API: Versions and packages 256 The Web container and Web applications 257 How servlets work 259 When to use servlets .261 The servlet life cycle .261 Programming Servlets 262 Creating a simple Web application .262 Writing a simple servlet 264 Deploying and testing the servlet 266 Advanced Servlet Programming Techniques .267 Working with sessions 267 Working with the servlet context 272 Dispatching requests to other resources 273 Securing your application .274 Building an Advanced Application with Servlets 277 Gathering the requirements 277 Brainstorming a design 278 Building the application 278 Deploying the application as a WAR file .294 Table of Contents Chapter 11: Developing Servlets Summary 295 Chapter 12: Developing JavaServer Pages 296 Overview 296 Understanding JavaServer Pages .296 Product of evolution 296 How JSPs work .297 Model−View−Controller 298 Configuring WebLogic Server for JSPs 299 The JSP compiler 299 Configuring the WebLogic Application Extension Deployment Descriptor 300 Deploying your first JSP in WebLogic Server .307 Support for JSP 1.2 .310 Programming JavaServer Pages 310 Tag conventions 311 Directives 311 Scripting 314 Comments .317 Implicit objects .318 Actions 320 JSP example 322 Error handling .329 Debugging .330 Programming JSPs with JavaBeans 332 Deploying your first JavaBean .332 JSP bean tags 334 JSP and JavaBean example 339 Using servlets to handle requests 341 Summary 345 Chapter 13: Developing Tag Libraries .346 Understanding Tag Libraries .346 Tag handler lifecycle 346 Tag handlers and the Tag Extension API .349 Main interfaces .349 Convenience classes .350 Supporting interfaces and classes 354 Programming and Using a Tag Extension 357 Programming a tag handler class 357 Defining a Tag Library Descriptor .360 Configuring the WebLogic Web application deployment descriptor 364 Using a tag extension within a JSP .365 Resolving a tag extension .369 Programming a TagExtraInfo Class 370 WebLogic Tag Libraries 373 WebLogic JSP form validation tags .373 WebLogic custom JSP tags 375 WebLogic EJB−to−JSP Integration Tool 375 Summary 376 Table of Contents Part IV: Developing EJB Components .377 In This Part 377 Chapter 14: Understanding Enterprise JavaBeans 378 Overview 378 EJB Architecture 379 EJB Types 379 Session beans 379 Entity beans 380 Message−driven beans 380 EJB Client−Access Models .381 EJB Components 381 Home interface 382 Remote interface 383 Implementation class 384 Deployment descriptors 386 WebLogic’s EJB Container Services 389 Lifecycle management 389 Transaction support .389 Persistence 391 Clustering support 391 Security 392 EJB 1.1 versus 2.0 392 New: Message−driven beans 392 Improved: CMP for entity beans 392 Summary 394 Chapter 15: Developing Session Beans .395 Overview 395 Common session bean uses 396 Using session EJBs to model workflow 396 Client−server architecture .396 EJB Container functionality 396 No synchronization issues 396 Inherently reusable 396 Scalability .397 Comparing Stateless and Stateful Beans 397 Programming Session Beans .399 Home interfaces 399 Session EJB interfaces 400 Implementation class 401 Stateful EJB example—AnalyzePortfolio 413 Clustering Session Beans 419 Programming Transactions in Session Beans 420 Summary 420 Chapter 16: Developing Entity Beans 421 Overview 421 Understanding Entity Beans 421 Entity beans and persistence 421 Types of entity beans 421 Entity bean lifecycle .421 Table of Contents Chapter 16: Developing Entity Beans EJB 2.0 .422 CMP relationships 422 Local interfaces .423 CMP abstract persistence schema 423 EJB QL 423 Entity Bean Component Files 424 Programming BMP 424 Define the home interface .424 Define the local home interface 425 Define the remote interface 425 Define the local interface 426 Create the bean 426 Create the primary key class (optional) 434 Create value object class (optional) 434 Create the deployment descriptors 436 Notes .438 Programming CMP 438 Create the Department bean 438 Define the Course bean 443 Create the deployment descriptors 447 Deployment to WebLogic 458 Advanced WebLogic Features for Entity Beans 458 Concurrency and locking 458 Automatic table creation .460 CMP, BMP, and Other Options 460 Trade−offs between BMP and CMP .460 Session beans 461 Java Data Objects 461 Third−Party Tools 461 WebGain Studio 461 JBuilder 461 Cocobase Enterprise O/R 462 TogetherSoft Control Center 462 Summary 462 Chapter 17: Developing Message−Driven Beans .463 Overview 463 Understanding Message−Driven Beans .463 Versions and packages 463 How message−driven beans differ from other EJBs 463 Deciding whether to write a message−driven bean or a JMS client .464 Programming Message−Driven Beans 465 The MessageDrivenBean interface—javax.ejb.MessageDrivenBean 465 The message−driven bean context 465 Implementing business logic 466 Deploying Message−Driven Beans in WebLogic Server 467 Deployment descriptors 467 Transaction attributes 468 Deploying message−driven beans using WebLogic Console .469 Building an Application Using Message−Driven Beans and XML 470 The business problem: Sending medical prescriptions over a wireless network 470 Chapter 27: Working with WebLogic and the J2EE Connector Architecture the Connection interface that can be changed by defining it in This tag defines the Connection interface that the resource adapter will use Another interface that can be defined is the ConnectionFactory interface Interfaces are not the only coding pieces that can be defined in the ra.xml, implementation classed for the Connection, ManagedConnectionFactory, and ConnectionFactory are also defined in the , , and Other pieces that are specified in the ra.xml are the icons for the resource adapter, and EIS type for the resource adapter for connection To create a RAR file, first compile the Java class files and put them in a staging directory A staging directory is a directory containing only the files that will be put into the RAR file You may want to create multiple JAR files for some of these Java resources; an example is a CCI.jar for the CCI−specific files and a RA.jar for resource adapter−specific files Create a META−INF subdirectory that the XML files will be stored in Create the ra.xml and weblogic−ra.xml files Ensure that the proper class implementations are defined for the ManagedConnectionFactory, ConnectionFactory, and Connection in the ra.xml file Create a JAR file that contains these files The following is an example: jar cvf myRA.rar * Deploy the RAR into the WebLogic Server by using the Admin Console If the resource adapter is not a stand−alone resource adapter, meaning that it has associated EJB clients to be deployed with, the EJB files need to be deployed in an EAR (Enterprise Archive) file, and need to be JARed into the RAR as well with its deployment information To add other files into the RAR file, simply copy them to the staging directory and add them to the RAR by using the JAR command: jar xf myRA.rar * Some things to consider when working with the WebLogic Server is that there is no support for the Kerberos authentication implementation This means javax.resource.spi.security.GenericCredential is not supported Also, only serializable ConnectionFactory implementations are supported Not everything has to be handled from the Admin Console You can also view the deployed Connection Components, undeploy Connection Components, and deploy more Connection Components from the command prompt by using the java weblogic.deploy command Summary One thing that can’t be emphasized enough is the need for the Connector API Without using the Connector API, it becomes difficult to provide a standard solution for interfacing to EIS systems Most organizations use third−party, non−J2EE components to some degree But developing proprietary solutions without a common architecture can be very time consuming and less reusable As time evolves and maintenance needs increase, standards provide a common ground for both developers and architects to communicate how to develop a common J2EE component Using a standard, such as the Connector specification, provides out−of−the−box documentation that has the benefit of being proven in other development initiatives An important aspect to this discussion is the need for EAI to be integrated into the Application Server The Connector API enables the Application Server to become an EAI solution The need for using the same management systems of security, transaction, and connection services is very important 717 Chapter 27: Working with WebLogic and the J2EE Connector Architecture unless an organization wants to spend a great deal of time and effort in getting into how management systems manage each other A lot of work still needs to be offered in the study of Connectors, and it should be evident that the Application Servers could offer more tools for the building and deployment of Connectors A need also exists for multiple sets of Connectors for different EIS systems so that organizations can plug their J2EE components into EISs from out−of−the−box components From the specification and the motivation to try to standardize J2EE components into legacy systems, the Connector API is advantageous for moving data in between disparate systems and contributes significantly to the evolution of Enterprise Components and connecting them across a wide range of distributed architectures Without the Connector specification, there would be a lot missing in architecture for the capability to provide interfaces into legacy systems and other third−party systems 718 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions Like all successful software products, WebLogic Server has evolved and improved with age WebLogic Server’s evolution is unique, however, because it is closely tied to the evolution of the J2EE specification In fact, one of WebLogic Server’s greatest strengths is its robust and timely adherence to the specification, because this permits WebLogic developers to take advantage of new J2EE features almost as soon as they hit the street The downside of this is that upgrading to a new version of WebLogic Server is a two−part process and can sometimes be quite involved First, you must upgrade your server instances themselves, which usually entails conversions of license files and properties files Then you must upgrade your applications, which is usually more complicated because you must update them to match new features both in WebLogic Server and in the J2EE specification In this chapter, I give you some pointers and checklists on how to accomplish these tasks Upgrading WebLogic Server A number of tasks are required in the process of upgrading your WebLogic server installation to WebLogic 6.1 BEA has provided a clear and simple upgrade path that involves only a few a steps: Upgrading the WebLogic license file Converting the weblogic.properties file Of course, these simple points have a good bit of work behind them But if you plan your server upgrade carefully, it should be an orderly and simple process The real work will come later when you upgrade your applications to function with WebLogic 6.1! Upgrading the WebLogic license file Depending on the version of WebLogic that you are running, this can be a multipart process Start at the section that is appropriate for your server installation and continue from there Pre−WebLogic 4.0 installations If you are currently running a version older than WebLogic 4.0, you must upgrade your license file from the WebLogicLicense.class file to a WebLogicLicense.xml file before proceeding For this you must use the license converter utility provided with WebLogic 6.1 The WebLogicLicense.class file should be located on your classpath, in the WL_HOME directory, or be in the directory in which you execute the licenseConverter utility From a command line, run the setenv script (.cmd or sh depending on your platform) provided by WebLogic to properly set up your environment; then type $ java utils.licenseConverter −w c:\bea 719 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions In this example, c:\bea is the directory where you want the new WebLogicLicense.xml file to be written WebLogic 4.0 to 5.1 installations To upgrade your WebLogicLicense.xml file to the license_wls61.bea file, you must visit a special BEA Web site and follow the instructions given there The URL for the site is: http://websupport.beasys.com/custsupp/wls6_license.htm You need to have a BEA WebSupport account to be able to submit this form, and you will be prompted for the name and password for that account Once you have been authenticated, you can update as many as ten license files at a time The new license files will be mailed to you at the e−mail account you specify Turnaround time can be anywhere from ten minutes to a day or more (so they say—it’s always been rather quick in my experience) In any case, you should plan for a delay and be pleasantly surprised when it arrives early WebLogic 6.0 installations Although the format for WebLogic 6.0 and 6.1 licenses is similar, you need to update your 6.0 license to work with 6.1 The process is exactly the same as the WebLogic 4.0 to 5.1 update, but the URL to visit is different: http://websupport.beasys.com/custsupp/wls60to61_license.htm Place the converted license files you received from BEA in the BEA home directory (on Windows this is often c:\bea) You can accomplish the license conversion with a simple command−line application provided by BEA First, ensure that your environment is set up by using the WebLogic setenv script Then, if you are running on Windows, go to the BEA home directory and execute the following command: UpdateLicense.cmd license_update_file If you are running on Unix, execute this command instead: sh UpdateLicense.sh license_update_file Converting the weblogic.properties file In versions of WebLogic prior to 6.0, server and application properties were stored in a weblogic.properties file With the support of J2EE applications in WebLogic 6.0 and 6.1, application configuration settings are stored separately from the server properties They are now stored in XML deployment descriptor files associated with each J2EE application WebLogic provides a utility that parses existing weblogic.properties files and generates the appropriate XML files for each of your applications Using this converter utility creates a new WebLogic 6.1 domain and places the XML file for each of your applications in the new domain directory 720 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions To use the converter, open the WebLogic Console home Web page (or from any page in the console, click the Home icon in the upper right) and click the Convert Weblogic.properties link under Getting Started on the main page This takes you to the properties conversion page, as shown in Figure A−1 Figure A−1: Selecting the directory containing the weblogic properties to convert You will be asked to browse to the original installation directory, so be sure that you have network access to that original server installation Note that if you have multiple servers running under your WebLogic home directory, you will need to convert those servers separately Once you have navigated to the proper directory, click the orange pentagon next to the installation directory You will be asked to choose the server and cluster properties you want to convert It is helpful at this point to have a text editor open so that you can view the contents of the weblogic.properties file; the selections on this screen not always make sense out of context (see Figure A−2) The following table (Table A−1) shows what values in the weblogic.properties file match which elements in your newly created config.xml It may be worth your while to browse the newly converted properties to ensure the transfer occurred properly Figure A−2: The properties file conversion page in WebLogic Console 721 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions Table A−1: Config.xml Elements & weblogic.properties Entries Element Cluster Attribute weblogic.properties file entry Cluster Address weblogic.cluster.name Name ShrinkingEnabled CapacityIncrement DriverName InitialCapacity LoginDelaySeconds MaxCapacity Password Properties RefreshMinutes ShrinkPeriodMinutes TestConnectionsOnReserve TestConnectionsOnRelease TestTableName URL weblogic.jdbc.connectionPool weblogic.jdbc.connectionPool − allowShrinking weblogic.jdbc.connectionPool − capacityIncremen weblogic.jdbc.connectionPool − driver weblogic.jdbc.connectionPool − initialCapacity weblogic.jdbc.connectionPool − loginDelaySecs weblogic.jdbc.connectionPool − maxCapacity weblogic.jdbc.connectionPool − props weblogic.jdbc.connectionPool − props (password) weblogic.jdbc.connectionPool − refreshTestMinute weblogic.jdbc.connectionPool − shrinkPeriodMins weblogic.jdbc.connectionPool − testConnsOnRese weblogic.jdbc.connectionPool − testConnsOnRele weblogic.jdbc.connectionPool − testTable weblogic.jdbc.connectionPool − url Name weblogic.jms.ConnectionConsumer Name weblogic.jms.topic. LdapProvider weblogic.security.ldaprealm.factory AuditProviderClassName weblogic.security.audit.provider TunnelingEnabled AdministrationPort TGIOPEnabled HelpPageURL ListenPort LoginTimeoutMillis ClusterWeight weblogic.httpd.tunnelingenabled weblogic.system.AdministrationPort weblogic.system.enableTGIOP weblogic.system.helpPageURL weblogic.system.ListenPort weblogic.system.readTimeoutMillis weblogic.system.weight LoginTimeoutMillis ServerCertificateChainFileName Ciphersuites HostnameVerifier weblogic.login.readTimeoutMillisSSL weblogic.security.certificate.authority weblogic.security.SSL.ciphersuite weblogic.security.SSL.hostnameVerifier JDBC ConnectionPool JMSConnection Consumer JMSDestination LDAPRealm Security Server SSL 722 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions HostNameVerification Ignored weblogic.security.SSL.ignoreHostnameVerificatio FailureIsFatal weblogic.system.startupFailureIsFatal PostBindGID PostBindUID weblogic.system.nonPrivGroup weblogic.system.nonPrivUser DefaultServerName weblogic.httpd.defaultServerName EmailAddress Name PhoneNumber Notes (freeform, optional) weblogic.administrator.email weblogic.administrator.name weblogic.administrator.phone weblogic.administrator.location ACLCacheEnable ACLCacheSize ACLCacheTTLNegative ACLCacheTTLPositive AuthenticationCache Enable AuthenticationCacheSize AuthenticationCacheTTLNegative AuthenticationCacheTTLPositive weblogic.security.realm.cache.acl.enable weblogic.security.realm.cache.acl.size weblogic.security.realm.cache.acl.ttl.negative weblogic.security.realm.cache.acl.ttl.positive weblogic.security.realm.cache.auth.enable weblogic.security.realm.cache.auth.size weblogic.security.realm.cache.auth.ttl.negative weblogic.security.realm.cache.auth.ttl.positive CacheCaseSensitive GroupCacheEnable GroupCacheSize GroupCacheTTLNegative GroupCacheTTLPositive PermissionCacheEnable PermissionCacheSize PermissionCacheTTL Negative PermissionCacheTTL Positive UserCacheEnable UserCacheSize UserCacheTTLNegative UserCacheTTLPositive weblogic.security.realm.cache.caseSensitive weblogic.security.realm.cache.group.enable weblogic.security.realm.cache.group.size weblogic.security.realm.cache.group.ttl.negative weblogic.security.realm.cache.group.ttl.positive weblogic.security.realm.cache.perm.enable weblogic.security.realm.cache.perm.size weblogic.security.realm.cache.perm.ttl.negative weblogic.security.realm.cache.perm.ttl.positive weblogic.security.realm.cache.user.enable weblogic.security.realm.cache.user.size weblogic.security.realm.cache.user.ttl.negative weblogic.security.realm.cache.user.ttl.positive DefaultLoadAlgorithm MulticastAddress MulticastTTL weblogic.cluster.defaultLoadAlgorithm weblogic.cluster.multicastAddress weblogic.cluster.multicastTTL ClientID weblogic.jms.connectionFactoryArgs.ClientID StartupClass UnixMachine WebServer Administrator CachingRealm CachingRealm Cluster JMSConnectionFactory 723 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions DefaultDeliveryMode TransactionTimeout JNDIName weblogic.jms.connectionFactoryArgs.DeliveryMo weblogic.jms.connectionFactoryArgs.TransactionT weblogic.jms.connectionFactoryName Name weblogic.jms.queue PrefixName weblogic.jms.tableNamePrefix Name Name weblogic.jms.queueSessionPool weblogic.jms.topicSessionPool StdoutEnabled ThreadPoolPercentSocket Readers weblogic.system.enableConsole weblogic.system.percentSocketReaders GroupNameAttribute AuthProtocol Credential GroupDN GroupIsContext GroupUsernameAttribute weblogic.security.ldaprealm.groupNameAttribute weblogic.security.ldaprealm.authentication weblogic.security.ldaprealm.credential weblogic.security.ldaprealm.groupDN weblogic.security.ldaprealm.groupIsContext weblogic.security.ldaprealm.groupUsernameAttrib Principal SSLEnable LDAPURL UserAuthentication UserDN UserNameAttribute UserPasswordAttribute weblogic.security.ldaprealm.principal weblogic.security.ldaprealm.ssl weblogic.security.ldaprealm.url weblogic.security.ldaprealm userAuthentication weblogic.security.ldaprealm.userDN weblogic.security.ldaprealm.userNameAttribute weblogic.security.ldaprealm.userPasswordAttribut FileName FileMinxSize weblogic.system.logFile weblogic.system.maxLogFileSize PrimaryDomain weblogic.security.ntrealm.domain GuestDisabled ConnectionFilter SystemUser weblogic.security.disableGuest weblogic.security.net.connectionFilter weblogic.system.user HttpdEnabled TunnelingClientPingSecs TunnelingClientTimeoutSecs DefaultIIOPPassword weblogic.httpd.enable weblogic.httpd.tunneling.clientPingSecs weblogic.httpd.tunneling.clientTimeoutSecs weblogic.iiop.password JMSDestination JMSJDBCStore JMSSessionPool Kernel LDAPRealm LDAPRealm Log NTRealm Security Server 724 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions DefaultIIOPUser weblogic.iiop.user Server JDBCLoggingEnabled weblogic.jdbc.enableLogFile JDBCLogFileName weblogic.jdbc.logFileName JNDITransportableObjectFactoryList weblogic.jndi.transportableObjectFactories AdministrationPort weblogic.system.AdministrationPort ListenAddress weblogic.system.bindAddr DefaultProtocol weblogic.system.defaultProtocol DefaultSecureProtocol weblogic.system.defaultSecureProtocol IIOPEnabled weblogic.system.enableIIOP ReverseDNSAllowed weblogic.system.enableReverseDNSLookups RootDirectory weblogic.system.home NativeIOEnabled weblogic.system.nativeIO.enable LoginTimeoutMillis weblogic.system.readTimeoutMillis WorkspaceShowUserKeys Only weblogic.workspace.showUserKeysOnly ZACEnabled weblogic.zac.enable ZACPublishRoot weblogic.zac.publishRootProp ServerDebug MagicThreadDump BackToSocket MagicThreadDumpFile MagicThreadDumpHost MagicThreadDumpEnabled weblogic.system.MagicThreadBackToSocket weblogic.system.MagicThreadDumpFile weblogic.system.MagicThreadDumpHost weblogic.system.magicThreadDumps ServerCertificateFile Name CertificateCacheSize TrustedCAFileName ClientCertificate Enforced ExportKeyLifespan ServerKeyFileName CertAuthenticator Enabled HandlerEnabled UseJava ListenPort weblogic.security.certificate.server weblogic.security.certificateCacheSize weblogic.security.clientRootCA weblogic.security.enforceClientCert weblogic.security.key.export.lifespan weblogic.security.key.server weblogic.security.realm.certAuthenticator weblogic.security.ssl.enable weblogic.security.SSLHandler.enable weblogic.system.SSL.useJava weblogic.system.SSLListenPort PostBindGID PostBindUIDEnabled weblogic.system.enableSetGID, weblogic.system.enableSetUID, AuthProgram weblogic.security.unixrealm.authProgram AuthRealmName IndexDirectoryEnabled weblogic.httpd.authRealmName weblogic.httpd indexDirectories SSL UnixMachine UnixRealm WebAppComponent 725 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions ServletExtensionCase Sensitive ServletReloadCheckSecs SingleThreadedServlet PoolSize weblogic.httpd.servlet.extensionCaseSensitive weblogic.httpd.servlet.reloadCheckSecs weblogic.httpd.servlet.SingleThreadedModelPoolS Charsets ClusteringEnabled DefaultWebApp LoggingEnabled KeepAliveSecs HttpsKeepAliveSecs KeepAliveEnabled LogFileBufferKBytes LogFileFlushSecs LogFileFormat LogFileName LogRotationPeriodMins LogRotationTimeBegin LogRotationType MaxLogFileSizeKBytes PostTimeoutSecs URLResource weblogic.httpd.charsets weblogic.httpd.clustering.enable weblogic.httpd.defaultWebApp weblogic.httpd.enableLogFile weblogic.httpd.http.keepAliveSecs weblogic.httpd.https.keepAliveSecs weblogic.httpd.keepAlive.enable weblogic.httpd.logFileBufferKBytes weblogic.httpd.logFileFlushSecs weblogic.httpd.logFileFormat weblogic.httpd.logFileName weblogic.httpd.logRotationPeriodMins weblogic.httpd.logRotationPeriodMins weblogic.httpd.logRotationType weblogic.httpd.maxLogFileSizeKBytes weblogic.httpd.postTimeoutSecs weblogic.httpd.URLResource WebServer Upgrading WebLogic Applications Now that you have migrated your servers to WebLogic 6.1, you can migrate your applications into J2EE application formats that match the current version of the specification Migrating J2EE Web applications The most commonly migrated applications are Web applications (possibly packaged into war files) Two files describe Web applications under WebLogic 6.1, the web.xml and weblogic.xml deployment descriptors For more information on these files and on packaging and deploying Web applications on WebLogic in general, see Chapter 18 Tables A−2 and A−3 show the mappings between name/value pairs in the weblogic.properties file and XML elements and attributes in the web.xml and weblogic.xml files, respectively Skeletons of these files should have been created by the migration utility mentioned earlier and placed in your new domain directory You should update these deployment descriptors by using the tools described in Chapter 18 to take full advantage of the configurations made available by WebLogic and the Servlet 2.3 Web application specification Only a single property from the weblogic.properties file maps to the J2EE web.xml file, as shown in Table A−2: Table A−2: web.xml Elements & weblogic.properties Entries 726 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions Element Mime−mapping Attribute weblogic.properties file entry mime−type weblogic.httpd.mimeType All the other conversions deal with session management and are placed in the WebLogic−specific weblogic.xml file It should be noted that sessions created by previous versions of WebLogic Server are not recognized in WebLogic 6.0 and later, as the session cookie format has changed The entries listed in Table A−3 appear as / element pairs inside of a element For example: TimeoutSecs 3600 sets the Web application session timeout to one hour Table A−3: Web Application Elements and weblogic.properties Entries param−name weblogic.properties file entry mime−type weblogic.httpd.mimeType CacheSize weblogic.httpd.session.cacheEntries CookieComment weblogic.httpd.session.cookie.comment CookieDomain weblogic.httpd.session.cookie.domain CookieMaxAgeSecs weblogic.httpd.session.cookie.maxAgeSecs CookieName weblogic.httpd.session.cookie.name CookiePath weblogic.httpd.session.cookie.path CookiesEnabled weblogic.httpd.session.cookies.enable SessionDebuggable weblogic.httpd.session.debug SessionTrackingEnabled weblogic.httpd.session.enable InvalidationIntervalSecs weblogic.httpd.session.invalidationintervalSecs JDBCConnectionTimeoutSecs weblogic.httpd.session.jdbc.connTimeoutSecs PersistentStoreDir weblogic.httpd.session.persistentStoreDir PersistentStorePool weblogic.httpd.session.persistentStorePool SessionPersistentStoreShared weblogic.httpd.session.persistentStoreShared PersistentStoreType weblogic.httpd.session.persistentStoreType IDLength weblogic.httpd.session.sessionIDLength SwapIntervalSecs weblogic.httpd.session.swapintervalSecs TimeoutSecs weblogic.httpd.session.timeoutSecs URLRewritingEnabled weblogic.httpd.session.URLRewriting.enable Following is a list of some items to consider when upgrading to the Servlet 2.3 Web Application format: • 727 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions If you have hard−coded URLs in your servlets or HTML, you may need to change them to reflect the new Web application path: http://myweblogic:7001/webappname/your_files_are_here If you have used relative URLs throughout your files, these changes should not be necessary • Objects stored in the session should be serializable if the application is going to run under WebLogic clustering Also, dynamic classloading of your Web applications could cause ClassCastExceptions if nonserializable objects are stored in the session • Access Control Lists for you files are now security constraints defined in the web.xml file • Server−side includes (.shtml) are no longer supported You will need to convert to JSP files to get this functionality Migrating EJB applications WebLogic 6.1 supports both the Enterprise JavaBeans 1.1 and 2.0 specifications, so EJBs that you developed for WebLogic 5.1 should be easy to deploy on WebLogic 6.1 It is important to note that the XML deployment descriptor parser for 6.1 is a bit stricter that the one included in 5.1, so you might have to include a few new entries in the deployment descriptor of your 1.1 EJB The server will tell you which ones you have to add at deployment time Unlike WebLogic 5.1, you no longer have to run the ejbc compiler on the EJB prior to deployment If ejbc has not been run on a bean at deploy time, WebLogic 6.1 will it automatically for you Note Some developers think it’s good practice to run ejbc anyway—to expose possible problems with EJBs before they are deployed Only two features have been removed from EJB applications in WebLogic 6.1 The finder expressions used in the EJB 1.1 specification are no longer supported in 6.1 Also, the weblogic.deploy utility for deploying EJB to a running server is no longer supported Cross Reference See Chapters 14−17 for more information on how to deploy EJBs in WebLogic 6.1 Migrating EJBs from 1.1 to 2.0 Should you want to upgrade existing EJB 1.1 beans to 2.0, WebLogic conveniently provides an upgrade utility called DDConverter to help you convert your deployment descriptors to the 2.0 specification You feed the DDConverter utility your 1.1 EJB JAR file that contains your bean classes and your deployment descriptors; DDConverter will output a JAR file containing the converted deployment descriptors Here’s a sample command line: $ java weblogic.ejb20.utils.ddconverter.DDConverter −d \tmp myEJB.jar Note The package here is different than that listed in some WebLogic documentation (often listed as weblogic.ejb20.utils.DDConverter) 728 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions You should specify an output directory different than the current directory (using the required −d flag), as the output will be a file of the same name as the input After running the utility, you should repackage the original EJB classes with the new deployment descriptors (don’t include classes generated by the WebLogic 5.1 ejbc compiler) For session beans, this is all you should have to to upgrade from 1.1 to 2.0 For CMP entity beans, however, there are several additional steps In EJB 2.0 CMP beans, all getter and setter methods for bean properties are abstract, and the container takes care of creating the concrete implementation class So, if you had the following setXXX and getXX methods in your 1.1 CMP bean: private String name; public String getName() { return name; } public void setName(String newName) { name = newName; } you would change this to: public abstract String getName(); public abstract void setName(String newName); Any finders methods you have declared that have return values of java.util.Enumeration should be updated to return java.util.Collection, as CMP 2.0 can no longer return enumerations Something to note is the advent of the Enterprise Application Java application structure, which allows you to package many Java applications into a single deployable unit with a defined structure This can support any number of Web applications, EJBs, and supporting files and classes bundled together in a single ear file (packaged using the jar format) Cross Reference For more information on Enterprise Applications, see Chapter 18 Removed and Deprecated Features In the course of upgrading WebLogic Server to 6.1, BEA removed some features and deprecated others Removed APIs and features The following features have been removed from WebLogic 6.1: • Java−based Administration Console—Use the browser−based console instead • The Deployer Tool—You should now deploy applications via the WebLogic console • WebLogic/Tengah Beans—Use the latest JavaBean specification • 729 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions WebLogic jHTML—Upgrade to JSP by using the jHTML JSP converter (see the WebLogic documentation on how to use this tool) • WebLogic/Tengah Remote and Workspaces—Consider using JNDI and RMI for communication and object sharing (see Chapters and for details about these technologies) • T3 Client and Remote T3—Applications using this should change to RMI • WebLogic COM—Relied on the Microsoft JVM, which is no longer supported Consider using a third−party Java−Com bridge if you need direct access to COM objects • SSI—Use JSPs and instead • Jview and the Microsoft JVM are no longer supported • weblogic.jdbc20.* packages—Moved to weblogic.jdbc.* Deprecated APIs If you are using any of the following features of WebLogic prior to version 6.1, you may wish to look into alternative processes, prior to or soon after upgrading to WebLogic 6.1, as it is likely that they will removed in a future release: • WebLogic Events—Look into using unacknowledged JMS messages instead (see Chapter on JMS) • WebLogic HTMLKona—Consider upgrading servlets by using HTMLKona to JSP pages (see Chapters 12 and 13 on JSP and JSP Tag libraries) • T3 JDBC Driver—You should use the RMI JDBC driver instead (see Chapter on using JDBC with WebLogic) Where to Find More Information BEA provides two manuals to assist with the migration process: • For more information about how to upgrade servers, go to http://e−docs.bea.com/wls/docs61/notes/upgrade.html • 730 Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions For more information about how to upgrade applications, go to http://e−docs.bea.com/wls/docs61/notes/migrate.html 731 ... and run it with WebLogic The WebLogic Server family consists of three products: • WebLogic Server the focus of this book • WebLogic Server Enterprise WebLogic Server plus the BEA Tuxedo transaction... .61 Starting WebLogic Server 65 Running the WebLogic Console .66 Shutting down WebLogic Server 66 Optimizing the WebLogic Server startup process for... Creating a WebLogic Environment Chapter 1: A Quick Tour of WebLogic Server In this chapter, I take you on a quick tour of WebLogic Server (often referred to as WebLogic ) I introduce you to WebLogic

Ngày đăng: 20/03/2019, 11:39

Mục lục

  • BEA WebLogic Server Bible

    • Copyright

    • Table of Contents

    • Part I: Preparing Your Enterprise for WebLogic

      • Chapter 1: A Quick Tour of WebLogic Server

        • Introducing WebLogic Server

        • Taking WebLogic for a Spin

        • Spotting WebLogic in the Real World

          • Sparks.com

          • Surveying WebLogic™s Features, Services, and Architecture

            • HTTP server

            • J2EE containers

            • Gateway to the J2EE APIs

            • Web Services

            • J2EE Connector Architecture

            • CORBA support

            • Security services

            • Clustering services

            • Management and monitoring tools

            • Understanding WebLogic™s Role in the Enterprise

            • Is WebLogic Right for Your Project?

            • Summary

            • Chapter 2: Assembling and Managing a WebLogic Development Team

              • What WebLogic Developers Need to Know

                • Object-oriented programming in Java

                • J2EE

                • Object-Oriented Analysis and Design

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan