You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2011/07/10 06:34:03 UTC

svn commit: r1144777 [6/16] - /openejb/site/trunk/content/

Added: openejb/site/trunk/content/executables.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/executables.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/executables.cwiki (added)
+++ openejb/site/trunk/content/executables.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,258 @@
+
+This doc describes the design-in-progress for revamping the command-line execution of openejb.
+
+Basic ideas:
+ * Commands can be added/removed (start, stop, test, validate, deploy)
+ * Adding/removing only requires adding/removing jars from the classpath
+
+We can stuff properties files into jars at:
+{code}META-INF/org.openejb.cli/{name}{code}
+
+The propeties file will contain a main.class property, maybe an optional main.method property, and a set of description properties.
+
+Here is an example of the start command:
+
+It would be located at
+{code}META-INF/org.openejb.cli/start{code}
+
+{code:title=start}
+main.class=org.openejb.server.Main
+description.en=Starts the Remote Server
+description.es=Ejecuta el Servidor Remoto
+{code}
+
+We would pull in all these files in the launcher's main method and parse them.  If someone typed "openejb --help" then we would list the commands and descriptions.
+
+
+h1.  Getting the properties files
+
+Hiram wrote some code like this for activeio
+
+{code:title=FactoryFinder.java}
+/**
+ * 
+ */
+package org.activeio;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+
+public class FactoryFinder {
+    
+    private final String path;
+    private final ConcurrentHashMap classMap = new ConcurrentHashMap();
+    
+    public FactoryFinder(String path) {
+        this.path = path;
+    }
+
+    /**
+     * Creates a new instance of the given key
+     * 
+     * @param key
+     *            is the key to add to the path to find a text file
+     *            containing the factory name
+     * @return a newly created instance
+     */
+    public Object newInstance(String key) throws IllegalAccessException, InstantiationException, IOException,
+            ClassNotFoundException {
+        return newInstance(key, null);
+    }
+
+    public Object newInstance(String key, String propertyPrefix) throws IllegalAccessException,
+            InstantiationException, IOException, ClassNotFoundException {
+        if (propertyPrefix == null)
+            propertyPrefix = "";
+        
+        Class clazz = (Class) classMap.get(propertyPrefix+key);
+        if( clazz == null ) {
+            clazz = newInstance(doFindFactoryProperies(key), propertyPrefix);
+        }
+        return clazz.newInstance();
+    }
+
+    private Class newInstance(Properties properties, String propertyPrefix) throws ClassNotFoundException,
+            InstantiationException, IllegalAccessException, IOException {
+
+        String className = properties.getProperty(propertyPrefix + "class");
+        if (className == null) {
+            throw new IOException("Expected property is missing: " + propertyPrefix + "class");
+        }
+        Class clazz;
+        try {
+            clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+        } catch (ClassNotFoundException e) {
+            clazz = FactoryFinder.class.getClassLoader().loadClass(className);
+        }
+        
+        return clazz;
+    }
+
+    private Properties doFindFactoryProperies(String key) throws IOException, ClassNotFoundException {
+        String uri = path + key;
+
+        // lets try the thread context class loader first
+        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+        if (in == null) {
+            in = FactoryFinder.class.getClassLoader().getResourceAsStream(uri);
+            if (in == null) {
+                throw new IOException("Could not find factory class for resource: " + uri);
+            }
+        }
+
+        // lets load the file
+        BufferedInputStream reader = null;
+        try {
+            reader = new BufferedInputStream(in);
+            Properties properties = new Properties();
+            properties.load(reader);
+            return properties;
+        } finally {
+            try {
+                reader.close();
+            } catch (Exception e) {
+            }
+        }
+    }
+}
+{code}
+
+If we used a class similar to that, we could get the commands like such:
+
+{code:title=Main.java}
+FactoryFinder finder = new FactoryFinder("META-INF/org.openejb.cli/");
+Properties props = finder.doFindFactoryProperies("start")
+commands.put("start",props);
+// we should try and load them all into properties instances and map them in advance
+
+//.. later to list help
+String local = //get the i18n 2 character local (en, es, fr...)
+
+for each commands.entrySet() ... {
+   Map.Entry entry = commandEntries.next();
+   String command = entry.getKey();
+   Properties props = (Properties) entry.getValue();
+   String description = props.getProperty("description."+local, props.getProperty("description"));
+   System.out.print("    "+command+"\t"+description);
+}
+
+//.. later to execute a command
+Properties props = (Properties)commands.get("start");
+String mainClass = props.getProperty("main.class");
+
+Class clazz = getClassLoader().loadClass(mainClass);
+Method mainMethod = clazz.getMethod("main", new Class[]{String[].class});
+mainMethod.invoke(args); // obviously the "start" arg has been shaved off first
+{code}
+
+h1. Actual implementation
+I took a different approach.  Since we won't use this class to actually return a class loaded from the properties file, I made minor changes.  I also made the CommandFinder.java capable of finding all possible command homes so that others wouldn't have to implement it themselves.  Also, the CommandFinder will automatically set the openejb.home.  The idea is that we may be able to get rid of all of the scripts checking for OPENEJB_HOME for us.  This is the initial concept so please make changes or suggestions.
+
+{code:title=CommandFinder.java}
+package org.openejb.cli;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+public class CommandFinder {
+	private String path;
+	private Map classMap = Collections.synchronizedMap(new HashMap());
+	
+	public CommandFinder(String path) {
+		this.path = path;
+	}
+	
+    public Properties doFindCommandProperies(String key) throws IOException {
+        String uri = path + key;
+        
+        // lets try the thread context class loader first
+        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+        if (in == null) {
+            in = CommandFinder.class.getClassLoader().getResourceAsStream(uri);
+            if (in == null) {
+                throw new IOException("Could not find factory class for resource: " + uri);
+            }
+        }
+
+        // lets load the file
+        BufferedInputStream reader = null;
+        try {
+            reader = new BufferedInputStream(in);
+            Properties properties = new Properties();
+            properties.load(reader);
+            
+            //All is well, set openejb.home
+            URL propsURL = Thread.currentThread().getContextClassLoader().getResource(uri);
+            String propsString = propsURL.getFile();
+            URL jarURL;
+            File jarFile;
+            
+            propsString = propsString.substring(0, propsString.indexOf("!"));
+            
+            jarURL = new URL(propsString);
+            jarFile = new File(jarURL.getFile());
+            
+            if (jarFile.getName().indexOf("openejb-core") > -1) {
+            	File lib = jarFile.getParentFile();
+            	File home = lib.getParentFile();
+            	
+            	System.setProperty("openejb.home", home.getAbsolutePath());
+            }
+            
+            return properties;
+        } finally {
+            try {
+                reader.close();
+            } catch (Exception e) {
+            }
+        }
+    }
+    
+    public Enumeration doFindCommands() throws IOException {
+    	return Thread.currentThread().getContextClassLoader().getResources(path);
+    }
+}
+{code}
+
+h1. Current Implementation Usage
+The usage for this is the same as before but you would use the following approach to run instead of the OPENEJB_HOME/bin/openejb command:
+{code:title=Usage}
+java -jar OPENEJB_HOME/lib/openejb-core-<VERSION>.jar
+{code}
+Eventually, once David and I talk, we will wrap this in a script, like we do now.  Right now, only the core commands are implemented:
+
+* deploy
+* help
+* start
+* stop
+* validate
+
+h1. Current Questions Before Integrating Into Mainstream
+* Classpath - Will the command implementors be responsible for managing their classpath?
+* Logging - Will we log errors in the CommandFinder.java or continue as-is outputting StackTrace and OpenEJB messages
+* Handling non-core command - We should have an OPENEJB_HOME/lib/etc where all 3rd party commands, like tests, can house their jars.  We need a standard location so the code can just work without the user having to add things to the classpath manually
+* Wrapping in script - We will eventually wrap our executable jar in a script.
+
+h1. Help!
+
+openejb --help
+(list the commands and descriptions)
+
+This would be the job of the main class of the launcher.  It would find all the commands in the system, and list their names and print their "description" property.
+
+openejb start --help 
+(list the start help text)
+
+The main class of the launcher would do nothing with this.  The start command would need to grab it's help text and print it to the system.out.  Yes, this is extra work, but the various commands already support this.  Also, at some point we won't have the help text as is and will use commons.cli to create the text.

Propchange: openejb/site/trunk/content/executables.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/executables.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/executables.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/executables.mdtext (added)
+++ openejb/site/trunk/content/executables.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,311 @@
+Title: Executables
+
+This doc describes the design-in-progress for revamping the command-line
+execution of openejb.
+
+Basic ideas:
+ * Commands can be added/removed (start, stop, test, validate, deploy)
+ * Adding/removing only requires adding/removing jars from the classpath
+
+We can stuff properties files into jars at:
+
+    
+    The propeties file will contain a main.class property, maybe an optional
+main.method property, and a set of description properties.
+    
+    Here is an example of the start command:
+    
+    It would be located at
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>start</B></DIV><DIV class="codeContent panelContent">
+    main.class=org.openejb.server.Main
+    description.en=Starts the Remote Server
+    description.es=Ejecuta el Servidor Remoto
+
+
+We would pull in all these files in the launcher's main method and parse
+them.  If someone typed "openejb --help" then we would list the commands
+and descriptions.
+
+
+<a name="Executables-Gettingthepropertiesfiles"></a>
+#  Getting the properties files
+
+Hiram wrote some code like this for activeio
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>FactoryFinder.java</B></DIV><DIV class="codeContent panelContent">
+    /**
+     * 
+     */
+    package org.activeio;
+    
+    import java.io.BufferedInputStream;
+    import java.io.IOException;
+    import java.io.InputStream;
+    import java.util.Properties;
+    
+    import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+    
+    public class FactoryFinder {
+        
+        private final String path;
+        private final ConcurrentHashMap classMap = new ConcurrentHashMap();
+        
+        public FactoryFinder(String path) {
+    	this.path = path;
+        }
+    
+        /**
+         * Creates a new instance of the given key
+         * 
+         * @param key
+         *		  is the key to add to the path to find a text file
+         *		  containing the factory name
+         * @return a newly created instance
+         */
+        public Object newInstance(String key) throws IllegalAccessException,
+InstantiationException, IOException,
+    	    ClassNotFoundException {
+    	return newInstance(key, null);
+        }
+    
+        public Object newInstance(String key, String propertyPrefix) throws
+IllegalAccessException,
+    	    InstantiationException, IOException, ClassNotFoundException {
+    	if (propertyPrefix == null)
+    	    propertyPrefix = "";
+            
+    	Class clazz = (Class) classMap.get(propertyPrefix+key);
+    	if( clazz == null ) {
+    	    clazz = newInstance(doFindFactoryProperies(key),
+propertyPrefix);
+    	}
+    	return clazz.newInstance();
+        }
+    
+        private Class newInstance(Properties properties, String propertyPrefix)
+throws ClassNotFoundException,
+    	    InstantiationException, IllegalAccessException, IOException {
+    
+    	String className = properties.getProperty(propertyPrefix +
+"class");
+    	if (className == null) {
+    	    throw new IOException("Expected property is missing: " +
+propertyPrefix + "class");
+    	}
+    	Class clazz;
+    	try {
+    	    clazz =
+Thread.currentThread().getContextClassLoader().loadClass(className);
+    	} catch (ClassNotFoundException e) {
+    	    clazz =
+FactoryFinder.class.getClassLoader().loadClass(className);
+    	}
+            
+    	return clazz;
+        }
+    
+        private Properties doFindFactoryProperies(String key) throws
+IOException, ClassNotFoundException {
+    	String uri = path + key;
+    
+    	// lets try the thread context class loader first
+    	InputStream in =
+Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+    	if (in == null) {
+    	    in =
+FactoryFinder.class.getClassLoader().getResourceAsStream(uri);
+    	    if (in == null) {
+    		throw new IOException("Could not find factory class for
+resource: " + uri);
+    	    }
+    	}
+    
+    	// lets load the file
+    	BufferedInputStream reader = null;
+    	try {
+    	    reader = new BufferedInputStream(in);
+    	    Properties properties = new Properties();
+    	    properties.load(reader);
+    	    return properties;
+    	} finally {
+    	    try {
+    		reader.close();
+    	    } catch (Exception e) {
+    	    }
+    	}
+        }
+    }
+
+
+If we used a class similar to that, we could get the commands like such:
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Main.java</B></DIV><DIV class="codeContent panelContent">
+    FactoryFinder finder = new FactoryFinder("META-INF/org.openejb.cli/");
+    Properties props = finder.doFindFactoryProperies("start")
+    commands.put("start",props);
+    // we should try and load them all into properties instances and map them
+in advance
+    
+    //.. later to list help
+    String local = //get the i18n 2 character local (en, es, fr...)
+    
+    for each commands.entrySet() ... {
+       Map.Entry entry = commandEntries.next();
+       String command = entry.getKey();
+       Properties props = (Properties) entry.getValue();
+       String description = props.getProperty("description."+local,
+props.getProperty("description"));
+       System.out.print("	 "+command+"\t"+description);
+    }
+    
+    //.. later to execute a command
+    Properties props = (Properties)commands.get("start");
+    String mainClass = props.getProperty("main.class");
+    
+    Class clazz = getClassLoader().loadClass(mainClass);
+    Method mainMethod = clazz.getMethod("main", new Class[]
+{String[].class});
+    mainMethod.invoke(args); // obviously the "start" arg has been shaved off
+first
+
+
+<a name="Executables-Actualimplementation"></a>
+# Actual implementation
+I took a different approach.  Since we won't use this class to actually
+return a class loaded from the properties file, I made minor changes.  I
+also made the CommandFinder.java capable of finding all possible command
+homes so that others wouldn't have to implement it themselves.	Also, the
+CommandFinder will automatically set the openejb.home.	The idea is that we
+may be able to get rid of all of the scripts checking for OPENEJB_HOME for
+us.  This is the initial concept so please make changes or suggestions.
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>CommandFinder.java</B></DIV><DIV class="codeContent panelContent">
+    package org.openejb.cli;
+    
+    import java.io.BufferedInputStream;
+    import java.io.File;
+    import java.io.IOException;
+    import java.io.InputStream;
+    import java.net.URL;
+    import java.util.Collections;
+    import java.util.Enumeration;
+    import java.util.HashMap;
+    import java.util.Map;
+    import java.util.Properties;
+    
+    public class CommandFinder {
+    	private String path;
+    	private Map classMap = Collections.synchronizedMap(new HashMap());
+    	
+    	public CommandFinder(String path) {
+    		this.path = path;
+    	}
+    	
+        public Properties doFindCommandProperies(String key) throws IOException
+{
+    	String uri = path + key;
+            
+    	// lets try the thread context class loader first
+    	InputStream in =
+Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+    	if (in == null) {
+    	    in =
+CommandFinder.class.getClassLoader().getResourceAsStream(uri);
+    	    if (in == null) {
+    		throw new IOException("Could not find factory class for
+resource: " + uri);
+    	    }
+    	}
+    
+    	// lets load the file
+    	BufferedInputStream reader = null;
+    	try {
+    	    reader = new BufferedInputStream(in);
+    	    Properties properties = new Properties();
+    	    properties.load(reader);
+                
+    	    //All is well, set openejb.home
+    	    URL propsURL =
+Thread.currentThread().getContextClassLoader().getResource(uri);
+    	    String propsString = propsURL.getFile();
+    	    URL jarURL;
+    	    File jarFile;
+                
+    	    propsString = propsString.substring(0,
+propsString.indexOf("!"));
+                
+    	    jarURL = new URL(propsString);
+    	    jarFile = new File(jarURL.getFile());
+                
+    	    if (jarFile.getName().indexOf("openejb-core") > -1) {
+    		File lib = jarFile.getParentFile();
+    		File home = lib.getParentFile();
+                	
+    		System.setProperty("openejb.home", home.getAbsolutePath());
+    	    }
+                
+    	    return properties;
+    	} finally {
+    	    try {
+    		reader.close();
+    	    } catch (Exception e) {
+    	    }
+    	}
+        }
+        
+        public Enumeration doFindCommands() throws IOException {
+    	return
+Thread.currentThread().getContextClassLoader().getResources(path);
+        }
+    }
+
+
+<a name="Executables-CurrentImplementationUsage"></a>
+# Current Implementation Usage
+The usage for this is the same as before but you would use the following
+approach to run instead of the OPENEJB_HOME/bin/openejb command:
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Usage</B></DIV><DIV class="codeContent panelContent">
+    java -jar OPENEJB_HOME/lib/openejb-core-<VERSION>.jar
+
+Eventually, once David and I talk, we will wrap this in a script, like we
+do now.  Right now, only the core commands are implemented:
+
+* deploy
+* help
+* start
+* stop
+* validate
+
+<a name="Executables-CurrentQuestionsBeforeIntegratingIntoMainstream"></a>
+# Current Questions Before Integrating Into Mainstream
+* Classpath - Will the command implementors be responsible for managing
+their classpath?
+* Logging - Will we log errors in the CommandFinder.java or continue as-is
+outputting StackTrace and OpenEJB messages
+* Handling non-core command - We should have an OPENEJB_HOME/lib/etc where
+all 3rd party commands, like tests, can house their jars.  We need a
+standard location so the code can just work without the user having to add
+things to the classpath manually
+* Wrapping in script - We will eventually wrap our executable jar in a
+script.
+
+<a name="Executables-Help!"></a>
+# Help!
+
+openejb --help
+(list the commands and descriptions)
+
+This would be the job of the main class of the launcher.  It would find all
+the commands in the system, and list their names and print their
+"description" property.
+
+openejb start --help 
+(list the start help text)
+
+The main class of the launcher would do nothing with this.  The start
+command would need to grab it's help text and print it to the system.out. 
+Yes, this is extra work, but the various commands already support this. 
+Also, at some point we won't have the help text as is and will use
+commons.cli to create the text.

Added: openejb/site/trunk/content/faq.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/faq.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/faq.cwiki (added)
+++ openejb/site/trunk/content/faq.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,55 @@
+h2. &nbsp;General
+
+&nbsp;
+
+h3. What spec version does OpenEJB support?
+
+OpenEJB supports the Enterprise JavaBeans 3.0 specification and previous versions 2.1, 2.0 and 1.1.
+
+h3.  I don't plan to use EJBs, so why would I embed OpenEJB into Tomcat.
+
+Adding OpenEJB to Tomcat gives servlets several new Java EE 5 capabilities such as JPA, JAX-WS, JMS, J2EE Connectors, transactions, and more as well as enhancing the injection features of Tomcat 6 to now support injection of JavaEE objects like Topics, Queues, EntityManagers, JMS ConnectionFactories, JavaMail Sessions, as well as simpler data types such as Dates, Classes, URI, URL, List, Map, Set, Properties, and more.  In the case of Tomcat 5.5 which doesn't support dependency injection at all, even more is gained.
+
+h3. Can I run OpenEJB with a JVM for any vendor?
+
+The Sun, Mac, and IBM vms are regularly tested, however any vm should work.
+
+h3. Which version of Java is required to run OpenEJB?
+
+Java versions 5 or 6, aka Java 1.5 or 1.6.
+
+h3. Do I need Apache Maven to work with OpenEJB?
+
+Definitely not. Most of the examples include both Maven and Ant build files.  OpenEJB is usable as a plain library, much like an embedded database like Derby, so it is usable in any application regardless if that application is run via Maven, Ant, Intellij, Eclipse, NetBeans, JUnit, TestNG, etc.
+
+h3. Can I start and stop OpenEJB from an IDE? If yes, which IDE is supported by OpenEJB?
+
+The short answer is yes.  The basic approach for all embedding scenarios is to 1) add OpenEJB to your classpath, and 2) construct your InitialContext using org.apache.openejb.client.LocalInitialContextFactory.  The LocalInitialContextFactory will boot OpenEJB in your vm and all ejb applications visible in the classpath will be deployed. See http://openejb.apache.org/embedding-openejb.html for details on how to embed openejb in your application and IDE.  See [Application discovery via the classpath|OPENEJBx30:Application discovery via the classpath] for various ways to have your applications discovered. 
+
+
+h3.  During embedded testing, how can I externalize all my DataSource configuration? 
+
+Create an openejb.xml file in any directory that gets added to your test classpath. For maven, something that winds up directly under "target/classes/" or "target/test-classes/" will work just fine.  Then in your test case do this:
+{code}
+   protected void setUp() throws Exception {
+       Properties properties = new Properties();
+       properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,  "org.apache.openejb.client.LocalInitialContextFactory");
+
+       URL config = this.getClass().getClassLoader().getResource("openejb.xml");
+       properties.setProperty("openejb.configuration", config.toExternalForm());
+
+       initialContext = new InitialContext(properties);
+   }
+{code}
+The file itself doesn't have to be called "openejb.xml", you could have a few different files like that for different testing scenarios each with a name that describes the basic setup.
+
+h2. Container-Managed Persistence
+
+h3. What engine does OpenEJB use for CMP?
+
+The CMP engine is written as a layer over JPA with OpenJPA doing the persistence work.
+
+h3. What is the format for the CMP mapping files?
+
+The standard JPA mapping file and annotations are also used for CMP mappings.
+

Propchange: openejb/site/trunk/content/faq.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/faq.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/faq.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/faq.mdtext (added)
+++ openejb/site/trunk/content/faq.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,96 @@
+Title: FAQ
+<a name="FAQ-&nbsp;General"></a>
+## &nbsp;General
+
+&nbsp;
+
+<a name="FAQ-WhatspecversiondoesOpenEJBsupport?"></a>
+### What spec version does OpenEJB support?
+
+OpenEJB supports the Enterprise JavaBeans 3.0 specification and previous
+versions 2.1, 2.0 and 1.1.
+
+<a name="FAQ-Idon'tplantouseEJBs,sowhywouldIembedOpenEJBintoTomcat."></a>
+###  I don't plan to use EJBs, so why would I embed OpenEJB into Tomcat.
+
+Adding OpenEJB to Tomcat gives servlets several new Java EE 5 capabilities
+such as JPA, JAX-WS, JMS, J2EE Connectors, transactions, and more as well
+as enhancing the injection features of Tomcat 6 to now support injection of
+JavaEE objects like Topics, Queues, EntityManagers, JMS
+ConnectionFactories, JavaMail Sessions, as well as simpler data types such
+as Dates, Classes, URI, URL, List, Map, Set, Properties, and more.  In the
+case of Tomcat 5.5 which doesn't support dependency injection at all, even
+more is gained.
+
+<a name="FAQ-CanIrunOpenEJBwithaJVMforanyvendor?"></a>
+### Can I run OpenEJB with a JVM for any vendor?
+
+The Sun, Mac, and IBM vms are regularly tested, however any vm should work.
+
+<a name="FAQ-WhichversionofJavaisrequiredtorunOpenEJB?"></a>
+### Which version of Java is required to run OpenEJB?
+
+Java versions 5 or 6, aka Java 1.5 or 1.6.
+
+<a name="FAQ-DoIneedApacheMaventoworkwithOpenEJB?"></a>
+### Do I need Apache Maven to work with OpenEJB?
+
+Definitely not. Most of the examples include both Maven and Ant build
+files.	OpenEJB is usable as a plain library, much like an embedded
+database like Derby, so it is usable in any application regardless if that
+application is run via Maven, Ant, Intellij, Eclipse, NetBeans, JUnit,
+TestNG, etc.
+
+h3. Can I start and stop OpenEJB from an IDE? If yes, which IDE is
+supported by OpenEJB?
+
+The short answer is yes.  The basic approach for all embedding scenarios is
+to 1) add OpenEJB to your classpath, and 2) construct your InitialContext
+using org.apache.openejb.client.LocalInitialContextFactory.  The
+LocalInitialContextFactory will boot OpenEJB in your vm and all ejb
+applications visible in the classpath will be deployed. See
+http://openejb.apache.org/embedding-openejb.html for details on how to
+embed openejb in your application and IDE.  See [Application discovery via the classpath](openejbx30:application-discovery-via-the-classpath.html)
+ for various ways to have your applications discovered. 
+
+
+h3.  During embedded testing, how can I externalize all my DataSource
+configuration? 
+
+Create an openejb.xml file in any directory that gets added to your test
+classpath. For maven, something that winds up directly under
+"target/classes/" or "target/test-classes/" will work just fine.  Then in
+your test case do this:
+
+       protected void setUp() throws Exception {
+           Properties properties = new Properties();
+           properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
+"org.apache.openejb.client.LocalInitialContextFactory");
+    
+           URL config =
+this.getClass().getClassLoader().getResource("openejb.xml");
+           properties.setProperty("openejb.configuration",
+config.toExternalForm());
+    
+           initialContext = new InitialContext(properties);
+       }
+
+The file itself doesn't have to be called "openejb.xml", you could have a
+few different files like that for different testing scenarios each with a
+name that describes the basic setup.
+
+<a name="FAQ-Container-ManagedPersistence"></a>
+## Container-Managed Persistence
+
+<a name="FAQ-WhatenginedoesOpenEJBuseforCMP?"></a>
+### What engine does OpenEJB use for CMP?
+
+The CMP engine is written as a layer over JPA with OpenJPA doing the
+persistence work.
+
+<a name="FAQ-WhatistheformatfortheCMPmappingfiles?"></a>
+### What is the format for the CMP mapping files?
+
+The standard JPA mapping file and annotations are also used for CMP
+mappings.
+

Added: openejb/site/trunk/content/faq_openejb-jar.html.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/faq_openejb-jar.html.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/faq_openejb-jar.html.cwiki (added)
+++ openejb/site/trunk/content/faq_openejb-jar.html.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+Need Complete stes to deploy a bean using openejb
\ No newline at end of file

Propchange: openejb/site/trunk/content/faq_openejb-jar.html.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/faq_openejb-jar.html.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/faq_openejb-jar.html.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/faq_openejb-jar.html.mdtext (added)
+++ openejb/site/trunk/content/faq_openejb-jar.html.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,2 @@
+Title: faq_openejb-jar.html
+Need Complete stes to deploy a bean using openejb

Added: openejb/site/trunk/content/features.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/features.cwiki?rev=1144777&view=auto
==============================================================================
    (empty)

Propchange: openejb/site/trunk/content/features.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/features.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/features.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/features.mdtext (added)
+++ openejb/site/trunk/content/features.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+Title: Features

Added: openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/functional-testing-with-openejb%2C-jetty-and-selenium.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.cwiki (added)
+++ openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,204 @@
+Obviously, OpenEJB is great for unit testing EJBs, but I wondered whether I might also be able to use this embedded functionality to functionally test my application. You can use tools like Selenium, or HtmlUnit to run functional tests as if the user were sat at their browser typing text, and clicking links and buttons. This however means you have to have your app running on your app server, and you need to have consistent test data - otherwise a test might pass on one developers machine, but fail on another. Here's one approach that you could take to completely deploy your webapp within a test, and functionally test it with a tool like Selenium. There's also some sample code demonstrating this, available [here|http://people.apache.org/~jgallimore/PersonApp.zip].
+
+
+h3. Creating an embedded server
+
+I created a class to start my embedded OpenEJB and Jetty instances and configure them to see the EJB and WAR modules of my application:
+
+{noformat}
+public class EmbeddedServer {
+    private static EmbeddedServer instance = new EmbeddedServer();
+    private Server server;
+
+    private EmbeddedServer() {
+        try {
+            // initialize OpenEJB & add some test data
+            Properties properties = new Properties();
+            properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+            InitialContext ic = new InitialContext(properties);
+            PeopleFacade facade = (PeopleFacade) ic.lookup("PeopleFacadeEJBRemote");
+            new TestFixture(facade).addTestData();
+
+            // setup web app
+            WebAppContext context = new WebAppContext();
+            context.setWar(computeWarPath());
+            InitialContext initialContext = setupJndi(context);
+
+            // start the server
+            context.setServletHandler(new EmbeddedServerServletHandler(initialContext));
+            context.setContextPath("/");
+            server = new Server(9091);
+            server.addHandler(context);
+
+            server.start();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private InitialContext setupJndi(WebAppContext context) throws NamingException {
+        // setup local JNDI
+        InitialContext initialContext = new InitialContext();
+        WebApp webApp = getWebApp(context);
+        Collection<EjbRef> refs = webApp.getEjbRef();
+        for (EjbRef ref : refs) {
+            String ejbLink = ref.getEjbLink();
+
+            // get enterprise bean info
+            EnterpriseBeanInfo beanInfo = new EJBHelper().getEJBInfo(ejbLink);
+            if (beanInfo.jndiNames != null && beanInfo.jndiNames.size() > 0) {
+                String jndiName = "java:openejb/ejb/" + beanInfo.jndiNames.get(0);
+                initialContext.bind("java:comp/env/" + ref.getEjbRefName(), new LinkRef(jndiName));
+            }
+        }
+        return initialContext;
+    }
+
+    private String computeWarPath() {
+        String currentPath = new File(".").getAbsolutePath();
+        String warPath;
+
+        String[] pathParts = currentPath.split("(\\\\|/)+");
+
+        int webPart = Arrays.asList(pathParts).indexOf("PersonWEB");
+        if (webPart == -1) {
+            warPath = "PersonWEB/src/main/webapp";
+        } else {
+            StringBuffer buffer = new StringBuffer();
+
+            for (int i = 0; i < webPart; i++) {
+                buffer.append(pathParts[i]);
+                buffer.append(File.separator);
+            }
+
+            buffer.append("PersonWEB/src/main/webapp");
+            warPath = buffer.toString();
+        }
+        return warPath;
+    }
+
+    public static EmbeddedServer getInstance() {
+        return instance;
+    }
+
+    public Server getServer() {
+        return server;
+    }
+
+    public static void main(String[] args) {
+        try {
+            EmbeddedServer.getInstance().getServer().join();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private WebApp getWebApp(WebAppContext context) {
+        WebApp webApp = null;
+
+        try {
+            FileInputStream is = new FileInputStream(new File(context.getWar() + "/WEB-INF/web.xml").getAbsolutePath());
+            webApp = (WebApp) JaxbJavaee.unmarshal(WebApp.class, is);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return webApp;
+    }
+} 
+{noformat}
+
+This class sets up an embedded instance of Jetty, running on port 9091. You'll notice the setupJndi() method. This looks through the ejb-ref entries in web.xml (which we deserialize using the openejb-jee library), and adds relevant LinkRefs to the JNDI tree, so you can lookup beans using the java:comp/env/bean format. I've added a main() method here for convenience, so you can run this straight from an IDE, and record tests using tools like the Selenium Firefox plugin.
+
+h3. Supporting @EJB Dependency injection
+
+In the last code sample, we also set up a custom ServletHandler in Jetty - this is to perform dependency injection. The custom ServletHandler looks like this:
+
+{noformat}
+public class EmbeddedServerServletHandler extends ServletHandler {
+    private InitialContext initialContext;
+
+    public EmbeddedServerServletHandler(InitialContext initialContext) {
+        this.initialContext = initialContext;
+    }
+
+    public Servlet customizeServlet(Servlet servlet) throws Exception {
+        Class<? extends Servlet> servletClass = servlet.getClass();
+        Field[] declaredFields = servletClass.getDeclaredFields();
+
+        for (Field declaredField : declaredFields) {
+            Annotation[] annotations = declaredField.getAnnotations();
+
+            for (Annotation annotation : annotations) {
+                if (EJB.class.equals(annotation.annotationType())) {
+                    // inject into this field
+                    Class<?> fieldType = declaredField.getType();
+                    EnterpriseBeanInfo beanInfo = getBeanFor(fieldType);
+                    if (beanInfo == null) {
+                        continue;
+                    }
+                   
+                    String jndiName = "java:openejb/ejb/" + beanInfo.jndiNames.get(0);
+                    Object o = initialContext.lookup(jndiName);
+
+                    declaredField.setAccessible(true);
+                    declaredField.set(servlet, o);
+                }
+            }
+        }
+
+        return super.customizeServlet(servlet);
+    }
+
+    private EnterpriseBeanInfo getBeanFor(Class<?> fieldType) {
+        return new EJBHelper().getBeanInfo(fieldType);
+    }
+} 
+
+{noformat}
+
+This looks up deployed beans that match the field type, and uses reflection to set the field.
+
+h3. Writing a Functional test
+
+We can now write a functional test. I use a base abstract class to make sure the Embedded server is running, and start Selenium:
+
+{noformat}
+public abstract class FunctionalTestCase extends TestCase {
+    protected DefaultSelenium selenium;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        EmbeddedServer.getInstance();
+        selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost:9091/");
+        selenium.start();
+    }
+
+    protected void tearDown() throws Exception {
+        selenium.stop();
+    }
+}
+{noformat}
+
+and I can then I write a test like this:
+
+{noformat}
+public class AddPersonTest extends FunctionalTestCase {
+    public void testShouldAddAPerson() throws Exception {
+        selenium.open("/People");
+        selenium.type("firstname", "Jonathan");
+        selenium.type("lastname", "Gallimore");
+        selenium.click("//input[@name='add' and @value='Add']");
+        selenium.waitForPageToLoad("30000");
+        selenium.type("filter", "gallimore");
+        selenium.click("submit");
+        selenium.waitForPageToLoad("30000");
+        assertEquals(1, selenium.getXpathCount("//div[@id='people']/ul/li").intValue());
+        assertEquals("Jonathan Gallimore", selenium.getText("//div[@id='people']/ul/li[1]"));
+
+    }
+} 
+{noformat}
+
+h3. Sample code
+
+I've made a sample project which demonstrates this, source is available [here|http://people.apache.org/~jgallimore/PersonApp.zip]. You'll need Maven to build it, and you can build it and run the tests by running 'mvn clean install'. If want to run the tests from your IDE, you'll need to have a Selenium server running, which you can do by running 'mvn selenium:start-server'. 
\ No newline at end of file

Propchange: openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/functional-testing-with-openejb%2C-jetty-and-selenium.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.mdtext (added)
+++ openejb/site/trunk/content/functional-testing-with-openejb,-jetty-and-selenium.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,253 @@
+Title: Functional testing with OpenEJB, Jetty and Selenium
+Obviously, OpenEJB is great for unit testing EJBs, but I wondered whether I
+might also be able to use this embedded functionality to functionally test
+my application. You can use tools like Selenium, or HtmlUnit to run
+functional tests as if the user were sat at their browser typing text, and
+clicking links and buttons. This however means you have to have your app
+running on your app server, and you need to have consistent test data -
+otherwise a test might pass on one developers machine, but fail on another.
+Here's one approach that you could take to completely deploy your webapp
+within a test, and functionally test it with a tool like Selenium. There's
+also some sample code demonstrating this, available [here](http://people.apache.org/~jgallimore/PersonApp.zip)
+.
+
+
+<a name="FunctionaltestingwithOpenEJB,JettyandSelenium-Creatinganembeddedserver"></a>
+### Creating an embedded server
+
+I created a class to start my embedded OpenEJB and Jetty instances and
+configure them to see the EJB and WAR modules of my application:
+
+
+    public class EmbeddedServer {
+        private static EmbeddedServer instance = new EmbeddedServer();
+        private Server server;
+    
+        private EmbeddedServer() {
+    	try {
+    	    // initialize OpenEJB & add some test data
+    	    Properties properties = new Properties();
+    	    properties.put(Context.INITIAL_CONTEXT_FACTORY,
+"org.apache.openejb.client.LocalInitialContextFactory");
+    	    InitialContext ic = new InitialContext(properties);
+    	    PeopleFacade facade = (PeopleFacade)
+ic.lookup("PeopleFacadeEJBRemote");
+    	    new TestFixture(facade).addTestData();
+    
+    	    // setup web app
+    	    WebAppContext context = new WebAppContext();
+    	    context.setWar(computeWarPath());
+    	    InitialContext initialContext = setupJndi(context);
+    
+    	    // start the server
+    	    context.setServletHandler(new
+EmbeddedServerServletHandler(initialContext));
+    	    context.setContextPath("/");
+    	    server = new Server(9091);
+    	    server.addHandler(context);
+    
+    	    server.start();
+    	} catch (Exception e) {
+    	    e.printStackTrace();
+    	}
+        }
+    
+        private InitialContext setupJndi(WebAppContext context) throws
+NamingException {
+    	// setup local JNDI
+    	InitialContext initialContext = new InitialContext();
+    	WebApp webApp = getWebApp(context);
+    	Collection<EjbRef> refs = webApp.getEjbRef();
+    	for (EjbRef ref : refs) {
+    	    String ejbLink = ref.getEjbLink();
+    
+    	    // get enterprise bean info
+    	    EnterpriseBeanInfo beanInfo = new
+EJBHelper().getEJBInfo(ejbLink);
+    	    if (beanInfo.jndiNames != null && beanInfo.jndiNames.size() >
+0) {
+    		String jndiName = "java:openejb/ejb/" +
+beanInfo.jndiNames.get(0);
+    		initialContext.bind("java:comp/env/" + ref.getEjbRefName(),
+new LinkRef(jndiName));
+    	    }
+    	}
+    	return initialContext;
+        }
+    
+        private String computeWarPath() {
+    	String currentPath = new File(".").getAbsolutePath();
+    	String warPath;
+    
+            String[]
+ pathParts = currentPath.split("(\\\\|/)+");
+    
+    	int webPart = Arrays.asList(pathParts).indexOf("PersonWEB");
+    	if (webPart == -1) {
+    	    warPath = "PersonWEB/src/main/webapp";
+    	} else {
+    	    StringBuffer buffer = new StringBuffer();
+    
+    	    for (int i = 0; i < webPart; i++) {
+                    buffer.append(pathParts[i]
+);
+    		buffer.append(File.separator);
+    	    }
+    
+    	    buffer.append("PersonWEB/src/main/webapp");
+    	    warPath = buffer.toString();
+    	}
+    	return warPath;
+        }
+    
+        public static EmbeddedServer getInstance() {
+    	return instance;
+        }
+    
+        public Server getServer() {
+    	return server;
+        }
+    
+        public static void main(String[]
+ args) {
+    	try {
+    	    EmbeddedServer.getInstance().getServer().join();
+    	} catch (Exception e) {
+    	    e.printStackTrace();
+    	}
+        }
+    
+        private WebApp getWebApp(WebAppContext context) {
+    	WebApp webApp = null;
+    
+    	try {
+    	    FileInputStream is = new FileInputStream(new
+File(context.getWar() + "/WEB-INF/web.xml").getAbsolutePath());
+    	    webApp = (WebApp) JaxbJavaee.unmarshal(WebApp.class, is);
+    	} catch (Exception e) {
+    	    e.printStackTrace();
+    	}
+    	return webApp;
+        }
+    } 
+
+
+This class sets up an embedded instance of Jetty, running on port 9091.
+You'll notice the setupJndi() method. This looks through the ejb-ref
+entries in web.xml (which we deserialize using the openejb-jee library),
+and adds relevant LinkRefs to the JNDI tree, so you can lookup beans using
+the java:comp/env/bean format. I've added a main() method here for
+convenience, so you can run this straight from an IDE, and record tests
+using tools like the Selenium Firefox plugin.
+
+<a name="FunctionaltestingwithOpenEJB,JettyandSelenium-Supporting@EJBDependencyinjection"></a>
+### Supporting @EJB Dependency injection
+
+In the last code sample, we also set up a custom ServletHandler in Jetty -
+this is to perform dependency injection. The custom ServletHandler looks
+like this:
+
+
+    public class EmbeddedServerServletHandler extends ServletHandler {
+        private InitialContext initialContext;
+    
+        public EmbeddedServerServletHandler(InitialContext initialContext) {
+    	this.initialContext = initialContext;
+        }
+    
+        public Servlet customizeServlet(Servlet servlet) throws Exception {
+    	Class<? extends Servlet> servletClass = servlet.getClass();
+            Field[]
+ declaredFields = servletClass.getDeclaredFields();
+    
+    	for (Field declaredField : declaredFields) {
+                Annotation[]
+ annotations = declaredField.getAnnotations();
+    
+    	    for (Annotation annotation : annotations) {
+    		if (EJB.class.equals(annotation.annotationType())) {
+    		    // inject into this field
+    		    Class<?> fieldType = declaredField.getType();
+    		    EnterpriseBeanInfo beanInfo = getBeanFor(fieldType);
+    		    if (beanInfo == null) {
+    			continue;
+    		    }
+                       
+    		    String jndiName = "java:openejb/ejb/" +
+beanInfo.jndiNames.get(0);
+    		    Object o = initialContext.lookup(jndiName);
+    
+    		    declaredField.setAccessible(true);
+    		    declaredField.set(servlet, o);
+    		}
+    	    }
+    	}
+    
+    	return super.customizeServlet(servlet);
+        }
+    
+        private EnterpriseBeanInfo getBeanFor(Class<?> fieldType) {
+    	return new EJBHelper().getBeanInfo(fieldType);
+        }
+    } 
+    
+
+
+This looks up deployed beans that match the field type, and uses reflection
+to set the field.
+
+<a name="FunctionaltestingwithOpenEJB,JettyandSelenium-WritingaFunctionaltest"></a>
+### Writing a Functional test
+
+We can now write a functional test. I use a base abstract class to make
+sure the Embedded server is running, and start Selenium:
+
+
+    public abstract class FunctionalTestCase extends TestCase {
+        protected DefaultSelenium selenium;
+    
+        protected void setUp() throws Exception {
+    	super.setUp();
+    	EmbeddedServer.getInstance();
+    	selenium = new DefaultSelenium("localhost", 4444, "*iexplore",
+"http://localhost:9091/");
+    	selenium.start();
+        }
+    
+        protected void tearDown() throws Exception {
+    	selenium.stop();
+        }
+    }
+
+
+and I can then I write a test like this:
+
+
+    public class AddPersonTest extends FunctionalTestCase {
+        public void testShouldAddAPerson() throws Exception {
+    	selenium.open("/People");
+    	selenium.type("firstname", "Jonathan");
+    	selenium.type("lastname", "Gallimore");
+            selenium.click("//input[@name='add' and @value='Add']
+");
+    	selenium.waitForPageToLoad("30000");
+    	selenium.type("filter", "gallimore");
+    	selenium.click("submit");
+    	selenium.waitForPageToLoad("30000");
+            assertEquals(1, selenium.getXpathCount("//div[@id='people']
+/ul/li").intValue());
+            assertEquals("Jonathan Gallimore", selenium.getText("//div[@id='people']
+/ul/li[1]"));
+    
+        }
+    } 
+
+
+<a name="FunctionaltestingwithOpenEJB,JettyandSelenium-Samplecode"></a>
+### Sample code
+
+I've made a sample project which demonstrates this, source is available [here](http://people.apache.org/~jgallimore/PersonApp.zip)
+. You'll need Maven to build it, and you can build it and run the tests by
+running 'mvn clean install'. If want to run the tests from your IDE, you'll
+need to have a Selenium server running, which you can do by running 'mvn
+selenium:start-server'. 

Added: openejb/site/trunk/content/generating-ejb-3-annotations.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/generating-ejb-3-annotations.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/generating-ejb-3-annotations.cwiki (added)
+++ openejb/site/trunk/content/generating-ejb-3-annotations.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,39 @@
+h1. Generating EJB 3 annotations
+
+The OpenEJB Eclipse plugin is able to provide some assistance in helping you migrate EJB 2.x projects to EJB 3.0, by analyzing your ejb-jar.xml file, and adding EJB annotations to your source code. This page will show you how to use this functionality.
+
+First of all you will need to add the EJB 3.0 API jars to the classpath of your project. If you are using Maven, you can add the following to your POM (you will need to update your Eclipse project using mvn eclipse:eclipse afterwards)
+
+{code}
+  <dependencies>
+    ...
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>javaee-api</artifactId>
+      <version>5.0-1</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+{code}
+
+Alternatively, import the API jars into your project, and add them to your build path.
+
+Next, click the 'OpenEJB' menu on the menubar, and select 'Generate Annotations'.
+
+!http://www.jrg.me.uk/openejb/annotations_step_1.jpg!
+
+Select the project you would like to work with, if it isn't already selected. Click 'Next'.
+
+!http://www.jrg.me.uk/openejb/annotations_step_2.jpg!
+
+Select your ejb-jar.xml and (optionally) your openejb-jar.xml files. Select or deselect the other options as appropriate, and select 'Next'.
+
+Options:
+
+    * Alter SessionBean interfaces - This option makes your session beans implement your remote / local interfaces as opposed to javax.ejb.SessionBean, and stops your remote / local interfaces extending javax.ejb.EJBObject.
+    * Add @Remote and @RemoteHome annotations - This adds @Remote and @RemoteHome annotations appropriately
+    * Convert entity beans to POJOs - This options converts abstract CMP classes to POJOs generating simple getters and setters.
+
+!http://www.jrg.me.uk/openejb/annotations_step_3.jpg!
+
+Review the changes that the plugin will make to your source code. Uncheck any changes you don't want to apply, and click 'Finish'.

Propchange: openejb/site/trunk/content/generating-ejb-3-annotations.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/generating-ejb-3-annotations.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/generating-ejb-3-annotations.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/generating-ejb-3-annotations.mdtext (added)
+++ openejb/site/trunk/content/generating-ejb-3-annotations.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,57 @@
+Title: Generating EJB 3 annotations
+<a name="GeneratingEJB3annotations-GeneratingEJB3annotations"></a>
+# Generating EJB 3 annotations
+
+The OpenEJB Eclipse plugin is able to provide some assistance in helping
+you migrate EJB 2.x projects to EJB 3.0, by analyzing your ejb-jar.xml
+file, and adding EJB annotations to your source code. This page will show
+you how to use this functionality.
+
+First of all you will need to add the EJB 3.0 API jars to the classpath of
+your project. If you are using Maven, you can add the following to your POM
+(you will need to update your Eclipse project using mvn eclipse:eclipse
+afterwards)
+
+
+      <dependencies>
+        ...
+        <dependency>
+          <groupId>org.apache.openejb</groupId>
+          <artifactId>javaee-api</artifactId>
+          <version>5.0-1</version>
+          <scope>provided</scope>
+        </dependency>
+      </dependencies>
+
+
+Alternatively, import the API jars into your project, and add them to your
+build path.
+
+Next, click the 'OpenEJB' menu on the menubar, and select 'Generate
+Annotations'.
+
+!http://www.jrg.me.uk/openejb/annotations_step_1.jpg!
+
+Select the project you would like to work with, if it isn't already
+selected. Click 'Next'.
+
+!http://www.jrg.me.uk/openejb/annotations_step_2.jpg!
+
+Select your ejb-jar.xml and (optionally) your openejb-jar.xml files. Select
+or deselect the other options as appropriate, and select 'Next'.
+
+Options:
+
+    * Alter SessionBean interfaces - This option makes your session beans
+implement your remote / local interfaces as opposed to
+javax.ejb.SessionBean, and stops your remote / local interfaces extending
+javax.ejb.EJBObject.
+    * Add @Remote and @RemoteHome annotations - This adds @Remote and
+@RemoteHome annotations appropriately
+    * Convert entity beans to POJOs - This options converts abstract CMP
+classes to POJOs generating simple getters and setters.
+
+!http://www.jrg.me.uk/openejb/annotations_step_3.jpg!
+
+Review the changes that the plugin will make to your source code. Uncheck
+any changes you don't want to apply, and click 'Finish'.

Added: openejb/site/trunk/content/geronimo.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/geronimo.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/geronimo.cwiki (added)
+++ openejb/site/trunk/content/geronimo.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,3 @@
+OpenEJB is the EJB Container implementation for [Apache Geronimo|http://geronimo.apache.org].  That integration is quite a bit different than what OpenEJB users are familiar with.  The best source of documentation on Geronimo and it's usage of OpenEJB is here:  
+
+ - [http://geronimo.apache.org/documentation.html]

Propchange: openejb/site/trunk/content/geronimo.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/geronimo.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/geronimo.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/geronimo.mdtext (added)
+++ openejb/site/trunk/content/geronimo.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,7 @@
+Title: Geronimo
+OpenEJB is the EJB Container implementation for [Apache Geronimo](http://geronimo.apache.org)
+.  That integration is quite a bit different than what OpenEJB users are
+familiar with.	The best source of documentation on Geronimo and it's usage
+of OpenEJB is here:  
+
+ - [http://geronimo.apache.org/documentation.html](http://geronimo.apache.org/documentation.html)

Added: openejb/site/trunk/content/getting-support.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/getting-support.cwiki?rev=1144777&view=auto
==============================================================================
    (empty)

Propchange: openejb/site/trunk/content/getting-support.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/getting-support.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/getting-support.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/getting-support.mdtext (added)
+++ openejb/site/trunk/content/getting-support.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+Title: Getting Support

Added: openejb/site/trunk/content/hello-world.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/hello-world.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/hello-world.cwiki (added)
+++ openejb/site/trunk/content/hello-world.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+{include:OPENEJBx30:Hello World}
\ No newline at end of file

Propchange: openejb/site/trunk/content/hello-world.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/hello-world.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/hello-world.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/hello-world.mdtext (added)
+++ openejb/site/trunk/content/hello-world.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,2 @@
+Title: Hello World
+{include:OPENEJBx30:Hello World}

Added: openejb/site/trunk/content/homebasediscussion.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/homebasediscussion.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/homebasediscussion.cwiki (added)
+++ openejb/site/trunk/content/homebasediscussion.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,167 @@
+{note:title=THIS PAGE IS ARCHIVED FOR THE MOMENT AND WILL BE REMOVED LATER. }
+h1. Life in 0.9.2
+
+Some background on how a 0.9.2 installation behaves.
+
+h2.  Basic layout
+
+Basically, openejb.base is the source for 100% of all configuration information and third party config files (log4j, castor, instantdb, whatever).  This includes finding where the, possibly many, <Deployment> entries in the openejb.conf point.  The openejb.home is where the code loading OpenEJB will look for all the OpenEJB libraries.  Usually openejb.base is not explicitly set and defaults to the value of openejb.home, so many people are used to only dealing with openejb.home.
+
+The point of having and openejb.base and openejb.home was basically to allow several independently configured instances of OpenEJB running on a system (perhaps embedded in Swing apps, in Tomcat, running as a standalone Server, or even in Groovy as Mr. Strachan did!) but without the need to copy all the OpenEJB system libraries everywhere.
+
+*openejb.home* 
+  * can be set explicitly via a system property.  
+  * if not set it default's to user.dir, which is the current working directory.
+See [source code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/FileUtils.java?r=1.7.4.3#l58]
+
+*openejb.base*
+  * can be set explicitly via a system property.  
+  * If not set it default's to openejb.home.
+See [source code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/FileUtils.java?r=1.7.4.3#l59]
+
+*openejb.configuration*
+  * can be set to explicitly point to the file containing your configuration.  
+  * If set to a relative path, we first look in user.dir/your-conf-file, then in openejb.base/your-conf-file
+  * If not set we check in openejb.base/conf/openejb.conf
+  * If no conf file is found, we create one in openejb.base/conf/openejb.conf
+See [source code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/config/ConfigUtils.java?r=1.21.2.1#l269]
+
+
+*relative paths in openejb.conf*
+  * Deployment entries are resolved relative to openejb.base.  [source code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/config/ConfigurationFactory.java?r=1.22.2.1#l969]
+  * Containers (such as the Castor CMP Container) use openejb.base to resolve their own config files.  Kind of an [ugly hack|
+http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java?r=1.16.2.6#l404] to get Castor JDO to load the database.xml and all other files from the right place, but it works.
+  * Resource adapters that are embedded usually have config files of their own and are also loaded from the openeb.base.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java?r=1.7#l71].  Again that could be done better.
+
+Note:  Both Containers and Resources are what OpenEJB thinks of as [Services|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/spi/Service.java?r=1.2#l47] which have an init method.  In hindsight, both hacks to the JDBC Resouces Adapter and Castor CMP Container could be removed if we simply guaranteed that a Service's init method is called "relative" to the openejb.base dir.
+
+*log files*
+  * The log4.configuration file is resolved relative to openejb.base.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/Logger.java?r=1.11.4.3#l1601]
+  * The properties in the config file that point to files are also resolved relative to openejb.base.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/Logger.java?r=1.11.4.3#l1632]
+
+*OpenEJB libraries*
+  * The jars in the [lib and dist|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/server/org/openejb/server/Main.java?r=1.3] directories under openejb.home are [added to the classpath|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/ClasspathUtils.java?r=1.5.2.1#l95].
+
+h2. Summary
+
+A summary of the above in a different notation:
+
+{noformat}
+openejb.home = user.dir (can be set explicitly)
+openejb.base = openejb.home (can be set explicitly)
+openejb.conf = openejb.base/conf/openejb.conf (can be set explicitly)
+logging.conf = openejb.base/conf/logging.conf (can be set explicitly)
+deployments  = paths listed in openejb.conf (relative paths resolved from openejb.base)
+Classpath includes openejb.home/lib and openejb.home/dist
+{noformat}
+
+h2. Example layout
+
+In this one the openejb.home and openejb.base are set, everything else is defaulted.  The openejb.conf file as been updated to point to the ejb jars by name (abc-ejbs.jar and xyz-ejbs.jar).
+
+An example layout:
+{noformat}
+/usr/local/openejb  (openejb.home)
+/usr/local/openejb/lib  (in classpath)
+/usr/local/openejb/dist (in classpath)
+/home/jsmith/foo_app  (openejb.base)
+/home/jsmith/foo_app/conf/openejb.conf
+/home/jsmith/foo_app/conf/logging.conf
+/home/jsmith/foo_app/abc-ejbs.jar (Deployment entry in openejb.conf)
+/home/jsmith/foo_app/xyz-ejbs.jar (Deployment entry in openejb.conf)
+/home/jsmith/foo_app/logs/  
+{noformat}
+
+
+h2. Another Example layout
+
+In this example openejb.home and openejb.base are setup as well as the explicit paths for the openejb and log4j configuration files.
+
+An example layout:
+{noformat}
+/usr/local/openejb  (openejb.home)
+/usr/local/openejb/lib  (in classpath)
+/usr/local/openejb/dist (in classpath)
+/home/jsmith/foo_app  (openejb.base)
+/home/jsmith/foo_app/openejb.xml  (openejb.configuration)
+/home/jsmith/foo_app/abc-ejbs.jar (Deployment entry in openejb.xml)
+/home/jsmith/foo_app/xyz-ejbs.jar (Deployment entry in openejb.xml)
+/home/jsmith/foo_app/log4j.conf  (log4j.configuration)
+/home/jsmith/foo_app/mylogs/  (logging dir as defined in log4j.conf)
+{noformat}
+
+h2.  Possible and nice Tomcat setup.
+
+Set openejb.base to be the same as catalina.home, then OpenEJB and Tomcat will share the same conf and logs directories.
+
+h1.  Current OpenEJB 1.0 layout
+
+In the current 1.0 code, user.dir and openejb.home and openejb.base are essentially aggregated together to create a larger layout for a single running OpenEJB instance.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/util/FileUtils.java?r=1.4#l267]
+
+*openejb.home* 
+  * can be set explicitly via a system property.  
+  * if not set it default's to user.dir, which is the current working directory.
+Same as 0.9.2
+
+*openejb.base*
+  * can be set explicitly via a system property.  
+  * If not set it default's to openejb.home.
+Same as 0.9.2
+
+*openejb.configuration*
+  * can be set to explicitly point to the file containing your configuration.  
+  * If set to a relative path, we first look in user.dir/your-conf-file, then in openejb.base/your-conf-file, openejb.home/your-conf-file.
+  * If not set we check in openejb.base/conf/openejb.conf, then openejb.home/conf/openejb.conf
+  * If no conf file is found, we create one in openejb.base/conf/openejb.conf
+
+*relative paths in openejb.conf*
+  * Deployment entries are resolved relative to openejb.base, then openejb.home.  [source code|http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/alt/config/ConfigurationFactory.java?r=1.6#l1120]
+  * Containers (such as the Castor CMP Container) use openejb.base to resolve their own config files.  (Same as 0.9.2)
+  * Resource adapters are loaded from the openeb.home, not openejb.base as in 0.9.2.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java?r=1.5#l147].
+
+*log files*
+  * The log4.configuration file is resolved relative to openejb.base, then openejb.home.
+  * Each property in the config file that point to files are also first resolved relative to openejb.base then openejb.home.  See [code|http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/util/Logger.java?r=1.6]
+
+*OpenEJB libraries*
+  * The jars in the directories under openejb.home are added to the classloader.
+
+
+h2.  Example
+
+An interesting note on this is that the openejb.home is only checked when the file or directory is not found in the openejb.base.  So say you had the following entries in your openejb.conf.
+
+{code:xml} 
+<Deployment dir="beans" />
+<Deployment jar="foobar.jar" />
+{code}
+ 
+Then say you have an openejb.home with the following files and directories:
+
+{noformat}
+/usr/local/openejb (openejb.home)
+/usr/local/openejb/dist/(multiple jars)
+/usr/local/openejb/lib/(multiple jars)
+/usr/local/openejb/conf/openejb.conf
+/usr/local/openejb/beans/widget.jar
+/usr/local/openejb/beans/dohickey.jar
+/usr/local/openejb/beans/gizmo.jar
+/usr/local/openejb/logs/  (default logging dir)
+{noformat}
+
+And an openejb.base with the following files and directories:
+
+{noformat}
+/home/jsmith/foo_app (openejb.base)
+/home/jsmith/foo_app/conf/openejb.conf (used for this app)
+/home/jsmith/foo_app/foobar.jar
+/home/jsmith/foo_app/log4j.conf  (log4j.configuration)
+/home/jsmith/foo_app/logs/  (logging dir as defined in log4j.conf)
+{noformat}
+
+In this setup you will end up using your own conf file, your own logging file and logs directory.  You will get the ejbs from foobar.jar located in your openejb.base and the ejbs from the widget.jar, dohickey.jar, and gizmo.jar files in openejb.home/beans.
+
+Let's say that later on you decide you don't like having the foobar.jar listed in your conf file and decide to create a beans dir in your openejb.base and put it there.  When you start up your openejb instance it will no longer contain the ejbs from the widget.jar, dohickey.jar, and gizmo.jar files.  They are in the openejb.home and the openejb.home is only checked when the file or directory is not found in the openejb.base.  By adding a beans directory to your openejb.base you also implicitly removed all the ejbs from openejb.home/beans.
+
+By adding to your base you are potentially removing parts of your configuration at the same time.
+{note}
\ No newline at end of file

Propchange: openejb/site/trunk/content/homebasediscussion.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/homebasediscussion.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/homebasediscussion.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/homebasediscussion.mdtext (added)
+++ openejb/site/trunk/content/homebasediscussion.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,234 @@
+Title: HomeBaseDiscussion
+{note:title=THIS PAGE IS ARCHIVED FOR THE MOMENT AND WILL BE REMOVED LATER.
+}
+<a name="HomeBaseDiscussion-Lifein0.9.2"></a>
+# Life in 0.9.2
+
+Some background on how a 0.9.2 installation behaves.
+
+<a name="HomeBaseDiscussion-Basiclayout"></a>
+##  Basic layout
+
+Basically, openejb.base is the source for 100% of all configuration
+information and third party config files (log4j, castor, instantdb,
+whatever).  This includes finding where the, possibly many, <Deployment>
+entries in the openejb.conf point.  The openejb.home is where the code
+loading OpenEJB will look for all the OpenEJB libraries.  Usually
+openejb.base is not explicitly set and defaults to the value of
+openejb.home, so many people are used to only dealing with openejb.home.
+
+The point of having and openejb.base and openejb.home was basically to
+allow several independently configured instances of OpenEJB running on a
+system (perhaps embedded in Swing apps, in Tomcat, running as a standalone
+Server, or even in Groovy as Mr. Strachan did!) but without the need to
+copy all the OpenEJB system libraries everywhere.
+
+*openejb.home* 
+  * can be set explicitly via a system property.  
+  * if not set it default's to user.dir, which is the current working
+directory.
+See [source code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/FileUtils.java?r=1.7.4.3#l58)
+
+*openejb.base*
+  * can be set explicitly via a system property.  
+  * If not set it default's to openejb.home.
+See [source code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/FileUtils.java?r=1.7.4.3#l59)
+
+*openejb.configuration*
+  * can be set to explicitly point to the file containing your
+configuration.	
+  * If set to a relative path, we first look in user.dir/your-conf-file,
+then in openejb.base/your-conf-file
+  * If not set we check in openejb.base/conf/openejb.conf
+  * If no conf file is found, we create one in
+openejb.base/conf/openejb.conf
+See [source code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/config/ConfigUtils.java?r=1.21.2.1#l269)
+
+
+*relative paths in openejb.conf*
+  * Deployment entries are resolved relative to openejb.base.  [source code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/config/ConfigurationFactory.java?r=1.22.2.1#l969)
+  * Containers (such as the Castor CMP Container) use openejb.base to
+resolve their own config files.  Kind of an [ugly hack|
+http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java?r=1.16.2.6#l404]
+ to get Castor JDO to load the database.xml and all other files from the
+right place, but it works.
+  * Resource adapters that are embedded usually have config files of their
+own and are also loaded from the openeb.base.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/facilities/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java?r=1.7#l71)
+.  Again that could be done better.
+
+Note:  Both Containers and Resources are what OpenEJB thinks of as [Services](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/spi/Service.java?r=1.2#l47)
+ which have an init method.  In hindsight, both hacks to the JDBC Resouces
+Adapter and Castor CMP Container could be removed if we simply guaranteed
+that a Service's init method is called "relative" to the openejb.base dir.
+
+*log files*
+  * The log4.configuration file is resolved relative to openejb.base.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/Logger.java?r=1.11.4.3#l1601)
+  * The properties in the config file that point to files are also resolved
+relative to openejb.base.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/Logger.java?r=1.11.4.3#l1632)
+
+*OpenEJB libraries*
+  * The jars in the [lib and dist](http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/server/org/openejb/server/Main.java?r=1.3)
+ directories under openejb.home are [added to the classpath|http://cvs.openejb.org/viewrep/openejb/openejb-sfnet/src/main/org/openejb/util/ClasspathUtils.java?r=1.5.2.1#l95]
+.
+
+<a name="HomeBaseDiscussion-Summary"></a>
+## Summary
+
+A summary of the above in a different notation:
+
+
+    openejb.home = user.dir (can be set explicitly)
+    openejb.base = openejb.home (can be set explicitly)
+    openejb.conf = openejb.base/conf/openejb.conf (can be set explicitly)
+    logging.conf = openejb.base/conf/logging.conf (can be set explicitly)
+    deployments  = paths listed in openejb.conf (relative paths resolved from
+openejb.base)
+    Classpath includes openejb.home/lib and openejb.home/dist
+
+
+<a name="HomeBaseDiscussion-Examplelayout"></a>
+## Example layout
+
+In this one the openejb.home and openejb.base are set, everything else is
+defaulted.  The openejb.conf file as been updated to point to the ejb jars
+by name (abc-ejbs.jar and xyz-ejbs.jar).
+
+An example layout:
+
+    /usr/local/openejb  (openejb.home)
+    /usr/local/openejb/lib	(in classpath)
+    /usr/local/openejb/dist (in classpath)
+    /home/jsmith/foo_app  (openejb.base)
+    /home/jsmith/foo_app/conf/openejb.conf
+    /home/jsmith/foo_app/conf/logging.conf
+    /home/jsmith/foo_app/abc-ejbs.jar (Deployment entry in openejb.conf)
+    /home/jsmith/foo_app/xyz-ejbs.jar (Deployment entry in openejb.conf)
+    /home/jsmith/foo_app/logs/  
+
+
+
+<a name="HomeBaseDiscussion-AnotherExamplelayout"></a>
+## Another Example layout
+
+In this example openejb.home and openejb.base are setup as well as the
+explicit paths for the openejb and log4j configuration files.
+
+An example layout:
+
+    /usr/local/openejb  (openejb.home)
+    /usr/local/openejb/lib	(in classpath)
+    /usr/local/openejb/dist (in classpath)
+    /home/jsmith/foo_app  (openejb.base)
+    /home/jsmith/foo_app/openejb.xml  (openejb.configuration)
+    /home/jsmith/foo_app/abc-ejbs.jar (Deployment entry in openejb.xml)
+    /home/jsmith/foo_app/xyz-ejbs.jar (Deployment entry in openejb.xml)
+    /home/jsmith/foo_app/log4j.conf  (log4j.configuration)
+    /home/jsmith/foo_app/mylogs/  (logging dir as defined in log4j.conf)
+
+
+<a name="HomeBaseDiscussion-PossibleandniceTomcatsetup."></a>
+##  Possible and nice Tomcat setup.
+
+Set openejb.base to be the same as catalina.home, then OpenEJB and Tomcat
+will share the same conf and logs directories.
+
+<a name="HomeBaseDiscussion-CurrentOpenEJB1.0layout"></a>
+#  Current OpenEJB 1.0 layout
+
+In the current 1.0 code, user.dir and openejb.home and openejb.base are
+essentially aggregated together to create a larger layout for a single
+running OpenEJB instance.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/util/FileUtils.java?r=1.4#l267)
+
+*openejb.home* 
+  * can be set explicitly via a system property.  
+  * if not set it default's to user.dir, which is the current working
+directory.
+Same as 0.9.2
+
+*openejb.base*
+  * can be set explicitly via a system property.  
+  * If not set it default's to openejb.home.
+Same as 0.9.2
+
+*openejb.configuration*
+  * can be set to explicitly point to the file containing your
+configuration.	
+  * If set to a relative path, we first look in user.dir/your-conf-file,
+then in openejb.base/your-conf-file, openejb.home/your-conf-file.
+  * If not set we check in openejb.base/conf/openejb.conf, then
+openejb.home/conf/openejb.conf
+  * If no conf file is found, we create one in
+openejb.base/conf/openejb.conf
+
+*relative paths in openejb.conf*
+  * Deployment entries are resolved relative to openejb.base, then
+openejb.home.  [source code](http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/alt/config/ConfigurationFactory.java?r=1.6#l1120)
+  * Containers (such as the Castor CMP Container) use openejb.base to
+resolve their own config files.  (Same as 0.9.2)
+  * Resource adapters are loaded from the openeb.home, not openejb.base as
+in 0.9.2.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java?r=1.5#l147)
+.
+
+*log files*
+  * The log4.configuration file is resolved relative to openejb.base, then
+openejb.home.
+  * Each property in the config file that point to files are also first
+resolved relative to openejb.base then openejb.home.  See [code](http://cvs.openejb.org/viewrep/openejb/openejb1/modules/core/src/java/org/openejb/util/Logger.java?r=1.6)
+
+*OpenEJB libraries*
+  * The jars in the directories under openejb.home are added to the
+classloader.
+
+
+<a name="HomeBaseDiscussion-Example"></a>
+##  Example
+
+An interesting note on this is that the openejb.home is only checked when
+the file or directory is not found in the openejb.base.  So say you had the
+following entries in your openejb.conf.
+
+
+    <Deployment dir="beans" />
+    <Deployment jar="foobar.jar" />
+
+ 
+Then say you have an openejb.home with the following files and directories:
+
+
+    /usr/local/openejb (openejb.home)
+    /usr/local/openejb/dist/(multiple jars)
+    /usr/local/openejb/lib/(multiple jars)
+    /usr/local/openejb/conf/openejb.conf
+    /usr/local/openejb/beans/widget.jar
+    /usr/local/openejb/beans/dohickey.jar
+    /usr/local/openejb/beans/gizmo.jar
+    /usr/local/openejb/logs/  (default logging dir)
+
+
+And an openejb.base with the following files and directories:
+
+
+    /home/jsmith/foo_app (openejb.base)
+    /home/jsmith/foo_app/conf/openejb.conf (used for this app)
+    /home/jsmith/foo_app/foobar.jar
+    /home/jsmith/foo_app/log4j.conf  (log4j.configuration)
+    /home/jsmith/foo_app/logs/  (logging dir as defined in log4j.conf)
+
+
+In this setup you will end up using your own conf file, your own logging
+file and logs directory.  You will get the ejbs from foobar.jar located in
+your openejb.base and the ejbs from the widget.jar, dohickey.jar, and
+gizmo.jar files in openejb.home/beans.
+
+Let's say that later on you decide you don't like having the foobar.jar
+listed in your conf file and decide to create a beans dir in your
+openejb.base and put it there.	When you start up your openejb instance it
+will no longer contain the ejbs from the widget.jar, dohickey.jar, and
+gizmo.jar files.  They are in the openejb.home and the openejb.home is only
+checked when the file or directory is not found in the openejb.base.  By
+adding a beans directory to your openejb.base you also implicitly removed
+all the ejbs from openejb.home/beans.
+
+By adding to your base you are potentially removing parts of your
+configuration at the same time.
+{note}

Added: openejb/site/trunk/content/homelinks.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/homelinks.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/homelinks.cwiki (added)
+++ openejb/site/trunk/content/homelinks.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,32 @@
+{panel:title=EJB3 Examples}
+Looking for an example of how to use an EJB 3.0 or OpenEJB feature?
+
+Check out the newly revised [examples|OPENEJBx30:Examples].  Examples include:
+- [Stateless|OPENEJBx30:Simple Stateless Example]
+- [Stateful|OPENEJBx30:Simple Stateful Example]
+- [Dependency Injection|OPENEJBx30:Custom Injection]
+- [Java Persistence API|OPENEJBx30:Injection of EntityManager Example]
+- [Transaction|OPENEJBx30:Testing Transactions Example]
+- [Security|OPENEJBx30:Testing Security Example]
+- [...and more|OPENEJBx30:Examples]
+{panel}
+
+{panel:title=OpenEJB Forums}
+The Nabble site as wonderful support for turning regular mailing lists into online forums.  We've setup OpenEJB and our forums are now open for business.  You can easily search and post to any of our mailing lists via any of the links below:
+
+- [OpenEJB Dev Forum|http://openejb.979440.n4.nabble.com/OpenEJB-Dev-f982480.html]
+- [OpenEJB User Forum|http://openejb.979440.n4.nabble.com/OpenEJB-User-f979441.html]
+{panel}
+
+{html}
+<script type="text/javascript" src="http://static.ak.connect.facebook.com/connect.php/en_US"></script><script type="text/javascript">FB.init("90761bf9d3677349c6a7c9eb5f98e57d");</script><fb:fan profile_id="326332702155" stream="0" connections="0" logobar="1" width="300"></fb:fan><div style="font-size:8px; padding-left:10px"></div>
+{html}
+
+{panel:title=Join us on twitter}
+{html}
+<div class="tweet" style="border:1 px solid"></div> 
+{html}
+{panel}
+{panel:title=Site Updates}
+{recently-updated:spaces=OPENEJB,OPENEJBx30}
+{panel}

Propchange: openejb/site/trunk/content/homelinks.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/homelinks.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/homelinks.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/homelinks.mdtext (added)
+++ openejb/site/trunk/content/homelinks.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,41 @@
+Title: HomeLinks
+{panel:title=EJB3 Examples}
+Looking for an example of how to use an EJB 3.0 or OpenEJB feature?
+
+Check out the newly revised [examples](openejbx30:examples.html)
+.  Examples include:
+- [Stateless](openejbx30:simple-stateless-example.html)
+- [Stateful](openejbx30:simple-stateful-example.html)
+- [Dependency Injection](openejbx30:custom-injection.html)
+- [Java Persistence API](openejbx30:injection-of-entitymanager-example.html)
+- [Transaction](openejbx30:testing-transactions-example.html)
+- [Security](openejbx30:testing-security-example.html)
+- [...and more](openejbx30:examples.html)
+{panel}
+
+{panel:title=OpenEJB Forums}
+The Nabble site as wonderful support for turning regular mailing lists into
+online forums.	We've setup OpenEJB and our forums are now open for
+business.  You can easily search and post to any of our mailing lists via
+any of the links below:
+
+- [OpenEJB Dev Forum](http://openejb.979440.n4.nabble.com/OpenEJB-Dev-f982480.html)
+- [OpenEJB User Forum](http://openejb.979440.n4.nabble.com/OpenEJB-User-f979441.html)
+{panel}
+
+{html}
+<script type="text/javascript"
+src="http://static.ak.connect.facebook.com/connect.php/en_US"></script><script
+type="text/javascript">FB.init("90761bf9d3677349c6a7c9eb5f98e57d");</script><fb:fan
+profile_id="326332702155" stream="0" connections="0" logobar="1"
+width="300"></fb:fan><div style="font-size:8px; padding-left:10px"></div>
+{html}
+
+{panel:title=Join us on twitter}
+{html}
+<div class="tweet" style="border:1 px solid"></div> 
+{html}
+{panel}
+{panel:title=Site Updates}
+{recently-updated:spaces=OPENEJB,OPENEJBx30}
+{panel}

Added: openejb/site/trunk/content/how-to-contribute.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/how-to-contribute.cwiki?rev=1144777&view=auto
==============================================================================
    (empty)

Propchange: openejb/site/trunk/content/how-to-contribute.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/how-to-contribute.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/how-to-contribute.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/how-to-contribute.mdtext (added)
+++ openejb/site/trunk/content/how-to-contribute.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+Title: How to contribute

Added: openejb/site/trunk/content/ide-integration.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/ide-integration.cwiki?rev=1144777&view=auto
==============================================================================
    (empty)

Propchange: openejb/site/trunk/content/ide-integration.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/ide-integration.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/ide-integration.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/ide-integration.mdtext (added)
+++ openejb/site/trunk/content/ide-integration.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+Title: IDE Integration

Added: openejb/site/trunk/content/index.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/index.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/index.cwiki (added)
+++ openejb/site/trunk/content/index.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,20 @@
+h1. Welcome to Apache OpenEJB! 
+
+Apache OpenEJB is an embeddable and lightweight EJB 3.0 implementation that can be used as a standalone server or embedded into Tomcat, JUnit, TestNG, Eclipse, IntelliJ, Maven, Ant, and any IDE or application. OpenEJB is included in Apache Geronimo, IBM WebSphere Application Server CE, and Apple's WebObjects. 
+
+h2. Major features
+ - Supports EJB 3.0, 2.1, 2.0, 1.1 in all modes; embedded, standalone or otherwise.
+ - JAX-WS support
+ - JMS support
+ - J2EE connector support
+ - Can be dropped into Tomcat 5 or 6 adding various JavaEE 5 and EJB 3.0 features to a standard Tomcat install.
+ - CMP support is implemented over JPA allowing to freely mix CMP and JPA usage.
+ - Complete support for Glassfish descriptors allowing those users to embedded test their applications.
+ - Incredibly flexible jndi name support allows you to specify formats at macro and micro levels and imitate the format of other vendors.
+ - Allows for easy testing and debugging in IDEs such as Eclipse, Idea Intellij or NetBeans with no plugins required.
+ - Usable in ordinary JUnit or other style test cases without complicated setup or external processes.
+ - Validates applications entirely and reports all failures at once, with three selectable levels of detail, avoiding several hours worth of "fix, recompile, redeploy, fail, repeat" cycles. 
+
+h1. News
+{blogrss:https://blogs.apache.org/openejb/feed/entries/atom}
+

Propchange: openejb/site/trunk/content/index.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native