Install/Configure Ebean

1. Classpath

Put in your classpath

avajeEbean.jar
avajeLib.jar
javax.persistence.jar 

Also put in the classpath...

// if you use JTA Transactions
jta.jar						

// if you use jug for UUID Generation
jug-lgpl-2.0.0.jar			

// if you use Lucene Text Indexing
lucene-core-1.9.1.jar		

If you are going to use the Entity Bean Code Generator to generate Annotated Entity Beans also put in the classpath...

avajeCodeGen.jar
jxl.jar
velocity-1.4.jar
velocity-dep-1.4.jar

3. Locate avaje.properties

Determine the appropriate location to put the avaje.properties file.

4. Edit avaje.properties

Edit avaje.properties file taking special note of configuring the DataSource and location of logs.

5. Create a Class with a main method that contains Ebean.getServer(null);

You can use code below. Run the Class.


package test;

import com.avaje.ebean.Ebean;

public class Test {

	public static void main(String[] args) {
		
		Ebean.getServer(null);
		System.out.println("DONE");
	}
}

6. Running the class you should see something along the lines of...


 INFO: Ebean Version[0.9.0-061028] Java Version[1.5.0_03]
 INFO: DataSourcePool [ora10] autoCommit[false] transIsolation[READ_COMMITTED] min[1] max[25]
 INFO: DataSourcePool [ora10] grow pool;  busy[0] size[0] max[25]
 INFO: IoRepository initialised dirs[C:/devjava/project/appzsite/webapp/WEB-INF/data] zips[]
 INFO: Plugin[][com.avaje.ebean.server.plugin.Oracle10Plugin]
DONE
 INFO: Stopping []
 INFO: ThreadPool [TransactionManager] Shutting down; threadCount[1] busyCount[0]
 INFO: DataSourcePool [ora10] shutdown
 INFO: Closing Connection[ora10.1] psReuse[0] psCreate[0] psSize[0]

7. Take special note of the Plugin being used.

For databases not yet tested against the Plugin will be com.avaje.ebean.server.plugin.BasePlugin.

If you use BasePlugin then you need to additionally set some database specific configuration such as quoted identifiers, supportsGetGenerated keys etc.

Refer to baseplugin_readme.txt

9. Goto Getting Started (or README.2.txt)

TROUBLESHOOTING

Nothing in Console

If you only get DONE appearing in the Console (System.out) then check the system.properties file to make sure "log.toconsole=true"

If Ebean can not find the system.properties file you will get something like


Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.avaje.ebean.Ebean.(Ebean.java:114)
	at unitext.ex.Test.main(Test.java:9)
Caused by: java.lang.RuntimeException: Can not find file 
-[C:\devjava\project\appZsite\system.properties] to load properties
	at com.avaje.lib.SystemProperties.loadProperties(SystemProperties.java:134)
	at com.avaje.lib.SystemProperties.defaultInit(SystemProperties.java:239)
	at com.avaje.lib.SystemProperties.getProperty(SystemProperties.java:230)
	at com.avaje.lib.SystemProperties.getProperty(SystemProperties.java:195)
	at com.avaje.lib.Log.create(Log.java:66)
	at com.avaje.lib.Log.(Log.java:47)
	... 2 more

If Ebean can not find the 'logs' directory


FATAL ERROR: init of FileLogger: 
Can't get log directory [logs] from [C:\devjava\project\appZsite]
FATAL ERROR: init of FileLogger: 
Can't get log directory [logs] from [C:\devjava\project\appZsite]
java.lang.RuntimeException: 
Can't get log directory [logs] from [C:\devjava\project\appZsite]
	at com.avaje.lib.SimpleLogger.getFilePath(SimpleLogger.java:322)
	at com.avaje.lib.SimpleLogger.init(SimpleLogger.java:336)
	...

Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse