deploying java ee applications n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Deploying Java EE Applications PowerPoint Presentation
Download Presentation
Deploying Java EE Applications

Loading in 2 Seconds...

play fullscreen
1 / 38

Deploying Java EE Applications - PowerPoint PPT Presentation


  • 122 Views
  • Uploaded on

Deploying Java EE Applications. Objectives. After completing this lesson, you should be able to do the following: Describe deployment archive files Develop deployment descriptors for Java EE components Describe Oracle Application Server Containers for Java EE (OC4J) architecture

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Deploying Java EE Applications' - neorah


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
objectives
Objectives
  • After completing this lesson, you should be able to do the following:
    • Describe deployment archive files
    • Develop deployment descriptors for Java EE components
    • Describe Oracle Application Server Containers for Java EE (OC4J) architecture
    • Deploy Java EE applications to Oracle Application Server 10g
java ee server
Java EE Server
  • The Java EE server provides:
    • Containers for each component type of a Java EE application
    • System-level services to components:
      • Naming and directory services (JNDI)
      • Security services for Web components and Enterprise JavaBeans (JAAS)
      • Transaction architecture (JTA)
      • Remote client connectivity:
        • Enterprise beans (RMI/IIOP, ORMI)
        • Servlet/JSP (HTTP, HTTPS, FTP)
java ee application assembly and deployment
Java EE Application Assembly and Deployment
  • A Java EE application is packaged into one or more standard units for deployment to any Java EE platform–compliant system. Each unit contains:
    • A functional component or components (EJB, JSP, servlet, and so on)
    • An optional deployment descriptor that describes its content
planning the deployment process
Planning the Deployment Process
  • The deployment process includes:
    • Packaging code as Java EE applications or modules
    • Selecting a parent application
    • Binding the Web application to a Web site
    • Creating and applying a deployment plan
    • Deploying the application or module

Deploy

Parent

1

2

3

4

5

EAR file

Select parentapplication

Bind to URL

Deploymentplan

Deployedenvironment

deployment containers
Deployment Containers
  • A deployment module is a packaging structure for components that ultimately execute in a run-time container.
    • EJB
    • Web
    • Application Container
packaging java ee application components
Packaging Java EE Application Components

1. webtier.war

Java servlets, JSP files, HTML, GIF files, and a Web application deployment descriptor

2. JavaEEappClient.jar

Java EE application client (Java class), andan application client deployment descriptor

Java EE application.ear

3. Resource adapter (.rar)Java interfaces, classes, native librariesand other documentation, and the resource adapter deployment descriptor

4. ejb.jar

Class files for enterprise beans and an EJB deployment descriptor

slide8
JARs
  • Java Archives (JARs):
    • Are simple Java archive files
    • Are used to package application files together (classes, images, and so on)
    • Can be included in Web Archives (WARs) and Enterprise Archives (EARs)
    • Can be included in library paths
slide9
WARs
  • Web Archives (WARs):
    • Are specialized archives for packagingJava EE–compliant Web applications
    • Have a fixed directory structure
    • Have a deployment descriptor for the Web application

WEB-INF

web.xml

Contain servlet code and JavaBeans not in standard JAR files

classes

lib

Contains required classes that are packaged in standard JAR files

index.html

welcome.jsp

ejb jars
EJB JARs
  • EJB JARs:
    • Are specialized JARs for packaging EJBs
    • Have a fixed directory structure
    • Have a deployment descriptor for the EJB components

myEJB

META-INF

ejb-jar.xml

Contain the class files for the EJBs, usually in a package directory structure

EJB Classes

Remote, Home, and

Bean classes

the ejb deployment process
The EJB Deployment Process

Developer’sresponsibility

Home interface

Remote interface

Bean class

Other classes

Component deployer’s responsibility

Deployment

descriptor

EJB

JAR

Deployment

tools/

commands

JAR command/

tool

Deployed EJB in the server

JNDI

slide12
EARs
  • EAR files:
    • Are specialized archives for packaging Java EE-compliant enterprise applications for deployment
    • Have a deployment descriptor
    • May have Web modules
    • May have EJB modules
    • May have client modules
ear file structure for a java ee application example
EAR File Structure for a Java EE Application: Example

<appname>

META-INF

application.xml

<ejb_module>

EJB classes

META-INF

ejb-jar.xml

<web_module>

index.html

JSPs

WEB-INF

web.xml

classes

Servlet classes

<client_module>

Client classes

META-INF

application-client.xml

working with deployment descriptors
Working with Deployment Descriptors
  • Deployment descriptors are:
    • Added to the application archive in the META-INF directory relative to the archive root
    • Used to customize application-specific configuration and specify deployment information
    • Merged with deployment plans, if provided
jsr 88 deployment plans
JSR-88 Deployment Plans
  • Deployment plans are:
    • Used to create a client-side grouping of application configuration data needed to deploy the application to a Java EE container
    • Implemented for support of the JSR-88 specification, which defines creation of deployment plans
    • Created when you deploy the application
    • Saved in files that can be retrieved, edited, and reused
creating a jsr 88 deployment plan
Creating a JSR-88 Deployment Plan
  • Deployment plans are created:
    • By default (if none are supplied)
    • When the application is deployed by:
      • JDeveloperin the ConfigureApplication window
      • ApplicationServer Control
working with jsr 88 deployment plans
Working with JSR-88 Deployment Plans
  • The deployment plan provides many properties that enable the fine-tuning of application deployment to the target Java EE container. The deployment plan:
    • Includes properties
      • defaultDataSource to select the data source used by the application for management of data by EJB entities
      • prependDeploymentName to specify that the EAR file is prepended with an underscore(_) after deployment
    • Can be saved for reuse
    • Can be reloaded and edited when deploying an application
oracle application server containers for java ee oc4j
Oracle Application Server Containers for Java EE (OC4J)
  • OC4J is the Java EE server implementation in Oracle Application Server 10g.
  • Key features:
    • Implements Java EE 1.4 Specification
    • Runs on standard JVM
    • Provides high performance and scalability
    • Is productive for developers to use
    • Is simple to manage and deploy
    • Provides clustering for high availability and failover
oc4j architecture
OC4J Architecture

Oracle HTTPServer

AJP13

Webcontainer

JNDI

HTTP

JMS

AJP

mod_oc4j

JDBC

JTA

Client

JAAS

EJB

container

ORMI

JCA

JavaMail

ORMI

JAF

EJB client

OC4J server process

oc4j server configuration files
OC4J Server Configuration Files

OC4J server XML files

Server configuration

server.xml

Web site

Web site

Web site

jazn.xml

default-web-site.xml

jazn-data.xml

data-sources.xml

rmi.xml

jms.xml

Oracle HTTP Server configuration files

mod_oc4j.conf

relation of configuration files
Relation of Configuration Files

<application name="lesson18" path="../applications/lesson18.ear" />

<application name="lesson18" path="../applications/lesson18.ear" />

<web-app application="lesson18" name="webapp1" root="/lesson18"/>

<web><web-uri>webapp1.war</web-uri></web>

application logging
Application Logging
  • Application logging in Oracle Application Server 10g is configured by specifying the location of a log file in the orion-application.xml file:
  • To create a log file formatted in XML, use Oracle Diagnostic Logging (ODL):

<log>

<file path="practice18-oc4j-app.log"/>

</log>

<log>

<odl path="practice18-oc4j-app.log"/>

</log>

data sources
Data Sources
  • Data sources provide logical database mappings:
    • Developer uses the logical representation of a database.
    • Deployer maps to the physical data sources.
  • Java EE applications use published DataSource objects by:
    • Looking up the published name via Java Naming and Directory Interface (JNDI)
    • Using JDBC Connection methods to connect to the database
  • Data sources are published in the JNDI tree.
  • They come in different varieties.
  • They are referenced in orion-application.xml.
data source definition
Data Source Definition
  • Global data sources are defined in the OC4J_HOME/config/data-sources.xml file.
    • You specify each data source by using an XML tag.
    • Attributes specify values for the data source.
  • Application-specific data sources: Use the <data-sources> tag in the orion-application.xml file.

OC4J_HOME/applications

myapp

application.xml

Points to

data-sources.xml

data sources xml example
data-sources.xml: Example

<data-source

class="com.evermind.sql.DriverManagerDataSource" connection-driver="oracle.jdbc.driver.OracleDriver"

name="OracleDS"

location="jdbc/OracleCoreDS"

xa-location="jdbc/xa/OracleDS"

ejb-location="jdbc/OracleDS"

min-connections="5"

max-connections="25"

username="oe"

password="oe"

url="jdbc:oracle:thin:@<host>:<port>:<SID>"

/>

deploying an application web tier
Deploying an Application: Web Tier
  • To deploy the Web-tier components of a Java Platform, Enterprise Edition (Java EE) application, perform the following steps:

1. Make sure that the ejb-ref or ejb-local-ref elements exist in the web.xml file.

2. Create a WAR deployment profile (.deploy) in JDeveloper.

3. Right-click the .deploy file and select either of the following:

      • Deploy to WAR file
      • Deploy to OracleAS10g (where OracleAS10g is the name of your application server connection)
deploying an application ejb tier
Deploying an Application: EJB Tier

1. Make sure that the ejb-jar.xml file contains unique mappings for each EJB in the application.

2. Create a JAR deployment profile (.deploy) in JDeveloper.

3. Right-click the .deploy file and select either of the following:

  • Deploy to JAR file
  • Deploy to OracleAS 10g
deploying an application ear file
Deploying an Application: EAR File

1. Create an EAR deployment profile in JDeveloper.

2. Specify the EJB JAR and WAR files that are to be included in this EAR file.

3. Right-click the .deploy file and select either of the following:

  • Deploy to EAR file
  • Deploy to OracleAS10g
java ee application deployment to oracle application server 10 g
Java EE Application Deployment to Oracle Application Server 10g
  • Deploying to OC4J can be done in multiple ways:
deploying with jsr 88 ant tasks
Deploying with JSR-88 Ant Tasks
  • Using JSR-88 Ant tasks, you can:
    • Deploy applications
    • Undeploy applications
    • Redeploy applications
    • Start and stop applications in OC4J containers (including those in a cluster)
summary
Summary
  • In this lesson, you should have learned how to:
    • Describe the Java EE server environment and how Java EE applications are deployed as modules
    • Create an Enterprise Archive, containing JAR, WAR, and deployment descriptor files
    • Define the process for deploying all the components of a Java EE application
    • Describe OC4J as the container for your application
    • Use data sources to connect to the database
practice overview deploying java ee applications
Practice Overview: Deploying Java EE Applications
  • This practice covers deploying the course application.