Title: Apache Geronimo: Leveraging Open Source
1Apache Geronimo Leveraging Open Source
- Jeff Genender
- CTO
- Savoir Technologies, Inc
- and
- Member - Apache Software Foundation
2Goal of Your Talk
What Your Audience Will Gain
Learn about Apache Geronimo and how you can
leverage its open source components to build your
own application server stack customized for your
own needs.
IJTC 2007 Session XXXX
www.dubjug.org
3Jeff Genender
Apache CXF
JSR 316 - Java EE 6
IJTC 2007 Session XXXX
www.dubjug.org
4Agenda
- What is Apache Geronimo?
- Architecture
- Using Geronimo
- Configuring Geronimo
- Using Geronimo NOW
- Whats Next?
IJTC 2007 Session XXXX
www.dubjug.org
5What is Apache Geronimo?
Is It Java EE?
IJTC 2007 Session XXXX
www.dubjug.org
6What is Apache Geronimo?
- Java EE 5 Certified
- For more details see
- http//java.sun.com/javaee/overview/compatibility.
jsp
IBM WASCE 2.0
IJTC 2007 Session XXXX
www.dubjug.org
7Why - Another JavaEE/J2EE App Server?
- Java EE and J2EE are commodity
- Apache License 2.0
- Best of breed using open source
- Written for developers by developers
- Tired of heavy 1 Gigabyte stacks
- Slow startup times
- Only use a small subset of the entire JavaEE
framework - Future certified stacks
IJTC 2007 Session XXXX
www.dubjug.org
8What is Apache Geronimo?
- Top Level Apache Project
- Java EE 5 API
- J2EE/Java EE 5 implementations
- GBuild
- DevTools/Tooling (Eclipse)
- Subprojects
- Yoko,
- XBean
- (Helped to bring in OpenEJB, ServiceMix, ActiveMQ)
IJTC 2007 Session XXXX
www.dubjug.org
9Apache Geronimo Eco-System
Apache CXF
IJTC 2007 Session XXXX
www.dubjug.org
10Build Your Own App Server Stack!
IJTC 2007 Session XXXX
www.dubjug.org
11Pre-configured Assemblies
- Collection of configurations
- Examples
- geronimo-tomcat6-javaee5
- geronimo-tomcat6-minimal
- geronimo-jetty-javaee5
- geronimo-jetty-minimal
IJTC 2007 Session XXXX
www.dubjug.org
12Agenda
- What is Apache Geronimo?
- Architecture
- Using Geronimo
- Configuring Geronimo
- Using Geronimo NOW
- Whats Next?
IJTC 2007 Session XXXX
www.dubjug.org
13Geronimo Architecture
IJTC 2007 Session XXXX
www.dubjug.org
14Geronimo Architecture - Kernel
- Kernel - This is Geronimo!
- Controls component lifecycle
- Manages dependencies
- IoC (Inversion of Control) container
IJTC 2007 Session XXXX
www.dubjug.org
15Architecture - GBeans
- Whats a GBean?
- The Glue
- The Wrapper
- The Plugin to the Kernel
- JSR-77 (J2EE Management Specification)
- Lifecycle Running States
- Extension to the spec
IJTC 2007 Session XXXX
www.dubjug.org
16Architecture - GBean
public interface GBeanLifecycle public
void doStart() public void doStop()
public void doFail()
IJTC 2007 Session XXXX
www.dubjug.org
17Architecture - GBean IoC with the Plan File
... ltgbean gbeanName"geronimo.servernameDirec
toryService" class"org.apache.geronim
o.directory.DirectoryGBean"gt ltattribute
name"providerURL"gtousystemlt/attributegt
ltattribute name"securityAuthentication"gtsimplelt/a
ttributegt ltattribute name"securityPrincipal"gt
uidadmin,ousystemlt/attributegt ltattribute
name"securityCredentials"gtsecretlt/attributegt
ltattribute name"anonymousAccess"gttruelt/attributegt
ltattribute name"enableNetworking"gttruelt/attr
ibutegt ltattribute name"host"gt0.0.0.0lt/attribu
tegt ltattribute name"port"gt1389lt/attributegt
ltreference name"ServerInfo"gt
ltmodulegtgeronimo/j2ee-system/1.1-SNAPSHOT/carlt/mod
ulegt ltnamegtServerInfolt/namegt
lt/referencegt lt/gbeangt ...
IJTC 2007 Session XXXX
www.dubjug.org
18Architecture - GBean
- Simple Development
- Implement the GBeanLifecycle
- Declare the GBean and deploy it!
- Its what plugins are made of
- Should I care?
- Yes, because its how you configure Geronimo
- No, because you probably will never write one
(this is architecture)
Enough already! Lets get on to the good stuff...
IJTC 2007 Session XXXX
www.dubjug.org
19Agenda
- What is Apache Geronimo?
- Architecture
- Using Geronimo
- Configuring Geronimo
- Whats not there yet
- Using Geronimo NOW
- Whats Next?
IJTC 2007 Session XXXX
www.dubjug.org
20Using Geronimo
- Download it
- Unzip it
- Run it
IJTC 2007 Session XXXX
www.dubjug.org
21Directory Structure
GERONIMO_HOME ---/bin ---/deploy ---/lib
---/repository ---/schema ---/var
IJTC 2007 Session XXXX
www.dubjug.org
22VAR Directory Structure
GERONIMO_HOME/var ---activemq ---catalina
---config---
---client-log4j.properties
--config.xml
---server-log4j.properties
---derby
---deployer-log4j.properties
---geronimo.log
---log-------------------------
---security------keystores---
----geronimo-default
---shared ---users.properties
---temp ---groups.properti
es ---txlog
IJTC 2007 Session XXXX
www.dubjug.org
23REPOSITORY Directory Structure
GERONIMO_HOME/repository ---/... ---/common
s-logging Group Id
/commons-logging Artifact Id
/1.0.4 Version
/commons-logging-1.0.4.jar ---/...
IJTC 2007 Session XXXX
www.dubjug.org
24BIN Directory Structure
GERONIMO_HOME/bin ---/client.jar ---/server
.jar ---/upgrade.jar ---/deploy.sh
(bat) ---/geronimo.sh (bat) ---/setjavaenv.s
h (bat) ---/startup.sh (bat) ---/shutdown.sh
(bat)
IJTC 2007 Session XXXX
www.dubjug.org
25Starting Geronimo
- startup.sh
- geronimo.sh
- java -jar ./server.jar
- And for 2.1...
- gsh - The G-Shell
IJTC 2007 Session XXXX
www.dubjug.org
26Stopping Geronimo
- shutdown.sh
- geronimo.sh stop
- java -jar shutdown.jar
- The 2-finger salute Ctrl-C
IJTC 2007 Session XXXX
www.dubjug.org
27Geronimo Running Foreground...
100 11s
Startup complete Listening on Ports
1050 127.0.0.1 CORBA Naming Service 1099
0.0.0.0 RMI Naming 1527 0.0.0.0 Derby
Connector 2001 127.0.0.1 OpenEJB ORB Adapter
4201 0.0.0.0 OpenEJB Daemon 6882
127.0.0.1 OpenEJB ORB Adapter 8009 0.0.0.0
Tomcat Connector AJP AJP 8080 0.0.0.0
Tomcat Connector HTTP BIO HTTP 8443 0.0.0.0
Tomcat Connector HTTPS BIO HTTPS 9999 0.0.0.0
JMX Remoting Connector 61613 0.0.0.0
ActiveMQ Transport Connector 61616 0.0.0.0
ActiveMQ Transport Connector Started Application
Modules EAR org.apache.geronimo.configs/
webconsole-tomcat/2.0.2/car JAR
org.apache.geronimo.configs/mejb/2.0.2/car
RAR org.apache.geronimo.configs/activemq-ra/2.0.2
/car RAR org.apache.geronimo.configs/system-d
atabase/2.0.2/car WAR org.apache.geronimo.con
figs/dojo-tomcat/2.0.2/car WAR
org.apache.geronimo.configs/remote-deploy-tomcat/2
.0.2/car WAR org.apache.geronimo.configs/welc
ome-tomcat/2.0.2/car
IJTC 2007 Session XXXX
www.dubjug.org
28Geronimo Running Foreground...
... Web Applications / /console
/console-standard /dojo
/remote-deploy Geronimo Application Server
started
IJTC 2007 Session XXXX
www.dubjug.org
29Web Startup
IJTC 2007 Session XXXX
www.dubjug.org
30Web Console
IJTC 2007 Session XXXX
www.dubjug.org
31Web Console Continued.
IJTC 2007 Session XXXX
www.dubjug.org
32Deploying Applications
- Web Console
- The deployer directory
- Use for development only...Not recommended for
production - The deployer tool - deployer.sh (bat) script
- deployer.sh --user system --password manager
deploy \war/jar/ear plan file
IJTC 2007 Session XXXX
www.dubjug.org
33Agenda
- What is Apache Geronimo?
- Architecture
- Using Geronimo
- Configuring Geronimo
- Using Geronimo NOW
- Whats Next?
IJTC 2007 Session XXXX
www.dubjug.org
34How do you configure Geronimo?
- Plan file
- Vendor specific XML file
- config.xml
- Serialized running state
- Editing the config.xml
- By hand
- Console
- Plugins
- Everything in Geronimo is a plugin
IJTC 2007 Session XXXX
www.dubjug.org
35Plan Files
- What is a plan file?
- Descriptor to define and extend an application
- geronimo-application.xml - embedded
- geronimo-web.xml - embedded
- geronimo-ra.xml - embedded
- Any name you desire - external
- Describes...
- GBeans attributes and references
- GBeans dependencies
IJTC 2007 Session XXXX
www.dubjug.org
36Plan Files
- Many different types of plans to describe
information - Web, Application, Resource Adapters, Security
- Security, Naming References, EJB
- Schemas found in the schema directory
IJTC 2007 Session XXXX
www.dubjug.org
37Elements of a plan file
ltmodule xmlns"http//geronimo.apache.org/xml/ns/d
eployment-1.2"gt ltenvironmentgt ltmoduleIdgt
ltgroupIdgtorg.apache.geronimo.configslt/groupIdgt
ltartifactIdgtdirectorylt/artifactIdgt
ltversiongt1.2-SNAPSHOTlt/versiongt
lttypegtcarlt/typegt lt/moduleIdgt
ltdependenciesgt ltdependencygt
ltgroupIdgtorg.apache.geronimo.moduleslt/groupIdgt
ltartifactIdgtgeronimo-directorylt/artifactIdgt
ltversiongt1.1.1lt/versiongt
lttypegtjarlt/typegt ltimportgtclasseslt/importgt
lt/dependencygt ... ltdependenciesgt
lthidden-classes/gt ltnon-overridable-classes/
gt lt/environmentgt ...
IJTC 2007 Session XXXX
www.dubjug.org
38 ... ltgbean gbeanName"geronimo.servernameDi
rectoryService" class"org.apache.geroni
mo.directory.DirectoryGBean"gt ltattribute
name"providerURL"gtousystemlt/attributegt
ltattribute name"securityAuthentication"gtsimplelt/a
ttributegt ltattribute name"securityPrincipal"gt
uidadmin,ousystemlt/attributegt ltattribute
name"securityCredentials"gtsecretlt/attributegt
ltattribute name"anonymousAccess"gttruelt/attributegt
ltattribute name"enableNetworking"gttruelt/attr
ibutegt ltattribute name"host"gt0.0.0.0lt/attribu
tegt ltattribute name"port"gt1389lt/attributegt
ltreference name"ServerInfo"gt
ltnamegtServerInfolt/namegt lt/referencegt
lt/gbeangt lt/modulegt
IJTC 2007 Session XXXX
www.dubjug.org
39Web app plan file geronimo-web.xml
ltweb-app xmlns"http//geronimo.apache.org/xml/ns/
j2ee/web/tomcat-1.1"
xmlnssec"http//geronimo.apache.org/xml/ns/secur
ity"gt ltenvironmentgt ltmoduleIdgt
ltgroupIdgtorg.apache.geronimo.configslt/groupIdgt
ltartifactIdgtldap-demo-tomcatlt/artifactIdgt
ltversiongt2.0.2lt/versiongt lttypegtcarlttypegt
lt/moduleIdgt ltdependenciesgt ...
lt/dependenciesgt lthidden-classes/gt
ltnon-overridable-classes/gt lt/environmentgt
ltcontext-rootgt/ldap-demolt/context-rootgt ...
IJTC 2007 Session XXXX
www.dubjug.org
40 ... ltsecurity-realm-namegtldap-realmlt/security-
realm-namegt ltsecuritygt ltdefault-principal
realm-name"ldap-realm"gt ltprincipal
class"org.apache.geronimo.security.realm.provider
s.GeronimoUserPrincipal"
name"system"/gt lt/default-principalgt
ltrole-mappingsgt ltrole role-name"content-admin
istrator"gt ltrealm realm-name"ldap-realm"gt
ltprincipal class"org.apache.geronimo.secur
ity.realm.providers.GeronimoGroupPrincipal"
name"admin" designated-run-as"true
"/gt ltprincipal class"org.apache.geronimo.
security.realm.providers.GeronimoUserPrincipal"
name"system"/gt lt/realmgt
lt/rolegt ltrole role-name"guest"gt
ltrealm realm-name"ldap-realm"gt
ltprincipal class"org.apache.geronimo.security.rea
lm.providers.GeronimoGroupPrincipal"
name"guest" designated-run-as"true"/gt
ltprincipal class"org.apache.geronimo.securit
y.realm.providers.GeronimoUserPrincipal"
name"user1"/gt ltprincipal
class"org.apache.geronimo.security.realm.provider
s.GeronimoUserPrincipal"
name"user2"/gt lt/realmgt lt/rolegt
lt/role-mappingsgt lt/securitygt lt/web-appgt
IJTC 2007 Session XXXX
www.dubjug.org
41Configuring Geronimo - config.xml
ltattributes xmlns"http//geronimo.apache.org/xml/
ns/attributes-1.1"gt ... ltmodule
name"org.apache.geronimo.configs/tomcat6/2.0.2/ca
r"gt ... ltgbean name"TomcatWebConnector"gt
ltattribute name"host"gt0.0.0.0lt/attributegt
ltattribute name"port"gt8080lt/attributegt
ltattribute name"redirectPort"gt8443lt/attributegt
lt/gbeangt ltgbean name"TomcatWebSSLConnector
" load"false"gt lt/gbeangt ltgbean
gbeanInfo"org.apache.geronimo.tomcat.HostGBean"
name"org.apache.geronimo.configs/tomcat6/2.0.2/c
ar?ServiceModuleorg.apache.geronimo.configs/tomca
t6/2.0.2/car,j2eeTypeHost,nameTomcatVirtualHost_
1"gt ltattribute name"className"gtorg.apache.c
atalina.core.StandardHostlt/attributegt
ltattribute name"initParams"gt
namewww.example.com appBase
workDirworklt/attributegt ltattribute
name"aliases"gtwww.example.net,www.example.orglt/at
tributegt lt/gbeangt ...
lt/configurationgt ... lt/attributesgt
IJTC 2007 Session XXXX
www.dubjug.org
42Configuring Application Servers
IJTC 2007 Session XXXX
www.dubjug.org
43Configuring Geronimo - Web Console
IJTC 2007 Session XXXX
www.dubjug.org
44DEMO
Lets Build our own Stack!
45Using Geronimo NOW
- Why do I want to use Geronimo?
- Lightwieght
- Build your own application server for your needs
- Can I use Geronimo Now? Is it ready for
PrimeTime? - YES!!!
- Its new, is it ready for the Enterprise?
- YES!!! Java EE Certified...it is guaranteed to
run your applications - Check it out for yourself! Geronimo has some
great company! - http//java.sun.com/javaee/overview/compatibility.
jsp
IJTC 2007 Session XXXX
www.dubjug.org
46Whats Next for 2.1
- Even More User Friendly Configuration and
Application Management. - G-shell
- Plugins galore - Terracotta plugin
- Management/Monitoring tools
- Much, much more...
IJTC 2007 Session XXXX
www.dubjug.org
47Get Involved!
IJTC 2007 Session XXXX
www.dubjug.org
48Get Involved!
- Visit us at
- IRC
- irc//irc.freenode.net/geronimo
- Mailing lists
- http//geronimo.apache.org/mailing.html
IJTC 2007 Session XXXX
www.dubjug.org
49QA