Kelly JOnAS OpenTool deployment of Enterprise Java Bean (EJB) for JBuilder 4 & 5
Enterprise
JOnAS integration in JBuilder Enterprise.
Go to http://www.ingenosya.com/jonas_opentool.php3
for more information.
Users documentation
Introduction :
This software is copyrighted by Cyrille Morvan (morvan@fiifo.u-psud.fr)
for Ingenosya France.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
OpenTool installation
- Shutdown JBuilder
- Copy the JonasOpenTools_jb4.jar (or JonasOpenTools_jb5.jar if you use JBuilder 5) to your JBuilder
plugin directory. For example c:\jbuilder4\lib\ext\ or /usr/local/jbuilder4/lib/ext/
- Start JBuilder
- Configure JOnAS (show next section)
- Retstart JBuilder
OpenTool configuration
First, you need to declare JOnAS installation directory to JBuilder4.
Go to menu Tools | Entreprise. And select Application Server, and then
JOnAS 2.
Clic on the dotdotdot button, and select the JOnAS Root directory where
/config/java.policy can be found.
There's maybe a default value, in the field. Check it's the correct
one.
You need to check if JOnAS is version 2.4 or not.
You also need to configure IAS 4.1 (Inprise Application Server or Borland
Application Server) to develop EJB with JBuilder. Please refer to Inprise
Application Server and JBuilder documentations for more details.
JBuilder configuration is ok. Clic OK.
The about button give information about author, licence, and URL for
update.
Project configuration
Your project configuration will be completed by the next four steps :
Stage 1 : adding library
If you already have an existing project or a new project, you have to add
the JOnAS library to your Project java ClassPath.
Edit your project properties, the 'Paths' and 'Required libraries'.
Choose the add button. A new window appear. You must select "JOnAS 2
RMI" or (exclusive) "JOnAS 2 JEREMIE". Please report to JOnAS documentation
to know the difference. By default select RMI library.
If you want, you can also add your own library as JDBC library.
Stage 2 : select JOnAS Application Server
So, in your project properties, you have to select the AppServer.
Go to Entreprise, and clik the dotdotdot button.
Select JOnAS 2.
Stage 3 : configure execution environnement
Then, you need to configure 'Run' informations.
You only need to choose EjB. You can configure params give to the Virtual
Machine or to JOnAS, and select the EJB jars to run.
Please refer to JBuilder and JOnAS documentation for more details.
Stage 4 : special keys configuring
After you have save your project properties, you can configure GenIC when
you go to the build properties, in the tab JOnAS 2.
If you not check the "Automaticaly use GenIC", the compilation of the
project will be more fast, and you can use an other tool to generate the
stub for JOnAS.
You can configure special command line options for your project. Refer to
JOnAS GenIC documentation. Default value is "-verbose".
GenIC for JOnAS 2.2.x and for JOnAS 2.3 don't update the EJB Jar with generated files.
So JBuilder must run the Jar program to do it. But GenIC JOnAS 2.4 supports its own EJB Jar update.
So it's silly to make twice, you can disable the GenIC Jar update with the option "-noaddinjar"
or disable the JBuilder Jar update : uncheck 'Enable'.
Windows users,
there is still problem with the GenIC auto-addin.
Old screenshot
Displaying the Deployment Descriptor editor
To display the Deployment Descriptor editor, double-click the EJB group
in the project pane. The deployment descriptor editors appears.
Note that a tree of the EJB group appears in the structure pane. To
view informations about an entreprise bean, double-clik the bean in the
pane.
These informations are used to generate the two files "ejb-jar.xml"
and "jonas-ejb.xml". The file "ejb-inprise.xml" is also generated in the
same process. Take care not edit the "jonas-ejb.xml" by hand.
Please, refer to JBuilder 4 and Inprise Application Server for how
to use this wizard.
You can also use this wizard to generate "Security Roles" informations
in ejb-jar.xml and "Data Sources" informations.
The "Data Sources" informations are used to generate data sources properties
files for JOnAS. The files are generated in the project path.
For example, if you create a data source "jdbc_1" with a JDBC driver
for Oracle. the file "oracle_jdbc_1.properties" is automatically generated
and added to your project. Take care not to edit this file, but you can
remove it.
Compilation : generate stub and update JAR
After, the creation of the EJB jar, the GenIC tool is called by JBuilder.
GenIC is a tool provided with JOnAS.
GenIC implements the Bean interfaces, compile them with javac, and
call rmic for generating the stubs.
After GenIC was call, the EjB jar is updated with the new class.
Be careful, on Windows9x, when javac, rmic or jar are started, an empty
dos prompt is open. Don't close it, otherwise it will kill the process.
All the generated source are generated in the out path for classes,
in the directory GeneratedSource. If GenIC quit normaly, all the tree files
are deleted.
If an error occur during GenIC, you can double-clik on the file, for
viewing generated source :
It's useful for correcting problems.
The generated sources are save in the directory "GeneratedSource" in
the classes output of the project.
Run JOnAS with ejb

Select to run the server, in your configurated run. Referer to "Configure
project" or to JBuilder documentation, if you don't know how.
This may take a few seconds. Be patient.
But before running the JOnAS server, you need to start the registry.
In "Tools" menu, select to run "RMI Registry" or the "JEREMIE registry".
Deploying JAR files
The deployment will be completed in 3 steps.
Step 1 : select the JAR
You can add, or remove the JAR, from the list. You need to have at less
1 EjB jar.
The edit buton start the BeanDeployer. A tool give JOnAS to help to
edit a JAR who contains XML deployment files.
Consult the BeanDeployerGuide in JOnAS documentation, for more informations.
Step 2 : generate stubs
Select to generate or not the stubs for the list of selected EjB jar. You
can specify options for the GenIC and jar tool.
The GenIC options "include all generated source in jar files" permit
to keepgenerated, and not to delete the files *.java after compilation,
and the files are added to the java archive (jar), for each Jar.
You can specify options to the Java or Rmi compiler, and add special
options :
"-verbose" permit to show more information in the Message View at the
bottom of the JBuilder window.
The Jar verbose option is disable if the "Jar Update" for the project is disable.
Step 3 : JOnAS server configuration
You can choose to add the new EjB files to jonas.properties
Copy in the data source files properties to a directory. The data source
properties are auto-generated. There is informations about JDBC driver,
username and password, for database connexion.
Hot Deploy
With JBuilder 5, you can use HotDeploy features from JBuilder.
Use right-click on an EJBGroup or EJBJar, you can deploy, undeploy or list the ejbs
on a running JOnAS Application Server.
Known problems
The JOnAS GenIC compiler generates compilation errors in the following cases:
- The JOnAS project is created in a directory which contains spaces.
- The classpath contains spaces.
Users should avoid spaces in the project directory or the classpath.
Technical information
This open tool has been tested with JBuilder 4.0 Entrepise on Windows
98 (in french) and Linux Mandrake 7.2 (in english) and with JBuilder 5.0
on Windows 2000.
with JOnAS 2.2.2 (linux) and JOnAS 2.2.7 (windows98) and JOnAS 2.3 (windows2000).
Report bug and patch to Cyrille Morvan : cmorvan(at)ingenosya.com
or morvan(at)fiifo.u-psud.fr
Authors information
Cyrille Morvan is an IT engineer in France from "la maison de l'ingénieur"
Orsay. School name : "FiiFo".
contact : cmorvan(at)ingenosya.com
or morvan(at)fiifo.u-psud.fr
Cyrille Morvan
or snail post :
Cyrille Morvan
4 allee du routoir
78720 Saint Forget
FRANCE
Ingenosya is a French SSII specialist of EJB and J2EE in France
and Madagascar.
contact : http://www.ingenosya.com
or dmorvan(@)ingenosya.com
Links
Borland : http://www.borland.com
JBuilder : http://www.borland.com/jbuilder/
Java : http://java.sun.com/
Evidian : http://www.evidian.com/
JOnAS : http://www.evidian.com/jonas/
Ingenosya : http://www.ingenosya.com
More information about this OpenTool : http://www.ingenosya.com/jonas_opentool.php3
IT School Fiifo : http://www.fiifo.u-psud.fr/
today, the 6/5/2001
legal information : Borland, Inprise and Jbuilder
are trademark of Borland Inc.