Enterprise Java v090401JavaEE EAR1 Java EE Enterprise Archive (EAR)

Slides:



Advertisements
Similar presentations
Apache Maven: J2EE Front to Back Jesse McConnell -
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Enterprise Java and Data Services Designing for Broadly Available Grid Data Access Services.
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
My First Building Block Presented By Tracy Engwirda 28 September, 2005.
Sapana Mehta (CS 6V81) Instructions for using Jboss User Manual.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
1 CS 483 Enterprise and Web Application Programming Week 4 Deploying Enterprise JavaBeans.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Current Topics in Programming Languages Lecture 15_1 George Koutsogiannakis SUMMER
J2EE Security and Enterprise Java Beans Mrunal G. Dhond Department of Computing and Information Sciences Master of Science, Final Defense February 26,
Objectives:1. Investigate the Web application deployment descriptor 2. Install and deploy Tomcat and struts 3. Design and deploy a struts application Struts.
Tomcat Configuration A Very, Very, Very Brief Overview.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Open source administration software for education research administration Lin-Long Shyu System Analyst Kuali Coeus Technical Team Indiana University
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Introduction to the JBoss Presented by: Hao Shi. Agenda Application Servers What is JBoss JBoss features Architecture of JBoss Installation and running.
OSGi.
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
IMS Technical Conference IMS Java Remote Database Services Kyle Charlet.
How to Deploy, Monitor and Manage Middle-Tier Applications Lars Ewe, Principal Product Manager Valerie K. Kane, Group Manager Oracle Corporation Session.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Tomcat Spencer Uresk. Notes This is a training NOT a presentation Please ask questions This is being recorded
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
Introduction to J2EE Architecture Portions by Kunal Mehta.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
TDDD05 EJB Lab (Part of slides reused from Mikhail’s) Lu Li
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Web Applications - Basics. Introduction to Web Web features Clent/Server HyperText Transfer Protocol HyperText Markup Language URL addresses Web server.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
Juggling Java EE with Enterprise Apache Maven Jesse McConnell -
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Migrating Desktop The graphical framework for running grid applications Bartek Palak Poznan Supercomputing and Networking Center The.
JBoss Overview J2EE Sig Presenter: Steve Davidson Stephen Davidson & Associates, INC.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Chapter 7 Using Custom Tag Libraries and the JSP Standard Tag Library.
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
Maven for building Java applications By Nalin De Zoysa
Enterprise Java v090125Dev Env Overview1 Enterprise Java ( ) Development Environment Overview.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Fall CIS 764 Database Systems Engineering L15: Deployment Deploy … to place or arrange for deliberate (intended) purpose.
17 Copyright © 2004, Oracle. All rights reserved. Deploying an ADF Application.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
17 Copyright © 2004, Oracle. All rights reserved. Integrating J2EE Components.
CS520 Web Programming Introduction to Maven Chengyu Sun California State University, Los Angeles.
Apache Geronimo Open Source J2EE Application Server Getting up to speed with Apache Geronimo - Copyright 2005 Tom McQueeney 1 Getting up to speed with.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Introduction to Advanced Java Programming
Test Driven Development
Introduction to J2EE Architecture
Enterprise Application Architecture
J2EE Application Development
Introduction to Enterprise JavaBean
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Objectives In this lesson you will learn about: Need for servlets
Enterprise Java Beans.
Presentation transcript:

Enterprise Java v090401JavaEE EAR1 Java EE Enterprise Archive (EAR)

Enterprise Java v090401JavaEE EAR2 Goals Understand the purpose for an EAR Be able to construct an EAR for developed Java EE components

Enterprise Java v090401JavaEE EAR3 Objectives EAR Purpose EAR Format

Enterprise Java v090401JavaEE EAR4 Class Loaders Arranged in a parent/child relationship Requests for a class are first delegated to the parent class loader May access classes/resources loaded by local and parent class loader Do not have access to classes/resources loaded by sibling class loaders Parent Class Loader Child Class Loader

Enterprise Java v090401JavaEE EAR5 Application Server Class Loader EJB App Class Loader Web App Class Loader Web App Class Loader Separate EJB/WAR Deployment Classes loaded by EJB Application Class Loader not seen by Web Application Shared implementations must be placed in both applications –WEB-INF/lib –causes difficulty when passing object between applications that have loaded the same class

Enterprise Java v090401JavaEE EAR6 J2EE Enterprise Application Deployment Application Server Class Loader EAR Class Loader EJB App Class Loader EAR Class Loader Web App 2 Class Loader Web App 1 Class Loader Servlets/JSPs and lib.jars loaded by isolated classloaders All EJBs are loaded by a single class loader may also include web dependent classes identified through manifest entries to promote singleton loading of classes across web applications EJB interfaces and dependent classes identified by EJB manifests loaded by EAR’s classloader

Enterprise Java v090401JavaEE EAR7 Enterprise Application Archive (EAR) WAR(s) –directory or archive EJB(s) –directory or archive Client JAR(s) –client applications Utility Classes(s) –directory or archive –supplies external source utility classes –referenced through MANIFESTs Resource Adapters(s) –custom resource drivers WAR EJB EAR META-INF/application.xml Utility Classes Resource Adapter Resource Adapter Resource Adapter Client App Client App Client App Utility Classes Utility Classes

Enterprise Java v090401JavaEE EAR8 Directory and Archive Forms Exploded Directory Form –ability to modify static files (html/jsp) without redeploying –separate server serves up content in exploded form –simpler build environment consistent with build environment of free versions of IDEs (Forte, JBuilder, etc.) Archive File Format – easy form of distribution

Enterprise Java v090401JavaEE EAR9 application icon small-iconlarge-icon display-namedescription?module+security-role* ejb|connector|java|webalt-dd web-uricontext-root description? role-name application.xml

Enterprise Java v090401JavaEE EAR10 Element Definitions Application –Declares the overall enterprise application Deployment Tool Info –icon, display-name, description Modules –ejb – EJBs (Ex. EJB1.jar) –web – web applications –java - client applications –connector – JCA resource adapters

Enterprise Java v090401JavaEE EAR11 Element Definitions (Cont) Web applications –web-uri (ex. webapp1.war) –context-root Name of web app’s context May be empty if only one webapp in the application alt-dd –Can override the deployment descriptor found in the module security-role –Define application-level security roles

Enterprise Java v090401JavaEE EAR12 application.xml Example <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" " ejbsessionBankEAR Example Session Bean Bank Application ejbsessionBankWAR.war /ejbsessionBankWAR ejbsessionBankEJB SNAPSHOT.jar

Enterprise Java v090401JavaEE EAR13 Example Project with EAR ejbsessionBank> jar tf ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear META-INF/ META-INF/MANIFEST.MF ejbsessionBankImpl SNAPSHOT.jar ejbsessionBankWAR.war ejbsessionBankEJB SNAPSHOT.jar META-INF/application.xml EJB META-INF/MANIFEST.MF Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: StaffordJ Build-Jdk: 1.5.0_17 Class-Path: commons-logging jar ejbsessionBankImpl SNAPSHOT.jar

Enterprise Java v090401JavaEE EAR14 Example Project with EAR: source tree ejbsessionBank> tree. |-- ejbsessionBankImpl... |-- ejbsessionBankEAR | |-- pom.xml |-- ejbsessionBankEJB... |-- ejbsessionBankTest... |-- ejbsessionBankWAR... |-- pom.xml

Enterprise Java v090401JavaEE EAR15 Example Project with EAR: root pom.xml ejava.javaee.ejb ejbsessionBank pom Session Bean 1.0-SNAPSHOT This project is the root project for the core session bean example. ejbsessionBankImpl ejbsessionBankEJB ejbsessionBankWAR ejbsessionBankEAR ejbsessionBankTest

Enterprise Java v090401JavaEE EAR16 Example Project with EAR: ear pom.xml ejava.javaee.ejb ejbsessionBankEAR ear Session Bank EAR 1.0-SNAPSHOT ${pom.groupId} ejbsessionBankEJB ${pom.version} ejb ${pom.groupId} ejbsessionBankWAR ${pom.version} war

Enterprise Java v090401JavaEE EAR17 Example Project with EAR: excluding unwanted dependencies ${pom.groupId} ejbsessionBankEJB ${pom.version} ejb commons-logging

Enterprise Java v090401JavaEE EAR18 Example Project with EAR: ear plugin org.apache.maven.plugins maven-ear-plugin Example Session Bean Bank Application ${pom.groupId} ejbsessionBankWAR ejbsessionbank

Enterprise Java v090401JavaEE EAR19 Example EAR Project: build output > tree. |-- pom.xml `-- target |-- application.xml |-- ejbsessionBankEAR SNAPSHOT | |-- META-INF | | `-- application.xml | |-- ejbsessionBankImpl SNAPSHOT.jar | |-- ejbsessionBankEJB SNAPSHOT.jar | `-- ejbsessionBankWAR SNAPSHOT.war `-- ejbsessionBankEAR SNAPSHOT.ear

Enterprise Java v090401JavaEE EAR20 Example EAR Project: deploying EAR with cargo (Test/pom.xml) org.codehaus.cargo cargo-maven2-plugin jboss4x remote...

Enterprise Java v090401JavaEE EAR21 Example EAR Project: deploying EAR with cargo (Test/pom.xml) deploy-component test-compile undeploy deploy runtime ${jboss.user} ${jboss.password}...

Enterprise Java v090401JavaEE EAR22 Example EAR Project: deploying EAR with cargo (Test/pom.xml)... remote ${pom.groupId} ejbsessionBankEAR ear

Enterprise Java v090401JavaEE EAR23 Example EAR Project: deploying EAR with cargo (Test project output) Test output [INFO] Building Session Bank Test [INFO] task-segment: [install] [INFO] [INFO] [cargo:undeploy {execution: deploy-component}] [INFO] [cargo:deploy {execution: deploy-component}] Server Console 23:38:50,173 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/home/jcstaff/proj/ejava- javaee/working/ejbsessionBank/ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear 23:38:50,174 INFO [EARDeployer] Undeployed J2EE application: file:/home/jcstaff/proj/ejava- javaee/working/ejbsessionBank/ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear 23:38:50,272 INFO [EARDeployer] Init J2EE application: file:/home/jcstaff/proj/ejava- javaee/working/ejbsessionBank/ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear

Enterprise Java v090401JavaEE EAR24 Example EAR Project: undeploying EAR with cargo (EAR/pom.xml) org.codehaus.cargo cargo-maven2-plugin jboss4x remote undeploy-ear pre-clean undeploy runtime...

Enterprise Java v090401JavaEE EAR25 Example EAR Project: undeploying EAR with cargo (EAR/pom.xml)... ${jboss.user} ${jboss.password} remote ${pom.groupId} ${pom.artifactId} ear

Enterprise Java v090401JavaEE EAR26 Example EAR Project: undeploying EAR with cargo (EAR project output) Build output > mvn clean -Pundeploy... [INFO] Building Session Bank EAR [INFO] task-segment: [clean] [INFO] [INFO] [cargo:undeploy {execution: undeploy-ear}] [INFO] [clean:clean]... Server console 23:48:58,499 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/home/jcstaff/proj/ejava- javaee/working/ejbsessionBank/ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear 23:48:58,500 INFO [EARDeployer] Undeployed J2EE application: file:/home/jcstaff/proj/ejava- javaee/working/ejbsessionBank/ejbsessionBankEAR/target/ejbsessionBankEAR SNAPSHOT.ear

Enterprise Java v090401JavaEE EAR27 Summary EARs provide a standard deployment package to the application server Application server class loader(s) are designed to provide efficient sharing of resources defined within the EAR EAR is a deployment package, cannot be unit tested –requires deployment –requires functional testing that incorporates application server