The aim of this document is to show basics for JOPE usage within Eclipse. It assumes that the reader does not need explanation about Eclipse particular tasks.
This document describes how to install, configure and use JOPE plugin.
The first step is to download the JOPE-1-0.zip file.
(URL : http://download.forge.objectweb.org/jope/JOPE-1-0-0.zip )
Supported Eclipse versions (Eclipse version tested):
Eclipse 2.0
Eclipse 2.1
Supported Jonas versions :
JOnAS 3.0 and higher.
Take the JOPE-1-0-0.zip file and explode it in the ECLIPSE_HOME/plugins directory.
Start Eclipse. Usually the plugin is automatically detected, and you can see the Jonas menu.
If you don't see the Jonas menu in Eclipse, you have to add the Jonas Perspective in Eclipse. You can do Window -> Customize Perspective and choose Other. You should see Jonas and you have to select it.
At this step, you must see the Jonas menu in Eclipse.
Then, you can configure the JONAS_ROOT and JONAS_BASE directory.
You can add some jar file in XTRA_CLASSPATH (it's the same thing than the environment variable).
You can choose to start JOnAS in one of two modes :
Debug mode : to make debug in eclipse
Non debug mode : to start JOnAS in DOS console (only for windows platforms).
If you select JVM Parameters, you can add some JVM parameters or CLASSPATH parameters to add for the server's start. You can choose to start in debug mode or not.
It's very important to make this configuration before creating a Jonas project or creating a new JOnAS server.
To start, stop or restart JOnAS you can select this in JOnAS menu in Eclipse or on the tool bar. When you start JOnAS you switch to the Debug Perspective.
You can also create a new JOnAS server. You select this in the JOnAS menu or in the tool bar. By default you have the JONAS_ROOT directory. You have to put the JONAS_BASE directory equivalent to the new JonAS server. The plugin will create the new server.
If you want to use this server, you have to change the JONAS_BASE configuration in plugin preferences.
Be careful, before creating a JOnAS project you must be sure to configure the JOnAS plugin preferences (with JONAS_ROOT information).
To create a JOnAS project, you can do File -> New -> Project. You select Java and JOnAS project.
You can choose the project name and the directory.
Then you can create a web application :
You can also choose to generate some servlet examples and jsp sources files.
It's also possible to create an empty project (just to develop EJB).
You can click on Finish and your project is created. The JRE jar files are added and the web_catalina.jar and jonas.jar (or JONAS_RMI.jar and JONAS_JEREMIE.jar) are added to your project.
You have also the web app tree project. You can find in the web application directory (by default webApplication) a build.xml file. This file is used by the plugin to build the war file. By default all the java files in source web directory will be in WEB-INF/classes. But you can customize this file to add or remove some files.
You can see also a build.properties file in the root of the project. This file will be used by the plugin to take some properties when the EJB will be built. You can also customize this file.
For the moment the plugin support one WAR per project.
When you have created your JOnAS project, you can do File -> New -> Other -> Jonas EJB to create an EJB.
When you click on next button you have a wizard to choose the package, the EJB name and the jar name. You cannot choose the root directory of EJB components. This root directory will be "components".
You have to choose an EJB type and the type of interface. If you choose Remote interface, the plugin will generate a Client of the EJB.
Then you can click on Finish button. The plugin generate all the EJB source file in the package directory, in "components" dir . The xml descriptors are in the same directory. You can see in the package directory a build.xml file, and it's this file which will be run by the plugin to build the EJB. You can customize this file if it is necessary.
If you change the JOnAS version, the project build.properties file is automatically updated and you can re-generate the EJB in the new JOnAS version.
When you have created and create web application, ejb or resource adapter in your JOnAS project, you can generate the war, ejb or rar files.
WAR tasks :
EJB tasks :
EAR tasks :
RAR tasks :
This fonctionnality allow the synchronisation between the EJB implementation class and the interface HomeLocal, Home, Remote or Local.
To do that you have to right click on the *EJB.java file and you have a choice "Jonas project". In this choice you can make :
On all java file you can make a right click and choose "Add Logs". This option will add logs in all methods of the file and logs all attributes and parameters in the class.
This option use Monolog.
The debug and hot deployment depends of the code you have added. If the plugin is not be able to do a hot deploy, you will see a popup. But in the lot of cases if you add codes or if you want to put a breakpoint, you have only to save the file and normally the modification or the breakpoint will be detected and hot deploy.