DECOR’04
J2EE Deployment: The JOnAS Case Study
Grenoble, 2004 October 29th
François Exertier [email protected]
www.objectweb.org Plan
!J2EE and JOnAS
!J2EE Deployment and the JOnAS Use Case
!Issues and Future Work
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D2 - 29/11/2004 Introduction to J2EE and JOnAS
www.objectweb.org J2EE Architecture
Browser WEB Container http Servlets html JSPs JDBC JMS
JTA Applets rmi JCA DB rmi JAAS
EJBs JavaMail
rmi JNDI public static void EIS main(…) { … EJB Container
Client Container Java Application J2EE Application Server
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D4 - 29/11/2004 JOnAS: Enterprise Class J2EE Application Server !J2EE 1.4 Compliant (Sun Certification expected by the end of this year) !Scalability and Availability " Clustering (HTTP, RMI, DB), Failover (HTTP Sessions replication) " Optimization mechanisms (pooling, caching, …) !Enterprise Integration " Multi-tier Infrastructure " Apache, LDAP, DBMSs, J2EE CA connectors to ERPs, mainframes " Web Services !Integrated Development Environments " Eclipse & JBuilder plug-ins !Administration " Web Console, script commands, API (JMX, JSR77)
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D5 - 29/11/2004 Some References
! Linux Distributions " Mandrake 9.x " Red Hat EL 3 ! France Telecom " Development and production servers ! Thalès Information Systems " applications intranet ! German and Mexico Universities " OpenUSS Portal based on JOnAS ! French Ministers " Ministère de la justice " Ministère de l’intérieur ! Thalès Information Systems " Intranet applications ! JOnAS based softwares: bonita workflow, Liferay portal, Bull FlexStudio, Cotranet, ClipCard, Ilog Rules, … ! More on http://jonas.objectweb.org/success.html …
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D6 - 29/11/2004 JOnAS Features [1/2]
!J2EE "Web and EJB containers # EJB 2.1 support # Servlet/JSP support through Tomcat or Jetty "All J2EE services available: JDBC, JMS (JORAM, SwiftMQ, MQSeries), JavaMail, Transaction, Security (JAAS, JACC), … "Deployment (EAR, WAR, EJB-JAR, RAR / JSR88) #at JOnAS configuration time or at runtime (admin tools) "J2EE Connector architecture support "JMX/J2EE(JSR77) based Management + Web GUI (Struts) "Web services #AXIS integration #Web Services Endpoints and Clients deployment "Security #JAAS, JACC, Users/Roles repository (file, Db, LDAP), Certificates
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D7 - 29/11/2004 JOnAS Features [2/2]
!JOnAS Services "possibility to launch services required by a J2EE application "Most of the components of the JOnAS server are pre-defined JOnAS services (TM, JMS, JMX, ...) "User defined services !Enhanced configuration and deployment facilities "ejb-jars, wars, ears directories (autoload directories) "Deployment from the admin console or automatic "JONAS_BASE: possibility to define several application environments (for configuration and deployment) !Interoperability "IIOP, Web Services !Multi-protocol Support "RMI/JRMP, RMI/IIOP, JEREMIE, CMI
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D8 - 29/11/2004 JOnAS Architecture HTML Clients Appli.ear RMI Clients Apache
P
T
T
H
EJB Container WEB Container
EJBs JSPs Servlets on i ail JCA EAR EJB Database Messaging Security JavaM Transaction HooX Management Web Services Communicat Web Container DB JDBC Calls JORAM JOTM Tomcat / JORM AXIS CAROL/Jonathan Services Jetty / MEDOR
JOnAS J2EE Server GCOS
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D9 - 29/11/2004 J2EE Deployment and the JOnAS Use Case
www.objectweb.org J2EE Deployment [1/2]
!Deployable items "EJB-JAR modules: jar files containing EJB classes + xml deployment descriptors "WAR modules: jar files containing WEB applications, i.e. Servlets/JSPs, libs and xml deployment descriptors "RAR modules: EIS connector classes and xml deployment descriptors "EAR modules: jar files containing EJB-JARs, WARs, RARS, libs and xml deployment descriptors !Deployment Targets "A J2EE application server "A Cluster of J2EE application server "Multi-vendors J2EE application servers
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D11 - 29/11/2004 J2EE Deployment [2/2]
!Module Configuration "Application related configuration # Stored in standard J2EE deployment descriptor # Describe logical resources, component dependencies (application architecture), security and transactional rules, … # Independent of the application server vendor # Done by the “application assembler” "Runtime specific configuration # Stored in application server vendor specific deployment descriptor -> need one for each application server target #Describe runtime information: mapping of logical resources to actual resources available on the server (Database, Mail service, JMS resources, …), persistency mapping to a legacy Db, pooling configuration, … # Done by the “application deployer” www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D12 - 29/11/2004 JOnAS Deployment Steps
!Provide runtime configuration of modules "Specific Deployment Descriptors !Generate container classes (interceptors, stubs, …) through a specific tool (GenIC), taking as input configured modules, obtain a “ready to load” module !Put “ready to load” modules in the application server (auto) loading directories (or specify module location in the server configuration file) !Use the Management tool or command line to load modules
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D13 - 29/11/2004 J2EE 1.4 Deployment Specification Features !J2EE Deployment API Specification / JSR 88 "Clear separation between the J2EE platform and the tool used to deploy applications upon such a platform "Such tools may deploy any « generic » J2EE module (EAR, WAR, JAR, RAR) on any platform "The specified interface defines the following functions: # Application configuration (Deployment Descriptors fulfilling) # Application distribution (installation) on a Target (that may be a group of application servers) # Starting/Stopping an application # Un-deploying an application # Monitoring/Managing deployed modules # The DeploymentManager may be used in disconnected mode, in this case only for configuring modules # ProgressObject used for long lived operations for tracking and reporting their execution "Conversational protocol based on JavaBeans allows for the tool to present a GUI and to capture the platform specific deployment information
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D14 - 29/11/2004 DeploymentFactory
DeploymentManager
getTargets getAvailableModules Deployment Tool getRunningModules getNonRunningModules createConfiguration distribute start J2EEApplicationObject stop undeploy isRedeploySupported J2EEDeployableObject redeploy release getDConfigBeanVersion … Deployer ProgressObject (configure, distribute, DeploymentConfiguration start execution of J2EE applis) DConfigBean
DDBean DDBean Target T1
Target T2 JSR88 Driver
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D15 - 29/11/2004 Deployment Scenario
J2EE Module App Server JSR88 + createConfiguration (J2EE Module) classes Deployment Tool JSR88 API Std DD DeploymentConfiguration
Ejb name: *** Tx Att1: Standard Depl. Configured *** Info J2EE Module … *** Appli classes Db jndi: *** Pool Max: Runtime Config. Std DD *** … Info Rt DD *** load distribute (configured J2EE Module) Gen start()
classes Container classes Std DD Ready to load Rt DD J2EE Module www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D16 - 29/11/2004 JSR88 JOnAS Deployment
EJB Container WEB Container EJBs JSPs Servlets on i ail EAR EJB Database Messaging
EAR Security JavaM J2EE CA Transaction Management Web Services
EJB-JAR Communicat Web Container WAR RAR Services JOnAS J2EE Server
DeplConfig JSR88JSR88 Load «Driver»«Driver» (APIs)(APIs) GenIC Distribute Generate Configure Any JSR88 container Compliant www.objectweb.org Depl. Tool Ishmael DECOR’04 Conference / JOnAS J2EE Deployment - D17 - 29/11/2004 JOnAS Deployment Steps Revisited
!Module Configuration "Performed directly through an IDE or by editing deployment descriptors "Performed through a JSR88 deployment tool (that will allow configuration for other application server vendors) !Load (or “distribute”) configured modules "Using a JSR88 deployment tool or JOnAS loading facilities (load directories, server configuration, management tools) "If the provided module is not “ready to load” (container classes not generated), or contains container classes for a different version of JOnAS # JOnAS automatically generates container classes "Load the module
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D18 - 29/11/2004 Issues and Future Work
www.objectweb.org Short Term JOnAS Objectives
!Make JOnAS Management Tools rely on the JSR88 API for deploying (distribute) "Allow loading “naked” modules (i.e. without container classes) by transparently calling GenIC "Allow taking into account JOnAS versions, by automatically regenerating container classes when version conflicts occur !Implement start() stop() for applications !Provide multi-servers deployment "Relying on the J2EEDomain management and on the JSR88 target concept "Possibly making use of the ProgressObject to manage deployment completion issues !Implement a JSR88 Deployment Tool
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D20 - 29/11/2004 J2EE Deployment Model Shortcomings !Express dependencies between modules to be deployed "J2EE assumes that applications packaged as EARs are self- contained "However, a RAR may be deployed standalone and used by several EARS … !Express dependencies between applications and available resources "More and more resources are represented by deployable modules (RARs for DB, JMS, …) "For other resources, dependencies on corresponding services (Mail, EJB Container, Web container, Web Services) should be necessary #Provide JOnAS with dynamic services configuration capability !Distributed Applications deployment not addressed
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D21 - 29/11/2004 Potential Advanced Studies
!Apply a more generic Deployment Model like the Osmose/ObjectWeb Generic Deployment Framework "Mapping #J2EE Modules = GDF Units #J2EE Application = GDF Unit(s) #“Ready to load” J2EE modules = GDF Deployed Units #Deployed J2EE Module (available, running, non running) = (installed, active, stopped) GDF Unit #J2EE Target = GDF Site(s)/Organization "Dependencies may be expressed and specialized between Units/Sites with attributes (to express dependencies between J2EE Modules, but also with JOnAS services …) !Provide a J2EE mapping of the model defined in the OMG specification for Deployment and Configuration of Component-based Distributed Applications
www.objectweb.org DECOR’04 Conference / JOnAS J2EE Deployment - D22 - 29/11/2004 Q & A
www.objectweb.org Appendices
www.objectweb.org J2EE 1.4 Mgt Model
SessionBean EJEJBB SessionBean StatelessSessionBeanStatelessSessionBean EntityBean ResourceAdapterResourceAdapter EntityBean StatefulSessionBeanStatefulSessionBean MessageDrivenBean ServletServlet MessageDrivenBean
JDBCDatasourceJDBCDatasource J2EEModuleJ2EEModule EJEJBMoBModduleule
JDBCDriverJDBCDriver J2EJ2EEEAApppplicationlication WebModuleWebModule
J2EJ2EEEDDeployedObjecteployedObject JCAResourceJCAResource AppClientModuleAppClientModule J2EEManagedObjectJ2EEManagedObject JTJTAResAResourceource ObjectName: OBJECT_NAME J2EEServerJ2EEServer ResourceAdapterModuleResourceAdapterModule stateManageable: boolean statisticsProvider: boolean J2EJ2EEERResourceesource JDBCResourceJDBCResource eventProvider: boolean J2EJ2EEEDDomainomain JMSJMSRResesourceource
JCAManagedConnectionFactoryJCAManagedConnectionFactory JNDIJNDIResourceResource
JCAConnectionFactoryJCAConnectionFactory RMIIIOPResourceRMIIIOPResource
JVMJVM JavaMailResourceJavaMailResource
www.objectweb.org URLResourceURLResourceDECOR’04 Conference / JOnAS J2EE Deployment - D25 - 29/11/2004