[Apache Geronimo Wiki] Updated: OpenEJBNova
Date: 2004-01-09T16:02:09 Editor: JacekLaskowski [EMAIL PROTECTED] Wiki: Apache Geronimo Wiki Page: OpenEJBNova URL: http://wiki.apache.org/geronimo/OpenEJBNova More details Change Log: -- @@ -1,5 +1,5 @@ = About = -OpenEJB Nova is the default EJB Container of Geronimo. It's based on [http://www.openejb.org OpenEJB]. +OpenEJB Nova is the default EJB 2.x Container of Geronimo. It's based on [http://www.openejb.org OpenEJB]. = Building = @@ -9,27 +9,7 @@ cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/openejb co -r nova -d nova openejb - * Go to nova/nova directory and run maven build (As of December, 2003, you may encounter a problem. The Geronimo .jar's first have to be moved to the Maven repository so the OpenEJB build can find the Geronimo .jar's. In this situation the following messages are generated by Maven: - -{{{ - .. - The build cannot continue because of the following unsatisfied dependencies: - - geronimo-common-DEV.jar (no download url specified) - geronimo-kernel-DEV.jar (no download url specified) - geronimo-core-DEV.jar (no download url specified) - geronimo-remoting-DEV.jar (no download url specified) - geronimo-spec-j2ee-connector-DEV.jar (no download url specified) - geronimo-spec-j2ee-jacc-DEV.jar (no download url specified) - -}}} - -{{{jlaskowski: The files are installed during Geronimo build - see the first bullet. Please remove it and let's discuss it on geronimo-dev mailing list}}} - -There are also some compile errors when using the anonymous check-out.) - -{{{jlaskowski: what kind of errors do you see? Please remove the statement and let's discuss details on geronimo-dev mailing list.}}} - + * Go to nova/nova directory and run maven build = Running = @@ -85,15 +65,29 @@ File extensions aren't important. * Two files are mandatory to have Geronimo (org.openejb.nova.deployment.EJBmoduleDeploymentPlanner, exactly) deploy an EJB: -* '''META-INF/geronimo-ejb-jar.xml''' +* '''META-INF/geronimo-ejb-jar.xml''' ([http://cvs.apache.org/viewcvs.cgi/*checkout*/incubator-geronimo/modules/core/src/schema/geronimo-ejb-jar.xsd XML Schema of geronimo-ejb-jar.xml]) * '''META-INF/ejb-jar.xml''' They have a very similar XML structure, so creating a corresponding geronimo-ejb-jar.xml boils down to do the following steps: - 1. copy ejb-jar.xml as geronimo-ejb-jar.xml - 1. Add Geronimo-specific ClassSpace tag to geronimo-ejb-jar.xml, thus the ejb-jar tag changes to: + * copy ejb-jar.xml as geronimo-ejb-jar.xml + * Add Geronimo-specific ClassSpace tag to geronimo-ejb-jar.xml, thus the ejb-jar tag changes to: + {{{ejb-jar xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:g=http://geronimo.apache.org/xml/schema/j2ee; +g:class-space name=geronimo.system:role=ClassSpace,name=System/}}} + + * entity's needs appropriate g:datasource-name's, otherwise Geronimo emits the message: + {{{ +[java] java.lang.NullPointerException +[java] at org.openejb.nova.deployment.DeployCMPEntityContainer.perform(DeployCMPEntityContainer.java:111) +[java] at org.apache.geronimo.kernel.deployment.DeploymentPlan.execute(DeploymentPlan.java:107) +[java] at org.apache.geronimo.kernel.deployment.DeploymentController.executePlans(DeploymentController.java:270) +[java] at org.apache.geronimo.kernel.deployment.DeploymentController.executeJob(DeploymentController.java:194) +[java] at org.apache.geronimo.kernel.deployment.DeploymentController.access$200(DeploymentController.java:89) +[java] at org.apache.geronimo.kernel.deployment.DeploymentController$DeploymentWaiter.run(DeploymentController.java:324) +[java] at java.lang.Thread.run(Thread.java:534) + }}} + + It's because EJBModuleDeploymentPlanner creates schemaTask only when datasource-name is available. Unfortunatelly, planCMPEntity doesn't check whether or not schemaTask is null. It's not a big deal as Validator is expected to sort it out. - {{{ejb-jar xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:ger=http://geronimo.apache.org/xml/schema/j2ee; -ger:class-space name=geronimo.system:role=ClassSpace,name=System/}}} NOTE: You can find a sample EJB at [http://www.openejb.org/hello-world.html OpenEJB Hello World!] page.
cvs commit: incubator-geronimo/modules/core/src/test/org/apache/geronimo/security EJBSecurityInterceptorTest.java
adc 2004/01/10 14:31:17 Removed: modules/core/src/test/org/apache/geronimo/security EJBSecurityInterceptorTest.java Log: Moved to OpenEJB Nova
cvs commit: incubator-geronimo/modules/core/src/test/org/apache/geronimo/security ITestPerson.java TestPerson.java TestPrincipal.java
adc 2004/01/10 14:33:51 Removed: modules/core/src/test/org/apache/geronimo/security ITestPerson.java TestPerson.java TestPrincipal.java Log: No longer needed
cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/util ContextManager.java
adc 2004/01/10 14:34:42 Modified:modules/core/src/java/org/apache/geronimo/security/util ContextManager.java Log: Simplified context management Revision ChangesPath 1.5 +73 -72 incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/util/ContextManager.java Index: ContextManager.java === RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/util/ContextManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ContextManager.java 2 Jan 2004 04:31:44 - 1.4 +++ ContextManager.java 10 Jan 2004 22:34:42 - 1.5 @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, *if any, must include the following acknowledgment: * This product includes software developed by the - *Apache Software Foundation (http:www.apache.org/). + *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgment may appear in the software itself, *if and wherever such third-party acknowledgments normally appear. * @@ -49,24 +49,23 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * http:www.apache.org/. + * http://www.apache.org/. * * */ package org.apache.geronimo.security.util; +import javax.security.auth.Subject; +import javax.security.jacc.EJBRoleRefPermission; import java.security.AccessControlContext; import java.security.AccessControlException; +import java.security.AccessController; import java.security.Principal; +import java.security.PrivilegedAction; import java.util.Hashtable; -import java.util.Iterator; import java.util.Map; -import java.util.Stack; - -import javax.security.auth.Subject; -import javax.security.jacc.EJBRoleRefPermission; -import javax.security.jacc.WebRoleRefPermission; +import org.apache.geronimo.security.PrimaryRealmPrincipal; import org.apache.geronimo.security.GeronimoSecurityPermission; import org.apache.geronimo.security.RealmPrincipal; @@ -75,116 +74,118 @@ * * @version $Revision$ $Date$ */ - public class ContextManager { -private static ContextThreadLocalStack contexts = new ContextThreadLocalStack(); +private static ThreadLocal currentCaller = new ThreadLocal(); +private static ThreadLocal nextCaller = new ThreadLocal(); private static Map subjectContexts = new Hashtable(); -private static ThreadLocal methodIndexes = new ThreadLocal(); public static final GeronimoSecurityPermission GET_CONTEXT = new GeronimoSecurityPermission(getContext); public static final GeronimoSecurityPermission SET_CONTEXT = new GeronimoSecurityPermission(setContext); -public static AccessControlContext peekContext() { -SecurityManager sm = System.getSecurityManager(); -if (sm != null) sm.checkPermission(GET_CONTEXT); - -return contexts.peek().context; -} -public static Subject popSubject() { +public static void setNextCaller(Subject subject) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(SET_CONTEXT); -return contexts.pop().subject; +nextCaller.set(subject); } -public static void pushSubject(Subject subject) { +public static Subject getNextCaller() { SecurityManager sm = System.getSecurityManager(); -if (sm != null) sm.checkPermission(SET_CONTEXT); - -Context context = new Context(); -context.subject = subject; -context.context = (AccessControlContext)subjectContexts.get(subject); - -assert context.context != null; +if (sm != null) sm.checkPermission(GET_CONTEXT); -contexts.push(context); +return (Subject) nextCaller.get(); } -public static void registerContext(Subject subject, AccessControlContext context) { +public static void setCurrentCaller(Subject subject) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(SET_CONTEXT); -subjectContexts.put(subject, context); +currentCaller.set(subject); } -public static void unregisterContext(Subject subject) { +public static Subject getCurrentCaller() { SecurityManager sm = System.getSecurityManager(); -if (sm != null) sm.checkPermission(SET_CONTEXT); +if (sm != null) sm.checkPermission(GET_CONTEXT); -
cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/security PrimaryRealmPrincipal.java
adc 2004/01/10 14:38:43 Added: modules/core/src/java/org/apache/geronimo/security PrimaryRealmPrincipal.java Log: A way to designate a primary principal among many. Revision ChangesPath 1.1 incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/PrimaryRealmPrincipal.java Index: PrimaryRealmPrincipal.java === /* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, *if any, must include the following acknowledgment: * This product includes software developed by the *Apache Software Foundation (http:www.apache.org/). *Alternately, this acknowledgment may appear in the software itself, *if and wherever such third-party acknowledgments normally appear. * * 4. The names Apache and Apache Software Foundation and *Apache Geronimo must not be used to endorse or promote products *derived from this software without prior written permission. For *written permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache, *Apache Geronimo, nor may Apache appear in their name, without *prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http:www.apache.org/. * * */ package org.apache.geronimo.security; import java.security.Principal; /** * * @version $Revision: 1.1 $ $Date: 2004/01/10 22:38:43 $ */ public class PrimaryRealmPrincipal extends RealmPrincipal { public PrimaryRealmPrincipal(String realm, Principal principal) { super(realm, principal); } }
cvs commit: incubator-geronimo/xdocs navigation.xml
adc 2004/01/10 14:49:49 Modified:xdocsnavigation.xml Log: Added clustering to nav Revision ChangesPath 1.15 +2 -1 incubator-geronimo/xdocs/navigation.xml Index: navigation.xml === RCS file: /home/cvs/incubator-geronimo/xdocs/navigation.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- navigation.xml25 Nov 2003 04:42:06 - 1.14 +++ navigation.xml10 Jan 2004 22:49:49 - 1.15 @@ -31,6 +31,7 @@ /menu menu name=Modules + item name=Clustering href=/modules/clustering/index.html/ item name=Common href=/modules/common/index.html/ item name=Web Console href=/modules/console-web/index.html/ item name=Core Container href=/modules/core/index.html/
cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/security LoginModuleWrapper.java
adc 2004/01/10 14:56:08 Modified:modules/core/src/java/org/apache/geronimo/security LoginModuleWrapper.java Log: Context cleanup Revision ChangesPath 1.7 +3 -10 incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/LoginModuleWrapper.java Index: LoginModuleWrapper.java === RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/security/LoginModuleWrapper.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- LoginModuleWrapper.java 5 Jan 2004 18:56:34 - 1.6 +++ LoginModuleWrapper.java 10 Jan 2004 22:56:08 - 1.7 @@ -55,8 +55,6 @@ */ package org.apache.geronimo.security; -import java.security.AccessControlContext; -import java.security.AccessController; import java.security.Principal; import java.security.PrivilegedActionException; import java.util.Iterator; @@ -139,12 +137,7 @@ externalSubject.getPrivateCredentials().addAll(internalSubject.getPrivateCredentials()); externalSubject.getPublicCredentials().addAll(internalSubject.getPublicCredentials()); -AccessControlContext context = (AccessControlContext) Subject.doAsPrivileged(externalSubject, new java.security.PrivilegedAction() { -public Object run() { -return AccessController.getContext(); -} -}, null); -ContextManager.registerContext(externalSubject, context); +ContextManager.registerSubject(externalSubject); return true; } @@ -154,7 +147,7 @@ } public boolean logout() throws LoginException { -ContextManager.unregisterContext(externalSubject); +ContextManager.unregisterSubject(externalSubject); return module.logout(); }