Date: 2003-12-23T18:02:38 Editor: JacekLaskowski <[EMAIL PROTECTED]> Wiki: Apache Geronimo Wiki Page: OpenEJBNova URL: http://wiki.apache.org/geronimo/OpenEJBNova
Deploying EJB section done Change Log: ------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ = Running = -Assuming the above steps went fine, you ought to see openejb-nova-DEV.jar file in target directory. The file and src/etc/nova-ejb-service.xml are the files that need to be copied to Geronimo directories. + Assuming the above steps went fine, you ought to see openejb-nova-DEV.jar file in target directory. The file and src/etc/nova-ejb-service.xml are the files that need to be copied to Geronimo directories. - * Copy src/etc/nova-ejb-service.xml to Geronimo's target/geronimo-DEV/deploy directory + * Copy src/etc/nova-ejb-service.xml to Geronimo's target/geronimo-DEV/deploy directory - * Copy target/openejb-nova-DEV.jar to Geronimo's target/geronimo-DEV/lib directory + * Copy target/openejb-nova-DEV.jar to Geronimo's target/geronimo-DEV/lib directory - * Start up Geronimo + * Start up Geronimo You ought to see the following: @@ -43,7 +43,7 @@ [java] 22:41:12,258 INFO [Geronimo] Started Server in 21s }}} - = EJB Deployment = + = Deploying EJB = org.apache.geronimo.kernel.deployment.scanner.DeploymentScanner is in charge of monitoring a specified set of directories and deploying files therein. It's configured in ''target/geronimo-DEV/etc/boot-service.xml''. @@ -56,4 +56,52 @@ It's also possible to use the default directory ''${geronimo.home}/deploy/'' or create another one beneath, e.g. ''${geronimo.home}/deploy/ejbs'' + * There're two approaches to deploy a bean: + * as '''UNPACKED_ARCHIVE''' (o.a.g.kernel.deployment.scanner.URLType.UNPACKED_ARCHIVE) - a directory with META-INF/MANIFEST.MF + * as '''PACKED_ARCHIVE''' (o.a.g.kernel.deployment.scanner.URLType.PACKED_ARCHIVE) - a file with META-INF/MANIFEST.MF + + File extensions aren't important. + + * Two files are mandatory to have Geronimo (EJBmoduleDeploymentPlanner, exactly) deploy an EJB: + * '''META-INF/geronimo-ejb-jar.xml''' + * '''META-INF/ejb-jar.xml''' + + They have the same XML structure, so creating a corresponding geronimo-ejb-jar.xml boils down to copying ejb-jar.xml as geronimo-ejb-jar.xml. + * Start up Geronimo + + * Open up Geronimo web console (http://localhost:8080/geronimo-web-console) and enter ''geronimo.j2ee:*'' as a filter. + + The shown entries are beans that Geronimo has successfully deployed. + + = More details = + +The process of deploying a bean (=use case) begins when o.a.g.kernel.deployment.scanner.DeploymentScanner (defined in /etc/boot-service.xml) is started up and monitoring a set of directories (defined in boot-service.xml file) at a defined in boot-service.xml file time interval. +There're two available deployment scanners: + * FileSystemScanner - it's in charge of handling file protocol + * WebDAVScanner - it's in charge of handling http(s) protocol +FileSystemScanner (FSS) picks up a file and checks whether it's of *_ARCHIVE type. If it is, FSS adds the file +to a list of deployments. It's visible on the console as: + + <filename> added to the list of deployments + +where <filename> is the name of the deployment (i.e. file or directory). + +The list is handed over to EJBModuleDeploymentPlanner, which ensures that /META-INF/geronimo-ejb-jar.xml exists. +If it doesn't the file is removed from the list of deployments (no message about it, though). The check of +geronimo-ejb-jar.xml existence is hander over to DeploymentHelper that attempts to open up /META-INF/ejb-jar.xml file. +If /META-INF/ejb-jar.xml doesn't exist, geronimo-ejb-jar.xml is assumed to not exist as well. +If it does the file is processed and shown on the console as: + + Planning the ejb module deployment <filename> + +where <filename> is the name of the deployment (i.e. file or directory) + +The next steps is shown on the console as: + + Loading deployment descriptor <filename> + +It's indication that EJBmodule is about to read /META-INF/geronimo-ejb-jar.xml. The file currently contains +all the required information on the EJB. + +When deployed it's shown as "geronimo.deployment:role=DeploymentUnitClassSpace,url=<filename>,type=EJBModule" MBean instance.