Sie sind auf Seite 1von 40

Successful J2EE

Deployment
George Trujillo
Trubix / IOUG

Tugdual Grall
Oracle

Oracle Fusion Middleware


Integrated, Standards-Driven Technology
Platform

Infrastructure for Fusion Architecture

Standard J2EE Java Environment

Application Development Framework and Tools

Business Process Design and Management

Enterprise Portal and Collaborative Workplace

Identity Management and Security

Enterprise Systems and Service Management

Mobile/Wireless

GRID infrastructure

Agenda
J2EE Overview
Application Life Cycle

Design
Development / Testing
Deployment
Administer

Application Layers Mapped to


J2EE Tiers and Technology
J2EE helps developers build layered
applications, each providing different services
J2EE Technology

Application Layer

J2EE Tier

Presentation

Web Tier

HTML, JSP

Control

Web Tier

Servlets

Business Logic

Business Tier

Java Objects, Session Beans

Persistent Objects

Business Tier

Java Objects, Entity Beans

Web Application / JDBC


Pros

Simple to build
Simple to package and deploy
Low overhead from container
Relatively easy to test

Cons

Web Container

JSP + Servlet
UI
Business Logic
JDBC

Needs discipline to keep UI


and logic separate
No container transaction
support
Must code all database calls
DB

Web Application / Local EJB


Pros
Separation of business logic
Entity beans for persistence
No serialization or network
calls
Concurrency managed
Can convert to remote
interface and Web service
endpoint if required

Web + EJB Container

local

JSP + Servlet
UI
Session Bean - Logic
Entity Bean - Persistence

Cons
Uses EJB infrastructure
Harder to test business logic
behind local interfaces

DB

Web Application / Remote EJB


Web Container

Pros
Most flexible architecture
Can separate EJB container
to different server
Multi client enabled
Can be exposed as Web
service endpoint

Cons
Slower performance, remote
network calls and serialization
Can be difficult to configure
and debug

WebJSP
Container
+ Servlet

UI
remote

EJB Container

Session Bean - Logic


Entity Bean - Persistence

DB

Quotes

It works well and my machine !!!


Why it is slower on a my cluster???
I can not deploy your application!
Why my build is broken again?

J2EE Application Lifecycle


Test
Develop

Deploy

Administer
Design

J2EE Application Lifecycle


Test
Develop

Deploy

Administer
Design

Design
Good Design == Good Deployment

Design Phase Goals


Business Requirement
Performance and Scalability Requirements
Security

Tools/Methodologies
UML
Hurdon

Design: J2EE / Web Services


Do not reinvent the wheel !

Understand the different J2EE Components


Web Container
EJB Container
Infrastructure Services

JCA, JTA, JMS,


Web Services

Understand Oracle Application Server components


Look at Open Source project too
Use Proven Design Patterns
Involve System and Database administrators

J2EE Application Lifecycle


Test
Develop

Deploy

Administer
Design

Development
Define standards for your team
Coding standard
Tooling
Process

Use a source control


JDeveloper integrated with CVS and Subversion

Automated testing and Build processes


Ant, JUnit

Develop: Presentation Layer


Model View Controller approach
Standard Based when possible
JavaServer Faces
Apache Struts (de-facto standard)

Develop: Business Layer


Should be a reusable Service
Use J2EE / Standard components
Session Bean (EJB)
Web Service
Limit Remote Calls
Local invocation of EJB should be the default

Develop: Persistence Layer


Data sources are heterogonous
RDBMS, XML, Web Services, 3rd Party Applications

Use J2EE Services to access these data


Connection Pooling
Transaction Management
J2EE Connector Architecture (JCA/J2CA)
Java API for XML (JAX-*)
JAX-RPC, JAX-P, JAX-B, .

Develop: O/R Requirements


DB Dev & DBA

Adhere to rules of database


Build the J2EE application but
do NOT expect to change
schema
Build the J2EE application but
the schema might change
Be able to profile all SQL calls
to database
Let DBA influence/change
database calls/SQL generated
to optimize
Leverage database features
where appropriate (outer joins,
sub queries, specialized
database functions)

J2EE Developer

Want to work with objects/beans


Data model should not constrain
object model
Dont want database code in
object/component code
Accessing data should be fast
Minimize calls to database
they are expensive
Object-based queries not SQL
Isolate J2EE app from schema
changes
Notification of changes to data
occurring at database

OracleAS
Persistence
Leverage the Oracle RDBMS features inside your J2EE Applications
EJB 3.0
Simplify Development of EJBs using POJOS and Java Annotations
Based on Oracle Toplink
Oracle co-spec lead and author of the Reference Implementation

Oracle AS Toplink

Oracle Complex Types


FlashBack
Virtual Private Database
XML DB

ADF Business Components

Test: Prepare Your Success


Do not make your users the testers !
Test the application frequently and iteratively
Unit test components
Test your application at every milestone

Functionnality

Performance
Debug

Testing Solution
Automated Testing
Integrated to your IDE, and you Build process
Junit, testNG, custom code

Develop: Tools
Use and IDE such as JDeveloper

Modeling (UML, Database)


Help to develop J2EE and Web Services components
Debugger, Profiler (remotely and locally)
Integrated with source control software
Junit, Ant, Maven integration for easy testing and build
Java, XML, HTML, PL/SQL editors
Easy Deployment

Standards and Guidelines


It is important to develop consistent
standards, guidelines, documentation,
deployment and packaging methods.
Look at sources such as Java Blueprints and
the Oracle Technology Network for guidelines.
Understand how to leverage design patterns
and frameworks within your applications.

D E M O N S T R A T I O N

End to End Development with


Oracle JDeveloper

J2EE Application Lifecycle


Test
Develop

Deploy

Administer
Design

Packaging
Development teams need to understand how their software
components need to be packaged for the types of applications
they are building.
The choice of packaging will have an impact on how an
application will work and act in a distributed environment.
Packaging needs to consider:
The type of archive files to use.
The types of deployment descriptors for particular platforms.

Deployment profiles are created in a project when using


JDeveloper. Separate profiles are required for different
deployment targets. Verify that JDeveloper can find all the
necessary library files (i.e. Swing).
Be aware that different Java files (Applets, JSPs, Servlets, EJBs,
etc.) all reside in different locations.

Precompile your JavaServer Pages for better performance

Deployment Options
Make sure to clearly understand the deployment
options available in each deployment, test and
production environment
Use deployment Plan (new standard for J2EE 1.4)

If the build process is complex, tools like Ant and


JSR-88 may provide the flexibility and the cross
platform capability necessary.
JDeveloper and the Oracle Application Server provide
a lot of flexibility for deployment environments.

JSR-88: J2EE Deployment API


J2EE applications can be made portable across
vendor implementations
No standard existed for deployment of the portable
application
JSR-88 fills the void
Standard API and operations for deployment of applications
to J2EE containers
Vendor specific configuration abstracted from actual
deployment process

Expected to be an API consumed largely by tools


vendors

JSR-88 Capabilities

Deployment of all J2EE component types


Configuration of an application for deployment
Asynchronous deployment
Canceling of deployment and undeployment
operations
Progress notifications
Connected and disconnected usage
Optional support for re-deployment operations

Performing a Deployment
Deployment Tool
1

Display config elements


to deployer for entering

Get vendor specific config


External resources

Deployment
Progress &
Status

J2EE
Container

Generates deployment plan

+
Deployment Plan

ARCHIVE

Submits archive and


deployment plan for
deployment

D E M O N S T R A T I O N

J2EE Deployment with JSR-88


Application Server Control

Oracle JDeveloper

Deployment: Guidelines
Deployment is not only packaging the
components
This is also configuring:

Security Policy
Clustering policy
Load Balancing
Shared Libraries

This could be done using the Deployment


Plan and/or Oracle Application Server Control

J2EE Application Lifecycle


Test
Develop

Deploy

Administer
Design

Application Server Management

Component Management
Deploying and Maintaining J2EE Applications
J2EE Application Diagnostics
Clustering
Backup and Recovery
Port Management
Accessing Diagnostic Logs

Page Performance Analysis


Full URL processing call stack analysis
Tracing down to the SQL statement level
Tuning Recommendations

JSP

Servlet

EJB

internet

Processing time and Load


Slowest URLs and # of Hits
Top Servlets & JSPs by Requests & Processing Time
Application Performance Correlation

JDBC/SQL

J2EE Monitoring

Pre-defined thresholds
Alert notifications and response actions
Blackout periods
Performance baselines
Graphical performance charts
Historical data repository
Performance trends and comparisons

Application Server Historical Data


Trends and Comparisons
Whats the current CPU usage for server #1?
How did it do over the past 24 hours?
How does that compare to server #2 over the same
timeframe?

Topology View

D E M O N S T R A T I O N

Application Monitoring

QUESTIONS
ANSWERS

Das könnte Ihnen auch gefallen