Menu

EclipseRI

Anonymous Joerg Reichert
Attachments
Cvsrepository.jpg (44947 bytes)
Psqldriver.jpg (50982 bytes)

Setting up Eclipse for the Reference Implementation

Prerequisites

  1. choose your development directory
  2. extract Axis2, Eclipse SDK, Geronimo, JDK 1.5, MyFaces, OpenJPA, PostgreSQL & the JDBC driver jar, Putty
  3. create folder "eclipse_plugins" and foreach plugin a subfolder consisting a folder "eclipse" with the file ".eclipseextension"
  4. extract the plugins Axis2, DataToolsProject, EMF, GEF, WebTools, Geronimo and soapUI in the just created folders

PostgreSQL set up

Create following batch files inside the PostgreSQL directory:

global_variables.bat

SET PGHOME=bin
SET PGDATA=data
SET PGLOG=log.log
SET PGUSER=postgres

serviceqos_variables.bat

call global_variables.bat
SET DBNAME=serviceqos
SET DBUSER=service

config.bat

%PGHOME%\initdb
start %PGHOME%\pg_ctl start --log %PGLOG%
%PGHOME%\createuser -P -a -d -E %DBUSER%
%PGHOME%\createdb --owner %PGUSER% --template template1 --encoding=UNICODE %DBNAME%

serviceqos_config.bat

call serviceqos_variables.bat
call config.bat

pg-start.bat

call global_variables.bat
%PGHOME%\pg_ctl start

pg-stop.bat

call global_variables.bat
%PGHOME%\pg_ctl stop

Make sure that you have a user account in Windows without Administrator rights otherwise you have to create one.

The easiest way is to execute the serviceqos_config.bat when logged in without Administrator rights. You can also stay as Adminstrator by changing the config.bat, so that e.g.

%PGHOME%\createuser -P -a -d -E %DBUSER%

is now

runas /env /user:postgres "%PGHOME%\createuser -P -a -d -E %DBUSER%"

where "postgres" is the name of the unpriviledged user account in Windows. You have to change the variable PGUSER in global_variables.bat if your user account name is not postgres.

When serviceqos_config.bat is executed it will create the subfolder data in your PostgreSQL directory and start the database server, as to see by the poping up window with the path to the file pg_ctl in its header. Change back to window created by the batch file where you are ask to give the password for the user "service". Type in "quality" in this first and also in the second prompt.

By executing pg-stop.bat you can stop the database server. With pg-start you can start it again.

Eclipse set up

Create the eclipse-start.bat

eclipse-start.bat

.\eclipse\eclipse.exe -clean -vm .\jdk1.5.0\bin\java.exe -data .\workspace\serviceqos\workspace -consolelog -configuration .\workspace\serviceqos\configuration

and execute it. Eclipse will start up but without the plugins. By the menu

Help > Software Updates > Manage Configuration

you launch the Product Configuration window. Open the context menu of the root "Eclipse SDK" in the left side of the window and

Add > Extension location...

In this file dialog you have to select the folder where a plugin is located. To be faster just copy the path out of the address bar of the Windows explorer and paste this path in the folder textfield, e.g.

C:\temp\dev\eclipse_plugins\emf

Accept with OK. Decline Eclipse's wish to restart and repeat the step foreach plugin. Adding the last plugin you can allow Eclipse to restart. Eclipse will now come up with a new Wecome screen. Close that tab.

Configuring Eclipse

Configuring database connection

Window > Preferences, Connectivity > Driver Definitions, PostgreSQL > 8.x

Open the context menu of the "8.x" node and select Add...

Select that last node "PostgreSQL JDBC Driver" and push OK. Fill out the formular similar to this

Note, that the given jar file is replaced by our own jdbc driver file.

Close the Preferences window by pushing the OK button.

Configuring JPA

Window > Preferences > JPA, Configure user libraries..., New...

Type in "OpenJPA", OK. Select the node "OpenJPA" and push "Add Jars...". Browse to your OpenJPA folder, go there into the lib folder and select all jar files.

Close the Preferences window by pushing the OK button.

Configuring Axis2

Window > Preferences > Web Services > Axis Preferences

Under the "Axis2 Runtime" tab select the Axis2 folder. Under the tab "Axis2 Preferences" select all checkboxes.

Close the Preferences window by pushing the OK button.

Configuring Geronimo

Window > Preferences > Server > Installed Runtimes

Push the Add... button. Within the Apache folder there is the entry "Apache Geronimo v2.0 Server" which is to select. Push Next. Browse and the select the Application Server Installation directory. Push Finish.

Close the Preferences window by pushing the OK button.

File > New > Other..., Server > Server, push Next. If required, change the server's host name and select Apache Geronimo v2.0 Server (should be selected by default) and press the Next button. Leave everything as it is. Remember that the standard login credentials of Geronimo are

username: system
password: manager

Complete with Finish.

Window > Show View > Other..., Server > Servers

The new view Servers appears in the bottom of the Eclipse IDE window having the Geronimo entry. Over the entry's context menu you can start and stop the server. When the server is started you also can select "Launch Geronimo console" from that context menu to open the interface to use Geronimo which you can also reach by typing in

http://localhost:8080/console/login.jsp

in the address bar of your internet browser. Type in the credentials (system, manager) to get directed to the Administration Console. In the Console Navigation on the left side click on "Deploy New" under the folder "Applications". For the archive textfield select the axis2.war file in the development folder. Click now on the install button. Click on "Web App WARs" under "Applications" in the Console Navigation where now the entry axis2 appears at first place. Following the URL link you come to the Axis2 start screen. Click on "Services" to see all deployed web services. Until now there should only the Version web service appear. Use the link "Back home" in the right upper corner to return to the Axis2 start screen. Select now "Administration". You have to login, use

username: admin
password: axis2

to go to the "Axis2 Web Admin Module", where you can e.g. upload new web services by giving the path to an aar file.

Configuring CVS

Window > Preferences > General > Network connections > SSH2

In the General tab, point the SSH2 HOME variable to your Putty directory.
In the Key management tab first generate a RSA key, copy the generated key (this is the public key) to the right location in your Sourceforge account. Back to Eclipse provide a passphrase (password-alike). Now press the "Save private key..." button to save the key derived from public key and passphrase into the Putty folder or somewhere else (the file do not need an extension, but you can also give it an extension like .key). Go back to the General tab and add by pressing "Add Private Key..." the just saved key file.

Window > Preferences > General > Team > CVS > Ext Connection Method

Select the radio button "use another ..." and choose extssh as connection type.

Close the Preferences window by pushing the OK button.

Window > Show View > Other..., CVS > CVS repositories

The new view CVS Repositories appears in the bottom of the Eclipse window. Right click in the area of that view:

New > Repository Location...

Right click on the ServiceQoSWeb project and Team > Share project..., Next, Next (if the project name shall also be the module name inside the CVS repository), the project is loaded, then you are asked, if all files are to be transfered, to accept that press Finish. The file type pageflow is unknown to Eclipse CVS by default so make it to an ascci file type. Next. Now you can give a commentary to the added files or leave it just blank. Finish.

Later changes in the project in the workspace can be checked in by Team > commmit.

Creating a WebApp

File > New > Other..., Web > Dynamic Web Project, push the Next button, give the project name, e.g. "ServiceQoSWeb", Next, select

  • Dynamic Web Module
  • Geronimo Deployment
  • Java
  • JavaServer Faces

(by also selecting Axis2, the Axis2 web console would be included in the project and the seperate installation of the Axis web archiv in the preceding step would not have been necessairy).

Push two times the Next button. For "artifact id" just type in e.g. "serviceqos" and push Next.

In this "JSF Capabilities" step, mark the second radio button and push the New... button. Name the library "MyFaces" and add the jar files from the lib folder in your MyFaces folder in the development directory. Complete the wizard by pressing Finish. The project is created in your workspace.

Open the folder "WebContent" in your project and open its context menu.. New > Other..., Web > JSP, Next. Type in the name of the jsp file to create, e.g. index.jsp. Next. Select the second template. Finish. Edit the index.jsp and change title and add some text like a welcome message.

Now go to the Eclipse Servers View. Open the context menu of the Geronimo server and select "Add and remove projects...". Select the only available project and added to the configured projects. Finish.

After deployment either browse in the Geronimo console to Web App WARs and follow there the link to new Web app or just type in your internet browser address bar

http://localhost:8080/ServiceQoSWeb

You should see your custom text, that you have added to the index.jsp.


back to [Home]


Related

Documentation: Home
Documentation: TOC