Sun Java logo     Copyright      Index      Next     

Sun logo
Sun Java System Application Server Platform Edition 8 Developer's Guide 

Contents


About This Guide
Who Should Use This Guide
Using the Documentation
How This Guide Is Organized
Related Information
Documentation Conventions
General Conventions
Conventions Referring to Directories
Contacting Sun
Give Us Feedback
Obtain Training
Contact Product Support

Part I Developing Applications

Chapter 1   Setting Up a Development Environment
Installing and Preparing the Server for Development
Development Tools
The asadmin Command
The Administration Console
Apache Ant
deploytool
Migration Tools
Debugging Tools
Profiling Tools
Sample Applications

Chapter 2   Securing J2EE Applications
Sun Java System Application Server Security Goals
Sun Java System Application Server Specific Security Features
Sun Java System Application Server Security Model
Web Application and URL Authorizations
Invocation of Enterprise Bean Methods
ACC Client Invocation of Enterprise Bean Methods
Security Responsibilities Overview
Application Developer
Application Assembler
Application Deployer
Common Security Terminology
Authentication
Authorization
Realms
Role Mapping
Container Security
Programmatic Security
Declarative Security
Application Level Security
Component Level Security
Guide to Security Information
User Information
Security Roles
Realm Configuration
How to Configure a Realm and Set the Default Realm
Using the Administration Console
Using the asadmin Command
Editing the domain.xml File
How to Set a Realm for an Application or Module
Supported Realms
file
ldap
certificate
solaris
Creating a Custom Realm
JACC Support
Using the Administration Console
Editing the domain.xml File
Pluggable Audit Module Support
Configuring an Audit Module
Using the Administration Console
Using the asadmin Command
Editing the domain.xml File
The AuditModule Class
The server.policy File
Default Permissions
Changing Permissions for an Application
Programmatic Login
Precautions
Granting Programmatic Login Permission
The ProgrammaticLogin Class
User Authentication for Single Sign-on
Defining Roles
Authenticating an Application Client Using the JAAS Module

Chapter 3   Assembling and Deploying J2EE Applications
Overview of Assembly and Deployment
Modules
Applications
J2EE Standard Descriptors
Sun Java System Application Server Descriptors
Naming Standards
Directory Structure
Runtime Environments
Module Runtime Environment
Application Runtime Environment
Classloaders
The Classloader Hierarchy
Classloader Universes
Circumventing Classloader Isolation
Assembling Modules and Applications
Tools for Assembly
deploytool
Apache Ant
The Deployment Descriptor Verifier
Assembling a WAR Module
Assembling an EJB JAR Module
Assembling a Lifecycle Module
Assembling an Application
Assembling an ACC Client
Assembling a J2EE CA Resource Adapter
Deploying Modules and Applications
Deployment Errors
The Deployment Life Cycle
Dynamic Deployment
Disabling a Deployed Application or Module
Dynamic Reloading
Automatic Deployment
Tools for Deployment
Apache Ant
The deploytool
JSR 88
The FastJavac Compiler
The asadmin Command
The Administration Console
Deployment by Module or Application
Deploying a WAR Module
Deploying an EJB JAR Module
Deploying a Lifecycle Module
The asadmin Command
The Administration Console
Deploying an Application Client
Deploying a J2EE CA Resource Adapter
Access to Shared Frameworks
Apache Ant Assembly and Deployment Tool
Ant Tasks for Sun Java System Application Server 8
sun-appserv-deploy
sun-appserv-undeploy
sun-appserv-component
sun-appserv-admin
sun-appserv-jspc
sun-appserv-update
Reusable Subelements
component
fileset

Chapter 4   Debugging J2EE Applications
Enabling Debugging
Using the Administration Console
Editing the domain.xml File
JPDA Options
Generating a Stack Trace for Debugging
The Java Debugger
Using the Sun ONE Studio IDE for Debugging
Using the NetBeans IDE for Debugging
Using the JBuilder IDE for Debugging
Sun Java System Message Queue Debugging
Enabling Verbose Mode
Using the Administration Console
Editing the domain.xml File
Logging
Profiling
The HPROF Profiler
The Optimizeit Profiler

Chapter 5   Deployment Descriptor Files
Sun Java System Application Server Descriptors
The sun-application.xml File
sun-application
web
web-uri
context-root
pass-by-reference
unique-id
security-role-mapping
role-name
principal-name
group-name
realm
Sample sun-application.xml File
The sun-web.xml File
General Elements
sun-web-app
property
description
context-root
Security Elements
security-role-mapping
servlet
servlet-name
role-name
principal-name
group-name
Session Elements
session-config
session-manager
manager-properties
store-properties
session-properties
cookie-properties
Reference Elements
resource-env-ref
resource-env-ref-name
resource-ref
res-ref-name
default-resource-principal
name
password
ejb-ref
ejb-ref-name
message-destination
message-destination-name
jndi-name
Caching Elements
cache
cache-helper
default-helper
cache-mapping
url-pattern
cache-helper-ref
timeout
refresh-field
http-method
key-field
constraint-field
value
Classloader Elements
class-loader
JSP Elements
jsp-config
Internationalization Elements
locale-charset-info
locale-charset-map
parameter-encoding
Sample sun-web.xml File
The sun-ejb-jar.xml File
General Elements
description
ejb
ejb-name
enterprise-beans
is-read-only-bean
name
property
refresh-period-in-seconds
sun-ejb-jar
unique-id
value
Role Mapping Elements
group-name
principal
principal-name
role-name
security-role-mapping
server-name
Reference Elements
ejb-ref
ejb-ref-name
jndi-name
pass-by-reference
res-ref-name
resource-env-ref
resource-env-ref-name
resource-ref
message-destination
message-destination-name
Messaging Elements
activation-config
activation-config-property
activation-config-property-name
activation-config-property-value
jms-durable-subscription-name
jms-max-messages-load
mdb-connection-factory
mdb-resource-adapter
resource-adapter-mid
Security Elements
as-context
auth-method
caller-propagation
confidentiality
default-resource-principal
establish-trust-in-client
establish-trust-in-target
integrity
ior-security-config
name
password
realm
required
sas-context
transport-config
Persistence Elements
cmp
cmp-resource
create-tables-at-deploy
database-vendor-name
drop-tables-at-undeploy
finder
is-one-one-cmp
mapping-properties
method-name
one-one-finders
pm-class-generator
pm-config
pm-descriptor
pm-descriptors
pm-identifier
pm-inuse
pm-mapping-factory
pm-version
query-filter
query-ordering
query-params
query-variables
schema-generator-properties
Pooling and Caching Elements
bean-cache
bean-pool
cache-idle-timeout-in-seconds
cmt-timeout-in-seconds
commit-option
is-cache-overflow-allowed
max-cache-size
max-pool-size
max-wait-time-in-millis
pool-idle-timeout-in-seconds
removal-timeout-in-seconds
resize-quantity
steady-pool-size
victim-selection-policy
Class Elements
gen-classes
local-home-impl
local-impl
remote-home-impl
remote-impl
Sample sun-ejb-jar.xml File
The sun-cmp-mappings.xml File
check-all-at-commit
check-modified-at-commit
cmp-field-mapping
cmr-field-mapping
cmr-field-name
column-name
column-pair
consistency
ejb-name
entity-mapping
fetched-with
field-name
level
lock-when-loaded
lock-when-modified
named-group
none
read-only
schema
secondary-table
sun-cmp-mapping
sun-cmp-mappings
table-name
Sample Database Schema Definition
Sample sun-cmp-mappings.xml File
The sun-application-client.xml file
sun-application-client
resource-ref
res-ref-name
default-resource-principal
name
password
ejb-ref
ejb-ref-name
resource-env-ref
resource-env-ref-name
message-destination
message-destination-name
jndi-name
The sun-acc.xml File
client-container
target-server
description
client-credential
log-service
security
ssl
cert-db
auth-realm
property
Web Service Elements
webservice-description
webservice-description-name
wsdl-publish-location
service-ref
service-ref-name
port-info
service-endpoint-interface
wsdl-port
namespaceURI
localpart
stub-property
call-property
name
value
wsdl-override
service-impl-class
service-qname
webservice-endpoint
port-component-name
endpoint-address-uri
login-config
auth-method
transport-guarantee
tie-class
servlet-impl-class

Part II Developing Application Components

Chapter 6   Developing Web Applications
Introducing Web Applications
Internationalization Issues
The Server
Servlets
Virtual Servers
Using the Administration Console
Editing the domain.xml File
Default Web Modules
Configuring Logging in the Web Container
Using Servlets
Handling Threading Issues
Invoking a Servlet with a URL
Servlet Output
Using the Administration Console
Editing the domain.xml File
Caching Servlet Results
Caching Features
Default Cache Configuration
Caching Example
CacheHelper Interface
CacheKeyGenerator Interface
About the Servlet Engine
Instantiating and Removing Servlets
Request Handling
Allocating Servlet Engine Resources
Using JavaServer Pages
JSP Tag Libraries and Standard Portable Tags
JSP Caching
cache
flush
Compiling JSPs: The Command-Line Compiler
Creating and Managing User Sessions
Configuring Sessions
Session Managers
The memory Persistence Type
The file Persistence Type

Chapter 7   Using Enterprise JavaBeans Technology
Summary of EJB 2.1 Changes
Value Added Features
Read-Only Beans
pass-by-reference
Pooling and Caching
Pooling Parameters
Caching Parameters
Bean-Level Container-Managed Transaction Timeouts
EJB Timer Service
Using Session Beans
About the Session Bean Containers
Stateless Container
Stateful Container
Restrictions and Optimizations
Optimizing Session Bean Performance
Restricting Transactions
Using Read-Only Beans
Read-Only Bean Characteristics and Life Cycle
Read-Only Bean Good Practices
Refreshing Read-Only Beans
Invoking a Transactional Method
Refreshing Periodically
Refreshing Programmatically
Deploying Read Only Beans
Using Message-Driven Beans
Message-Driven Bean Configuration
Connection Factory and Destination
Message-Driven Bean Pool
Domain-Level Settings
Automatic Reconnection to JMS Provider
Restrictions and Optimizations
Pool Tuning and Monitoring
onMessage Runtime Exception
Sample Message-Driven Bean XML Files
Sample ejb-jar.xml File
Sample sun-ejb-jar.xml File
Handling Transactions with Enterprise Beans
Flat Transactions
Global and Local Transactions
Commit Options
Administration and Monitoring

Chapter 8   Using Container-Managed Persistence for Entity Beans
Sun Java System Application Server Support
Container-Managed Persistence Mapping
The Mapping Deployment Descriptor File
Mapping Capabilities
Automatic Mapping Options
Supported Data Types for Mapping
BLOB Support
CLOB Support
Capturing the Database Schema Automatically
Using the capture-schema Utility
Configuring the Resource Manager
Configuring Queries for 1.1 Finders
About JDOQL Queries
Query Filter Expression
Query Parameters
Query Variables
Restrictions and Optimizations
Eager Loading of Field State
Restrictions on Remote Interfaces
Sybase Finder Limitation
Date and Time Fields as CMP Field Types

Chapter 9   Developing Java Clients
Introducing the Application Client Container
Developing Clients Using the ACC
Using an Application Client to Access an EJB Component
Using an Application Client to Access a JMS Resource
Authenticating an Application Client
Running an Application Client Using the ACC
Packaging an Application Client Using the ACC
Editing the Configuration File
Editing the appclient Script
Editing the sun-acc.xml File
Setting Security Options
Using the package-appclient Script
Developing Clients Without the ACC
Using a Stand-Alone Client to Access an EJB Component
Using a Stand-Alone Client to Access a JMS Resource
Authenticating a Stand-Alone Client
Configuring the ORB
ORB Support Architecture
Configuring Load-Balancing for EJB Client Applications
Third Party ORB Support
Installing Orbix
Configuring Sun Java System Application Server to Use Orbix
Overriding the Built-in ORB

Chapter 10   Developing Lifecycle Listeners
Server Life Cycle Events
The LifecycleListener Interface
The LifecycleEvent Class
The Server Lifecycle Event Context
Assembling and Deploying a Lifecycle Module
Considerations for Lifecycle Modules

Part III Using Services and APIs

Chapter 11   Using the JDBC API for Database Access
General Steps for Creating a JDBC Resource
Integrating the JDBC Driver
Supported Database Drivers
Making the JDBC Driver JAR Files Accessible
Creating a Connection Pool
Using the Administration Console
Using the Command Line Interface
Testing a Connection Pool
Creating a JDBC Resource
Using the Administration Console
Using the Command Line Interface
Configurations for Specific JDBC Drivers
PointBase Type4 Driver
IBM DB2 8.1 Type2 Driver
Inet Oraxo JDBC Driver for Oracle 8.1.7 and 9.x Databases
Inet Merlia JDBC Driver for Microsoft SQL Server Databases
Inet Sybelux JDBC Driver for Sybase Databases
Data Direct Connect JDBC3.0/ Type4 Driver for IBM DB2 Databases
Oracle Thin/Type4 Driver for Oracle 8.1.7 and 9.x Databases
OCI Oracle Type2 Driver for Oracle 8.1.7 and 9.x Databases
Data Direct Connect JDBC3.0/ Type4 Driver for Oracle 8.1.7 and 9.x Databases
Data Direct Connect JDBC3.0/ Type4 Driver for Microsoft SQL Server Databases
Sybase JConnect/Type4 Driver
Data Direct Connect JDBC3.0/ Type4 Driver for Sybase Databases
Data Direct Connect JDBC3.0/ Type4 Driver for Informix Databases
IBM Informix Type4 Driver
MM MySQL Type4 Driver
CloudScape 5.1 Type4 Driver
Creating Applications That Use the JDBC API
Sharing Connections
Using JDBC Transaction Isolation Levels

Chapter 12   Using the Transaction Service
Transaction Resource Managers
Transaction Scope
Configuring the Transaction Service
Using the Administration Console
Using the Command Line Interface
Transaction Logging

Chapter 13   Using the Java Naming and Directory Interface
Accessing the Naming Context
Naming Environment for J2EE Application Components
Accessing EJB Components Using the CosNaming Naming Context
Accessing EJB Components in a Remote Application Server
Naming Environment for Lifecycle Modules
Configuring Resources
External JNDI Resources
Using the Administration Console
Using the Command Line Interface
Custom Resources
Using the Administration Console
Using the Command Line Interface
Mapping References

Chapter 14   Using the Java Message Service
The JMS Provider
Administration of the JMS Service
Configuring the JMS Service
Using the Administration Console
Using the Command Line Interface
Checking Whether the JMS Provider Is Running
Creating Physical Destinations
Using the Administration Console
Using the Command Line Interface
Creating JMS Resources: Destinations and Connection Factories
Using the Administration Console
Using the Command Line Interface
Message Queue Resource Adapter
ConnectionFactory Authentication
Message Queue varhome Directory
Delivering SOAP Messages Using the JMS API
Sending SOAP Messages Using the JMS API
Receiving SOAP Messages Using the JMS API

Chapter 15   Using the JavaMail API
Introducing JavaMail
Creating a JavaMail Session
Using the Administration Console
Using the Command Line Interface
JavaMail Session Properties
Looking Up a JavaMail Session
Sending Messages Using JavaMail
Reading Messages Using JavaMail

Index


Copyright      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.