The aim of this project is to demonstrate a way to write lightweight EJBs using clojure and deploying without using Ahead-of-Time (AOT) compilation.
Download OpenEJB from and unpack it to home directory:
curl http://www.apache.si/dyn/closer.cgi/openejb/openejb-4.0.0/openejb-standalone-4.0.0.tar.gz | tar xz -C ~
mv -T ~/apache-openejb-4.0.0 ~/openejb
Download clojure 1.3 and put in to ~/openejb/lib
:
curl http://repo1.maven.org/maven2/org/clojure/clojure/1.3.0/clojure-1.3.0.zip -o /tmp/clojure.zip
unzip -j /tmp/clojure.zip clojure-1.3.0/clojure-1.3.0.jar -d ~/openejb/lib && rm /tmp/clojure.zip
Clone clojure-javainterop
(if not already done) and go to project directory and ensure proper environment with:
git clone [email protected]:alesk/clojure-javainterop.git
source ./envir
Build jar, start openejb and deploy application.
ant jar
openejb start&
openejb deploy build/caller.jar
Use Client application to call CallerBeanRemote ejb:
java -cp build/caller.jar:$CLASSPATH javainterop.Client "Your name"
EJB is also called every 30 seconds by OpenEJB's scheduler.
Copyright (C) 2012 Aleš Kotnik, [email protected]
Distributed under the Eclipse Public License, the same as Clojure.