Search
The Caboteria
/
Tech Web
/
TechNotes
>
ProgrammingNotes
>
JavaNotes
/
GeronimoNotes
(revision 22) (raw view)
The Apache group's j2ee server is called Geronimo. Here are some notes. The home page is http://geronimo.apache.org/ and there's a wiki at http://wiki.apache.org/geronimo/. ---+ Concepts ---++ GBean Geronimo is modular; it consists of a kernel and a set of components that implement the features needed to implement the J2EE specification. GBean (short for "Geronimo Bean") is the kernel-component interface. There's no GBean interface per se, but each GBean has a corresponding [[http://geronimo.apache.org/modules/kernel/apidocs/org/apache/geronimo/gbean/GBeanInfo.html][GBeanInfo]] object that describes the GBean and tells the kernel how to interact with it. Some GBeans implement [[http://geronimo.apache.org/modules/kernel/apidocs/org/apache/geronimo/gbean/GBeanLifecycle.html][GBeanLifecycle]] which allows them to get called when lifecycle events (start, stop, fail) happen. The source code for the =GBeanTest= class shows how a GBean is used. GBeans are tracked using an <nop>MBeanServer (_an MBean directory?_). According to mailing list traffic one advantage of GBeans over MBeans is that GBean method invocation is much faster. ---++ Misc * [[http://geronimo.apache.org/modules/kernel/apidocs/org/apache/geronimo/gbean/jmx/GBeanMBean.html][GBeanMBean]] * [[http://geronimo.apache.org/modules/kernel/apidocs/org/apache/geronimo/kernel/config/Configuration.html][Configuration]] * [[http://java.sun.com/products/JavaManagement/][JMX]], MBean * <nop>BootstrapContext * JSR-77 - a standard model for managing the J2EE Platform - [[http://www.jcp.org/en/jsr/detail?id=77][home]], [[http://www.onjava.com/pub/a/onjava/2002/03/27/jsr77.html][overview]] * JSR-88 - J2EE Application Deployment - [[http://www.jcp.org/en/jsr/detail?id=088][home]], * <nop>DependencyManager * <nop>ConfigurationManager ---+ Startup Runs using a [[http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html][standalone application jar]] called =target/bin/server.jar=. The startup class specified in =MANIFEST.MF= is [[http://geronimo.apache.org/modules/system/apidocs/org/apache/geronimo/system/main/Daemon.html][o.a.g.system.main.Daemon]]. The Daemon is a command-line wrapper around [[http://geronimo.apache.org/modules/kernel/apidocs/org/apache/geronimo/kernel/Kernel.html][o.a.g.kernel.Kernel]]. The daemon first unserializes the =META-INF/config.ser= from =server.jar= using Configuration.loadGMBeanState(). The format of =config.ser= is a leading int that indicates how many attribute name/value pairs follow, then a leading int that indicates how many setReferencePatterns() parameter pairs follow: <pre> int attributeCount = ois.readInt(); for (int i = 0; i < attributeCount; i++) { gbean.setAttribute((String) ois.readObject(), ois.readObject()); } int endpointCount = ois.readInt(); for (int i = 0; i < endpointCount; i++) { gbean.setReferencePatterns((String) ois.readObject(), (Set) ois.readObject()); } </pre> ---+ Deployment Runs using a [[http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html][standalone application jar]] called =target/bin/deployer.jar=. The startup class specified in =MANIFEST.MF= is =org.apache.geronimo.deployment.cli.DeployTool=. =DeployTool= parses the command line parameters and delegates to =org.apache.geronimo.deployment.cli.ServerConnection= to do most of the work. =ServerConnection= starts up a small kernel and loads a configuration into that kernel. Among the gbeans loaded into that kernel is one that wraps the =org.apache.geronimo.deployment.Deployer= class. =Deployer= picks apart the jar file and builds the various bits and pieces. If the thing being deployed is an ear file then =Deployer= will end up calling =org.apache.geronimo.j2ee.deployment.EarConfigBuilder=. wiki page here: http://wiki.apache.org/geronimo/Deployment j2ee xml descriptor files (and their geronimo counterparts) are unmarshalled into java classes using apache xmlbeans (http://xml.apache.org/xmlbeans). For resource adapters, the [[http://geronimo.apache.org/modules/connector/apidocs/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.html][ConnectorModuleBuilder]] class builds the configuration that gets deployed at run-time. Stack trace at startup (setting a RA parameter), heavily edited to remove the gbean/mbean cruft: <pre> at skeleton.ra.spread.AdapterImpl.setConfigParameter(AdapterImpl.java:84) at org.apache.geronimo.connector.ResourceAdapterWrapper.setAttribute(ResourceAdapterWrapper.java:130) at mx4j.server.MX4JMBeanServer.registerMBean(MX4JMBeanServer.java:729) at org.apache.geronimo.kernel.Kernel.loadGBean(Kernel.java:255) at org.apache.geronimo.kernel.config.Configuration.doStart(Configuration.java:176) at org.apache.geronimo.gbean.jmx.GBeanMBean.doStart(GBeanMBean.java:593) at org.apache.geronimo.gbean.jmx.AbstractManagedObject.startRecursive(AbstractManagedObject.java:303) at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1079) at org.apache.geronimo.gbean.jmx.AbstractManagedObject.startRecursive(AbstractManagedObject.java:310) at org.apache.geronimo.kernel.Kernel.startRecursiveGBean(Kernel.java:275) at org.apache.geronimo.system.main.Daemon.main(Daemon.java:137) </pre> In 1.2, the cli code is in the =modules/geronimo-deploy-tool= directory. It ends up in the =lib/= directory and the repository, but the version in lib seems to take precedence. If you're making changes you can build in =modules/geronimo-deploy-tool= then copy the jar from the maven repo to the target lib directory, i.e. <pre> $ cp ~/.m2/repository/org/apache/geronimo/modules/geronimo-deploy-tool/1.2-SNAPSHOT/geronimo-deploy-tool-1.2-SNAPSHOT.jar ~/target/lib/ </pre> ---+ EJB Geronimo embeds <nop>OpenEJB as its EJB container, so there's a lot of good info at http://www.openejb.org/ that's also relevant to Geronimo, for example http://www.openejb.org/geronimo.html and http://openejb.codehaus.org/hello-world.html . Geronimo's build process depends on downloading a copy of openejb from some site somewhere, and sometimes geronimo and openejb change simultaneously in ways that need to be closely coordinated. In that case you'll want to build openejb from source so that geronimo's build process can use your local openejb. openejb's web site points to old source code, but according to http://hausmates.codehaus.org/projectinfo newer code seems to be located at: <pre> cvs -d :pserver:anonymous@cvs.openejb.codehaus.org:/home/projects/openejb/scm login (no password) cvs -d :pserver:anonymous@cvs.openejb.codehaus.org:/home/projects/openejb/scm cvs co openejb </pre> Build openejb first, then geronimo. ---+ Building As of Oct 2006, the dev team has switched over to Maven2. A command-line build invocation that works for me is: <pre> MAVEN_OPTS="-Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=256m" mvn -o </pre> ---++ Command-line tools For example, the deployer. Code in =modules/geronimo-deploy-tool/=. This is referenced by =configs/online-deployer/= that builds a "car" file. Finally assembled in e.g. =assemblies/geronimo-jetty-j2ee/=. See =src/main/assembly/bin.xml=.
Edit
|
Attach
|
P
rint version
|
H
istory
:
r26
|
r24
<
r23
<
r22
<
r21
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria?
Send feedback