The target audience for this guide is the deployer. The deployer is responsible for the deployment of J2EE modules like Enterprise Beans and their containers, web components and Ear applications in the application server.
The content of this guide is the following:
The deployment process consists of two types of deployment :
jonas-
.
jonas-
.
Deployment descriptors are written in XML, the deployer must use its favorite XML editor for editing it.
Suppose that we want to customize the deployment of the AccountImpl
bean in the JOnAS example examples/src/eb
.
The customization wanted will be to change the name of the database table used for
the persistence of the AccountImpl.
$JONAS_ROOT/examples/src/eb
.jonas-ejb-jar.xml
and modify the value of the
<jdbc-table-name>
element included in the <jdbc-mapping>
element corresponding to AccountImpl
entity..java
files present in this directory: javac -d ../../classes Account.java AccountImplBean.java
AccountExplBean.java AccountHome.java ClientAccount.java
ejb-jar.jar
with all the corresponding classes
and the two deployment descriptors: mkdir -p ../../classes/META-INF
cp ejb-jar.xml ../../classes/META-INF/ejb-jar.xml
cp jonas-ejb-jar.xml ../../classes/META-INF/jonas-ejb-jar.xml
cd ../../classes
jar cvf eb/ejb-jar.jar META-INF/ejb-jar.xml META-INF/jonas-ejb-jar.xml
eb/Account.class eb/AccountExplBean.class
eb/AccountHome.class eb/AccountImplBean.class
ejb-jar.jar
file with the interposition classes: GenIC -d ../../classes ejb-jar.jar
$JONAS_ROOT/ejbjars
directory: cp ../../classes/eb/ejb-jar.jar $JONAS_ROOT/ejbjars/ejb-jar.jar
jonas.service.ejb.descriptors
is set to
ejb-jar.jar
in the jonas.properties file. jonas start
We have described step by step all the work to do to build the ejb-jar.jar
file in order to explain all the process.
In fact in the $JONAS_ROOT/examples/src/eb
directory there is a script
compile.sh
for unix or compile.bat
for Windows that you can use.
If the GNU make is installed on your machine you can use the Makefile file
you find in this directory.
You only have to type make install
and all the process to build the
ejb-jar.jar
file and install it in the $JONAS_ROOT/ejbjars
directory will be made.
In your real application you will have the choice to write your own script
that will looks like the compile.sh
or compile.bat
,
or to write a Makefile
file that use the
common makefile rules that are provided in the JOnAS distribution.
It is quite easy to understand how to change the Makefile
file
for your own purpose:
Foo.jar
file set the
variable EJBJARS
: EJBJARS = Foo
Foo.xml
and jonas-Foo.xml
.
Foo.jar
file. Foo_CLASSES = Bar BarBean BarHome
CLASSES = $(Foo_CLASSES) ClientBar
ROOT
variable and JAVAPACKAGE
.
The first depend of the location of your working directory, the second is the name
of the java package.make install
allows you to build your Foo.jar
file and install it in $JONAS_ROOT/ejbjars
directory.
If the jakarta ANT tool is installed on your machine you can use the ant install command
in the $JONAS_ROOT/examples/src
. It will build all ejbjars examples and copy them into
the $JONAS_ROOT/ejbjars
directory.
Before deploying a war file in the JOnAS application server, you must first package the war file. To do this process follow the WAR packaging guide.
When you have packaged your war file, follow these steps :
$JONAS_ROOT/webapps
directory.
$JONAS_ROOT/config/jonas.properties
file.jonas.services
property.jonas.service.web.descriptors
section the name of your war file. ie : web.war
jonas start
Before deploying an ear file in the JOnAS application server, you must first package the ear file. To do this process follow the EAR packaging guide.
When you have packaged your ear file, follow these steps :
$JONAS_ROOT/apps
directory.
$JONAS_ROOT/config/jonas.properties
filejonas.services
property.jonas.service.ear.descriptors
section the name of your ear file. ie : app.ear
jonas start