+ All Categories
Home > Documents > Eclipse & MyEclipse User Guide

Eclipse & MyEclipse User Guide

Date post: 08-Oct-2014
Category:
Upload: dvnrkishore2722
View: 1,273 times
Download: 4 times
Share this document with a friend
Popular Tags:
120
Page 1 of 120 Eclipse & MyEclipse User Guide Victor Velazquez Santanu Roy Griselda Nunez Ritesh Kumar Alejandro Galvan Kelly Candler
Transcript
Page 1: Eclipse & MyEclipse User Guide

Page 1 of 120

Eclipse & MyEclipse

User Guide

Victor Velazquez

Santanu Roy

Griselda Nunez

Ritesh Kumar

Alejandro Galvan

Kelly Candler

Page 2: Eclipse & MyEclipse User Guide

Page 2 of 120

1 Setup Enterprise Project in MyEclipse IDE ................................................................................ 51.1 Create Enterprise Project........................................................................................................ 51.2 Remove and Delete Web Module ....................................................................................... 61.3 Create and Add Web Project Module in Enterprise Project..................................... 7

1.3.1 Change Web Root folder of Web Project............................................................... 71.3.2 Create Project Module.................................................................................................... 71.3.3 Add Web Project Module to Enterprise Project................................................... 8

1.4 Creation and Add EJB Project Module .............................................................................. 81.4.1 Create Project Module.................................................................................................... 81.4.2 Add EJB Project module to Enterprise Project .................................................... 9

1.5 Setup Enterprise Project.......................................................................................................... 91.6 Add JAR files in Build Path....................................................................................................101.7 Project Built .................................................................................................................................10

2 Configuring JBoss ..............................................................................................................................122.1 Specifying JBoss JDK Name ...............................................................................................122.2 Specifying JBoss Launch Mode .........................................................................................132.3 Verifying JBoss Configuration ............................................................................................14

2.3.1 Starting JBoss using MyEclipse ...............................................................................142.3.2 Stopping JBoss using MyEclipse .............................................................................152.3.3 Confirming JBoss Server Shutdown ......................................................................15

2.4 Deploying MyEclipse Projects ............................................................................................152.4.1 Enabling Jboss Web Loader......................................................................................152.4.2 Verify jboss-app.xml entries......................................................................................162.4.3 Verify entries of MANIFEST.MF files and application.xml file ......................162.4.4 Java Enterprise deployment setup........................................................................172.4.5 Deploy the application ................................................................................................202.4.6 Run jboss server..............................................................................................................232.4.7 Verify the deployment .................................................................................................23

3 Framework Sample Deployment ................................................................................................253.1 Creating MyEclipse Project using the Framework Sample v3.0..........................253.2 Importing/Copying Source files into Project ................................................................26

3.2.1 Importing files into Enterprise Application Project..........................................263.2.2 Importing files into EJB Module Project................................................................273.2.3 Importing files into WEB Module Project .............................................................27

3.3 Setting the Build-path ............................................................................................................273.4 Building Project(s) .....................................................................................................................28

4 Database Explorer .............................................................................................................................294.1 Creating a Database Driver.................................................................................................294.2 Opening a Database Connection......................................................................................314.3 Working with the Database.................................................................................................32

5 Hibernate ...............................................................................................................................................335.1 Customizing the Hibernate Configuration File............................................................365.2 Create Hibernate Java Table Mapping...........................................................................36

6 Running and Debugging J2EE Application .............................................................................396.1 Debug Configuration Setup.................................................................................................39

Page 3: Eclipse & MyEclipse User Guide

Page 3 of 120

6.1.1 Debug Option...................................................................................................................396.1.2 Remote Java Application............................................................................................406.1.3 Create New configuration..........................................................................................406.1.4 Project Detail and Port .................................................................................................416.1.5 Display Debug in Favorites Menu...........................................................................41

6.2 Application Debugging ..........................................................................................................426.2.1 Set Break Points ..............................................................................................................426.2.2 Debug Perspective.........................................................................................................426.2.3 Server Launch Mode.....................................................................................................436.2.4 Launch the Application................................................................................................446.2.5 Execute Application Flow............................................................................................446.2.6 Move over the Brake Points.......................................................................................456.2.7 Check Value of variables.............................................................................................45

7 Junit..........................................................................................................................................................467.1 Creating the Junit directory Structure:...........................................................................467.2 Creating the Junit test class :..............................................................................................487.3 Running the test class............................................................................................................54

8 Using Visual SourceSafe with MyEclipse .................................................................................578.1 Share Project with VSS Repository ...................................................................................578.2 Latest Code from VSS Repository .....................................................................................618.3 How to view/edit the configuration settings or configured mappings? .........638.4 VSS Plugin preferences..........................................................................................................64

9 Connect an Existing Project with SVN.......................................................................................659.1 Checkout the Project ..............................................................................................................65

9.1.1 Checkout Enterprise Application Project .............................................................669.1.2 Checkout EJB Module...................................................................................................679.1.3 Checkout Web Module.................................................................................................689.1.4 Add Modules to Enterprise Application Project ................................................709.1.5 Add Jar Files in Build Path of EJB & Web Module ............................................70

9.2 Revert the Changes in web.xml & application.xml done by Eclipse IDE..........709.2.1 Revert the Changes of web.xml...............................................................................719.2.2 Revert the Changes of application.xml ................................................................72

9.3 Check Project Structure in Java Perspective ...............................................................7410 Appendix ...........................................................................................................................................88

10.1 Installing and Configuring MyEclipse..............................................................................8810.2 eRequest Process to get MyEclipse .................................................................................8810.3 Personal Installation of Eclipse & MyEclipse................................................................89

10.3.1 Installation of Java ........................................................................................................8910.3.2 Installation of Eclipse....................................................................................................8910.3.3 Installation of MyEclipse .............................................................................................89

10.4 Importing/Copying Source files into Project .............................................................10110.5 Add JAR files in Build Path of Application Module ..................................................10410.6 Add and Remove Application Module from Enterprise Project ........................106

10.6.1 Add Application Module to Enterprise Project................................................10610.6.2 Remove Application Module from Enterprise Project .................................107

10.7 JBoss Installation ..................................................................................................................108

Page 4: Eclipse & MyEclipse User Guide

Page 4 of 120

10.8 Ant Installation .......................................................................................................................10910.9 VSS plugin prerequisites.....................................................................................................110

10.9.1 Getting access to VSS Database..........................................................................11010.9.2 Get Installed a Microsoft VSS client.....................................................................11010.9.3 Add VSS database to local client..........................................................................110

10.10 Installation of Subversive .............................................................................................11110.10.1 Proxy Settings..........................................................................................................11110.10.2 Installing Subversive .............................................................................................11210.10.3 Update Site................................................................................................................11210.10.4 Downloading Subversive ....................................................................................11310.10.5 Installation.................................................................................................................11410.10.6 SVN Repository........................................................................................................11610.10.7 Add SVN Repository ..............................................................................................117

10.11 Set Up Project on Source Management Server ..................................................11810.11.1 eRequest ....................................................................................................................11810.11.2 Standard Enterprise Project Folder Structure ...........................................11810.11.3 Rename the folders...............................................................................................11810.11.4 Recommended Directory Contents ...............................................................11910.11.5 Scenario I - Source code available on existing Source CodeManagement System....................................................................................................................11910.11.6 Scenario II - Source code is not available on existing Source CodeManagement System....................................................................................................................119

Page 5: Eclipse & MyEclipse User Guide

Page 5 of 120

1 Setup Enterprise Project in MyEclipse IDE

If you haven’t installed MyEclipse, please follow MyEclipse Installation steps beforethe start this section.

1.1 Create Enterprise Project

Select File -> New -> Project and project type Enterprise Application Project.

Enter Project Name say myapp1, use default location, select Web Project Module andclick next button.

Page 6: Eclipse & MyEclipse User Guide

Page 6 of 120

Check "Create Web Project Module" and create Enterprise Project with a web module.

1.2 Remove and Delete Web ModuleSince there is limitation in MyEclipse 5.1 and earlier version, it does not allow creatingenterprise project with any module. So we have created enterprise project withdummy web module and we will delete it.

Remove the web module from enterprise project. Appendix Section 1.2.

Delete myapp1Web module along with content.

Page 7: Eclipse & MyEclipse User Guide

Page 7 of 120

1.3 Create and Add Web Project Module in Enterprise Project

1.3.1 Change Web Root folder of Web ProjectGo to window preferences and change Web root folder name under MyEclipse->J2EE Project -> Web Project from WebRoot to web.

1.3.2 Create Project ModuleSelect File -> New -> Project and project type Web Project.

Enter Project name <Application Name>-war, uncheck "Use Default Location" andbrowse to web project folder. Rename "Web root folder" to web, Context root URL/<application name> and click Finish button.

Page 8: Eclipse & MyEclipse User Guide

Page 8 of 120

1.3.3 Add Web Project Module to Enterprise ProjectAdd Web project module to enterprise project. Appendix Section 10.6

1.4 Creation and Add EJB Project Module

1.4.1 Create Project ModuleSelect File -> New -> Project and project type EJB Project.

Enter Project name <Application Name>-ejb, uncheck "Use Default Location", browseto ejb project folder and click Finish button.

Page 9: Eclipse & MyEclipse User Guide

Page 9 of 120

1.4.2 Add EJB Project module to Enterprise ProjectAdd EJB project module to enterprise Project. Appendix Section 1.1

1.5 Setup Enterprise ProjectTake build.xml and build-properties.xml files from library location and copy intoproject folder e.g. myproject. Edit value of following properties in build-properties.xml:-project.nameapplication.nameapplication.contextframework.versionpath.eclipse.workspacepath.jboss (Local machine)

Go to project folder and execute local-setup task. E.g. >ant local-setup.local-setup task does following tasks: -Create APP-INF/lib/framework folder in enterprise project and copy all released jarfiles of specified version of framework.

Page 10: Eclipse & MyEclipse User Guide

Page 10 of 120

Generate application.xml and copy under Meta-INF of enterprise project folder.Generate jboss-app.xml and copy under Meta-INF of enterprise project folder.Generate classes-move.xml and copy under enterprise project folder.

Copy project specific third party jar file, if any, in APP-INF/lib/application and mentionthem as java module(s) in application.xml.

Note:- Before executing ant task make sure ant is available to your machine. Pleaserefer appendix section Ant Installation.

1.6 Add JAR files in Build PathAdd all dependent jar files in Project build files. Refer section Add JAR files in BuildPath of Application Module

1.7 Project BuiltSelect all project module and rebuilt.

Page 11: Eclipse & MyEclipse User Guide

Page 11 of 120

Page 12: Eclipse & MyEclipse User Guide

Page 12 of 120

2 Configuring JBoss

This section explains all the steps to have Jboss running in MyEclipse IDE. If you don’thave Jboss installed, follow these steps : “Jboss Installation”.

Go to WindowsPreferencesMyEclipse Application Servers JBoss 4

Select Enable radio buttonEnter the Value of JBoss Home Directory: C:\jboss-4.0.3Enter the value of server name: geamEnter Optional program arguments with your SSO id: -g 501275157

2.1 Specifying JBoss JDK Name

On this screen you select one of the previously configured JDK in MyEclipse.

Page 13: Eclipse & MyEclipse User Guide

Page 13 of 120

2.2 Specifying JBoss Launch ModeOn this screen, you can select whether you want to run jboss in debug/run mode. Somake your selection and click “Ok”.

Page 14: Eclipse & MyEclipse User Guide

Page 14 of 120

2.3 Verifying JBoss Configuration

Once you are done with JBoss configuration, you should be able to see it in theconfigured application server’s list (shown below).

2.3.1 Starting JBoss using MyEclipse

Clicking on the Start in the above shown screen will start the JBoss Server and wecan see the messages of start-up process in the 'Console Window' of MyEclipse

Message " [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1date=200510231054)] Started in 17s:750ms” in the “Console” window confirms weare able to run JBoss using MyEclipse IDE successfully.

Page 15: Eclipse & MyEclipse User Guide

Page 15 of 120

You can double-check this by opening up the JBoss console in the browser window.So you can try that by using the following URL:-http://localhost:8080/jmx-consoleYou should be able to see the JBoss console screen.

If you are getting some errors and are not able to run it successfully, then pleasecheck the steps mentioned above and try again.

2.3.2 Stopping JBoss using MyEclipse

Clicking on Stop option will shutdown the JBoss server

2.3.3 Confirming JBoss Server Shutdown

To get confirmed that the server is shutdown, check the console you should be ableto see Shutdown Complete message.

2.4 Deploying MyEclipse Projects

2.4.1 Enabling Jboss Web Loader

To avoid Tomcat Web Loader issues we will use the JBoss Web Loader.Go to {jboss-home}\server\geam\deploy\jbossweb-tomcat55.sar\META-INF and openfile jboss-service.xml.Set UseJBossWebLoader to true

<attribute name="UseJBossWebLoader">true</attribute>

Page 16: Eclipse & MyEclipse User Guide

Page 16 of 120

2.4.2 Verify jboss-app.xml entries

Open jboss-app.xml under framework3-sample/META-INF/ .

Verify its entries. Here are the contents of the jboss-app.xml.

<?xml version='1.0' encoding='UTF-8' ?><!-- The JBoss 4.x specific elements for ears. $Id: jboss-app_4_0.dtd,v 1.4

2004/08/14 00:35:40 starksm Exp $ --><!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN""http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd"><jboss-app>

<loader-repository>com.geam:loader= framework3-sample.ear<loader-repository-config>

java2ParentDelegation=true</loader-repository-config>

</loader-repository></jboss-app>

Where framework3-sample.ear is the name of the application ear.

2.4.3 Verify entries of MANIFEST.MF files and application.xml file

Remove all the classpath entries from the framework3-sampleEJB/src/META-INF/MANIFEST.MF. The file should look like

Manifest-Version: 1.0Created-By: 1.4.2_02 (Sun Microsystems Inc.)

Similarly remove all the classpath entries from theframework3-sampleWeb/WebRoot/META-INF/MANIFEST.MF.The file should look like

Manifest-Version: 1.0Created-By: 1.4.2_02 (Sun Microsystems Inc.)

All the jar files under the framework3-sample/APP-INF/lib /framework andframework3-sample/APP-INF/lib /application should be entered in theapplication.xml as java module.

Page 17: Eclipse & MyEclipse User Guide

Page 17 of 120

In the application.xml we should have .war extension to the Web-module (e.g.<web-uri> framework3-sampleWeb.war</web-uri>) and .jar to the EJB-module(e.g.<ejb> framework3-sampleEJB.jar</ejb>).

Here are example entries for the application.xml for the framework3-sampleproject

<application><display-name>Framework 3.0</display-name><description>GEAM Framework v3.0 Test Application</description><module>

<web><web-uri>framework3-sampleWeb.war</web-uri><context-root>/framework3-sample</context-root>

</web></module><module>

<ejb>framework3-sampleEJB.jar</ejb></module>

<module><java>APP-INF/lib/framework/chartfx.annotation-6.2.0000.jar</java>

</module><java> ....

<module><java>APP-INF/classes</java>

</module></application>

2.4.4 Java Enterprise deployment setup

We have to setup MyEclipse to ignore dependences in the deploy process.

Go to Windows > Preferences > MyEclipse > Java Enterprise Project > WebProject >Deployment

You should see a screen like this:

Page 18: Eclipse & MyEclipse User Guide

Page 18 of 120

Now we have to ignore dependent Java projects selecting the “Ignore dependentJava projects (I will manually mange them)” option and uncheck al the “LibraryDeployment Policies” checkboxes. After that we should see this configuration in thesame screen.

Page 19: Eclipse & MyEclipse User Guide

Page 19 of 120

We have to do the same for Ear Project option:

And the EJB Project > Deployment option

Page 20: Eclipse & MyEclipse User Guide

Page 20 of 120

Click OK.

2.4.5 Deploy the application

Click on the 'Deploy J2EE Project to Server' icon as shown below.

We only need to deploy the application project i.e. " framework3-sample" in this case,it will deploy both the EJB Module Project and Web Module Project.

From the drop down select the project “framework3-sample” and click on "ADD".Refer the screen below

Page 21: Eclipse & MyEclipse User Guide

Page 21 of 120

Select "JBoss 4" as server and Deploy Type as "Exploded Archive". Click Finish to startthe deployment.

After the deployment you should verify Deployment Status as "Successfullydeployed".

Page 22: Eclipse & MyEclipse User Guide

Page 22 of 120

Create a properties file: classes-move.properties with all these properties:

<property name="jboss.home" value="D:/jboss-4.0.3"/><property name="ear" value="xxx.ear"/><property name="war" value="xxxWeb.war"/><property name="jboss.config" value="geam"/><property name="jboss.deploy"value="${jboss.home}/server/${jboss.config}/deploy"/>

Run classes-move.xml

Verify classes-move.xml under framework3-sample as below.<project name="classes-move" default="classes-move" basedir="."><property file="classes-move.properties"/>

<target name="classes-move" depends="clean"><move todir="${jboss.deploy}/${ear}/APP-INF/classes">

<fileset dir="${jboss.deploy}/${ear}/${war}/WEB-INF/classes"/></move>

</target><target name="clean">

<delete file="${jboss.deploy}/${ear}/APP-INF/lib/framework/hibernate-3.1.3.jar"/><delete...

</target></project>

Page 23: Eclipse & MyEclipse User Guide

Page 23 of 120

Replace "jboss.home" property with the path of your JBoss Home Directory.Replace "ear" property with the name of your application ear.Replace "war" property with the name of your application war.Run classes-move.xml as shown below and verify "BUILD SUCCESSFUL" in theconsole.

2.4.6 Run jboss serverClick on the Start as shown in below screen, you should be able to see the serverstarting message at the 'Console Window'.

2.4.7 Verify the deploymentAfter the successful start up we can verify the deployment by accessing theapplication from the URL http://localhost:8080/framework3-sample, if JBoss server isrunning on port other then 8080, change the port in the URL. This should take us tothe Home page of the application.

Page 24: Eclipse & MyEclipse User Guide

Page 24 of 120

This completes your application deployment in JBoss 4.0.3 using My Eclipse

Page 25: Eclipse & MyEclipse User Guide

Page 25 of 120

3 Framework Sample Deployment

Now we will see how to create/deploy the Framework sample version 3.0. The basicsteps to setup an Enterprise Project will remain the same described earlier.

Before we do this, download the framework at:

http://libraries.ge.com/download?fileid=17102129101&entity_id=2325998101&sid=101

And extract the files at C:\framework3-sample

See below the screen for downloading the Framework v3.0 sample application onyou hard drive.

3.1 Creating MyEclipse Project using the Framework Sample v3.0

Lets create an Enterprise Project using the basic steps to setup an Enterprise Project,described earlier. Enter “framework3-sample” as Project Name, and follow all thesteps to create the EJB module and WEB module described earlier.

After you created the Enterprise Project with both modules, you should see a screenlike this:

Page 26: Eclipse & MyEclipse User Guide

Page 26 of 120

Projects listed in the screen might differ on your machine, but basically you shouldbe able to see 3 new projects created in this case.Names of those would be as below:

framework3-sample: Enterprise Application Projectframework3-sampleEJB: EJB Module Projectframework3-sampleWeb: Web Module Project

3.2 Importing/Copying Source files into Project

Since now the project is created, we can copy/import our downloaded Frameworksample application in this project and then build, deploy and verify it.

3.2.1 Importing files into Enterprise Application ProjectFollow these steps for importing source files into “framework3-sample”.

In this section make sure that you check the following points:Correct folder name is selected in the “From directory” (source folder). Note here,

since we need to import the contents of “META-INF” and “APP-INF” folders andthese are under “C:\framework3-sample\framework3-sample”, so we haveselected this path here.

Select Checkboxes for APP-INF and META-INF folders in the left pane.

Page 27: Eclipse & MyEclipse User Guide

Page 27 of 120

Correct folder name is shown in the “Into Folder” textbox. By default it will be thesame folder, which you selected before starting the import. So, you can change ithere also, if you feel that it is not the correct one.

Select folders APP-INF and META-INF from the folder list and select build.xml fromthe file list.

Select the correct radio button option under “Options” section.

3.2.2 Importing files into EJB Module Project

Follow these steps for importing source files into “framework3-sampleEJB”.

In this section make sure that you check the following points:Path selected in the “From directory”Select folders/files for importing.“Into folder” path, which comes same as the project/project-folder name, which

you selected before starting this import.Since we only need source code for EJB therefore we have selected only the src

folder here.

You will see lot of errors in your “Tasks window”, but that is ok. Since the source filesare referring to some .jar files, which are not in the project build path right now, soMyEclipse is showing these errors.We will take care of this, in the next steps.

3.2.3 Importing files into WEB Module Project

Follow these steps for importing source files into “framework3-sampleWeb”.

In this section make sure that you check the following points:Path selected in the “From directory”Select folders/files for importing.“Into folder” path, which comes same as the project/project-folder name, which

you selected before starting this import.Since we need source code for all java packages and everything under WebRoot

folder therefore we have selected these two folders here.

3.3 Setting the Build-path

Now we will set the build-path for the project(s), so that we can build/deploy thisproject and test it.

Follow the steps “Add JAR files in Build Path of Application Module” for both“framework3-sampleEJB” and “framework3-sampleWeb”.

Page 28: Eclipse & MyEclipse User Guide

Page 28 of 120

3.4 Building Project(s)

After the previous steps, you should be able to see the screen below, which showsthat there is no error left in the project, just a warning for using a deprecated method,which is ok.

Now you are done with creating project(s) for Framework Sample version 3.0 inMyEclipse. You can deploy it on Jboss and test it. Follow the “Deploying MyEclipseProjects” steps to see running the Framework Sample running on Jboss.

Page 29: Eclipse & MyEclipse User Guide

Page 29 of 120

4 Database Explorer

This section explains how is the process for configuring and connecting the DatabaseExplorer to an Oracle database.

The first step is open the MyEclipse Database Explorer perspective.

4.1 Creating a Database Driver

Then, you should create a New Database Connection Driver for each DatabaseConnection.

Page 30: Eclipse & MyEclipse User Guide

Page 30 of 120

In the DB Browser view menu, select New… to create a new Database Driver.

Page 31: Eclipse & MyEclipse User Guide

Page 31 of 120

This will open the New Database Connection Driver wizard.

Select a driver template and replace with the right configuration.

The Connection URL is filled with the Database TNS:

jdbc:oracle:thin:@(DESCRIPTION=(SDU=32767)(TDU=32767)(LOAD_BALANCE=ON)(FAILOVER=ON)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=geamstunorc02t.geam.corporate.ge.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=geamstunorc03t.geam.corporate.ge.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=GEOLDEV.GEAM.CORPORATE.GE.COM)))

The Driver JAR for Oracle is “ojdbc14-9.0.2.0.0.jar”, you can find it at “geam-framework3.0\APP-INF\lib\framework”.

Click Finish.

4.2 Opening a Database Connection

Click the driver and select “Open connection”

The database connection will be opened and displayed in the Database Browser.

Now you can see something like this:

Page 32: Eclipse & MyEclipse User Guide

Page 32 of 120

4.3 Working with the DatabaseAs you can see, you can browse the Database, the schemas, the tables and the data.You can create queries in the SQL Editor view and you see the results in the SQLResults view.

Page 33: Eclipse & MyEclipse User Guide

Page 33 of 120

5 Hibernate

This section follows the steps for getting started with Hibernate development usingMyEclipse.

The first thing you have to do to work with Hibernate in any project is addingHibernate capabilities to it.

Select the project you want to add Hibernate capabilities:MyEclipse > Add Hibernate Capabilities..

Now you can see the next window:

Page 34: Eclipse & MyEclipse User Guide

Page 34 of 120

Click Next.

Page 35: Eclipse & MyEclipse User Guide

Page 35 of 120

You can select an existing Hibernate config file or create a new one. With theFramework sample v3.o We can select the existing config file.

Click Ok, then click Next and uncheck the Create SessionFactory Class option.Click Finish.

Page 36: Eclipse & MyEclipse User Guide

Page 36 of 120

5.1 Customizing the Hibernate Configuration File

Then MyEclipse shows the Hibernate config file:

You can change the Hibernate Database connection details or the properties or theMappings files.

5.2 Create Hibernate Java Table Mapping

Step: 1 – Open Database Connection

Page 37: Eclipse & MyEclipse User Guide

Page 37 of 120

Step: 2 – Select the table in DB Browser and create Hibernate Mapping

Page 38: Eclipse & MyEclipse User Guide

Page 38 of 120

Sample Output

Page 39: Eclipse & MyEclipse User Guide

Page 39 of 120

6 Running and Debugging J2EE Application

This section explains how an enterprise application could be debug with help ofEclipse IDE.

6.1 Debug Configuration SetupSteps to setup debug configuration.

6.1.1 Debug Option

Page 40: Eclipse & MyEclipse User Guide

Page 40 of 120

6.1.2 Remote Java Application

6.1.3 Create New configuration

Page 41: Eclipse & MyEclipse User Guide

Page 41 of 120

6.1.4 Project Detail and PortName of new configuration, select project to debug and enter Host & Port.

6.1.5 Display Debug in Favorites Menu

Page 42: Eclipse & MyEclipse User Guide

Page 42 of 120

6.2 Application Debugging

6.2.1 Set Break Points

6.2.2 Debug PerspectiveOpen Debug perspective to view application flow and value of variables at breakpoints.

Page 43: Eclipse & MyEclipse User Guide

Page 43 of 120

6.2.3 Server Launch ModeSet JBoss launch mode debug mode.

Deploy the application and start the JBoss server.

Page 44: Eclipse & MyEclipse User Guide

Page 44 of 120

6.2.4 Launch the Application

6.2.5 Execute Application FlowExecute the application flow to be tested.

Page 45: Eclipse & MyEclipse User Guide

Page 45 of 120

6.2.6 Move over the Brake Points

6.2.7 Check Value of variables

Page 46: Eclipse & MyEclipse User Guide

Page 46 of 120

7 Junit

7.1 Creating the Junit directory Structure:

Select the Package Explorer preview from the WindowsShow view packageExplorer.

Now the test folder needs to be created where all required test files will be present.

Right click on the project and select new source folder as shown in the screenshot.Name the folder as test this exposes the test folder to the compiler.

Page 47: Eclipse & MyEclipse User Guide

Page 47 of 120

Page 48: Eclipse & MyEclipse User Guide

Page 48 of 120

7.2 Creating the Junit test class :

Select the class for which the test case needs to be written. Right click on it selectnewjunit TestCase as shown in the screen shot.

Page 49: Eclipse & MyEclipse User Guide

Page 49 of 120

Page 50: Eclipse & MyEclipse User Guide

Page 50 of 120

On the next window make sure Junit 3.8.1 is selected ,make sure the packagestructure is same as the testing class and select the checkbox setup and teardown aswe are going to require that .

Click the button Browse next Source folder and select the source folder as the precreated test directory as shown in the Screen shot.

Page 51: Eclipse & MyEclipse User Guide

Page 51 of 120

Click ok, and so now it looks like .

Page 52: Eclipse & MyEclipse User Guide

Page 52 of 120

Click next and select the methods in the testing class, which we want to test. Referscreen shot below.

Page 53: Eclipse & MyEclipse User Guide

Page 53 of 120

And now the test class is created having the following directory structure.

Page 54: Eclipse & MyEclipse User Guide

Page 54 of 120

7.3 Running the test class

Write the code for testing with a sample test method for example.

public void testUpdateAuthor() {System.out.println(“Hello world test”);

}

Now to run the test class, right click on the test class, select RunAs and then JunitTest as shown in the screen Shot.

Page 55: Eclipse & MyEclipse User Guide

Page 55 of 120

The test runs and on the left Junit pane it shows green or red depending on weatherthe test was Success or Failure .

If it is red the Stack trace on the small window gives the cause of Failure.

Page 56: Eclipse & MyEclipse User Guide

Page 56 of 120

1.1 Failure stack Trace

Page 57: Eclipse & MyEclipse User Guide

Page 57 of 120

8 Using Visual SourceSafe with MyEclipse

Firstly, We have to follow some prerequisites-steps regarding VSS, to set out ourenvironment, before we Can work with MyEclipse and VSS plugin.

8.1 Share Project with VSS Repository

You should set VSS databse for your project. We can do this by using the right clickcontext menu on the MyEclipse project e.g. framework3-sampleWeb. Team -> ShareProject, which brings up the select repository wizard dialog.

Page 58: Eclipse & MyEclipse User Guide

Page 58 of 120

Select VSS Configuration Wizard and Click Next

Page 59: Eclipse & MyEclipse User Guide

Page 59 of 120

Select the appropriate settings:

Remote example:

Local example:

Username is the username used for authentication in the VSS database.

Page 60: Eclipse & MyEclipse User Guide

Page 60 of 120

Password is the corresponding password. VSS directory is the full absolute directory path to the VSS Database holding

the srcsafe.ini file. Then add the first mapping. e.g. Z:\DBSoftware(for remoteconfiguration) or \\GeamVss01\VSS\DBSoftware (for local configuration).

Source dir is the MyEclipse project dir, which is the base dir for all operations.For example if you're Eclipse project uses /src as it's root directory for allsource, you should select that directory for this setting. This must be a validMyEclipse project directory path.

Relative mount point is the VSS project (directory), which is the root of alloperations in the VSS database. If the source code you are interested in lies inthe VSS Project $/DBSoftware/WEB/Framework/Version 3.0/framework3-sampleWeb use that directory as relative mount point. This must be a validVSS project path.

Click Next to see the screen below. This screen shows you the mapping between thelocal folders and VSS folders. Click Finish.

Page 61: Eclipse & MyEclipse User Guide

Page 61 of 120

8.2 Latest Code from VSS Repository

Since now you have configured the VSS with this project, once you right click thatproject in MyEclipse package explorer window, you will see a different options in theshortcut menu (shown below)

Page 62: Eclipse & MyEclipse User Guide

Page 62 of 120

Do team Refresh, always does a full Get Latest Version and then queries theVSS database for the status (checked out, existing, and so on..) for each filewithin the database. You use this each time you want the VSS Plugin to havethe correct state for each file. It can be a time consuming since it has to querythe database separately for each file.

Get Latest Version, get the latest version from the VSS repository. Update Status, works like the Refresh but without the "Get Latest Version",

which makes it faster lightweight operation. Check Out, checks out the file/files from the repository. If a writable copy

exists of a file the user is prompted if the local copy should be replaced andany dirty open editor with the file should be reverted.

Check In, checks the file/files with changes into the VSS repository. Undo Checkout, releases the file/files in the repository.

Page 63: Eclipse & MyEclipse User Guide

Page 63 of 120

Commit Changes - Tries to add all local files and check-in all files currentlychecked-out. The user is prompted for a selection of files to add. Easy to usefor committing all changes made back to the VSS database.

Synchronize with Repository - Brings up the platforms Synchronize view witha full diff of all local files with the files/folders in the VSS database.

Add to VSS, adds a local files to the VSS database. Delete from VSS, deletes an existing file from the VSS database. It also

removes the local copy. Deconfigure VSS, only available on the project root folder; remove the VSS

Plug in from the project. After a configuration removal it might be necessaryto close he project and reopen it for updating the view.

8.3 How to view/edit the configuration settings or configuredmappings?

You have to use the properties in the context menu on the project root folder andselect VSS Configuration.

Page 64: Eclipse & MyEclipse User Guide

Page 64 of 120

8.4 VSS Plugin preferences

You can set some preferences with the VSS plugin. Preferences are found underWindow -> Preferences -> Team -> VSS.

Page 65: Eclipse & MyEclipse User Guide

Page 65 of 120

9 Connect an Existing Project with SVN

If project is not created in Subversion Source code Management repository, thenplease refer section 10.11 Set Up Project on Source Management Server.

9.1 Checkout the Project

If you haven’t installed Subversive follow the 10.10 Installation Subversive stepsbefore start with this section. To Checkout a Project from the repository to your localworkspace, and once opened the repository, right click on every module of and clickcon Find/Checkout As…

Check the “Check out as a project configured using the New Project Wizard” radioand click on Finish

Page 66: Eclipse & MyEclipse User Guide

Page 66 of 120

9.1.1 Checkout Enterprise Application ProjectIt will open the New Project Wizard, select the Enterprise Application Project and clickon Next.

Write the name for your project and make sure that “New web module project” and“New EJB module project” are both uncheck and then click on Finish.

Page 67: Eclipse & MyEclipse User Guide

Page 67 of 120

It will share the project in your workspace, as you can see in your MyEclipse Java orJava perspective.

9.1.2 Checkout EJB ModuleNow we must do the same process to check out the other two modules. First, withthe EJB module, Go to Find/Check Out As…

Check the “Check out as a project configured using the New Project Wizard” radioand click on Finish.

Page 68: Eclipse & MyEclipse User Guide

Page 68 of 120

Select the EJB Project and click on Next.

Type the name to the EJB module and click on Finish. In this example it must be“framework2.3 sampleEJB”.

9.1.3 Checkout Web ModuleNow we do the same process to check out the Web module. Go to Find/Check OutAs…

Page 69: Eclipse & MyEclipse User Guide

Page 69 of 120

Check the “Check out as a project configured using the New Project Wizard” radioand click on Finish.

Select the Web Project and click on Next.

Page 70: Eclipse & MyEclipse User Guide

Page 70 of 120

Type the name to the Web module and click on Finish. In this example it must be“framework2.3 sampleWeb”.

9.1.4 Add Modules to Enterprise Application ProjectNow we need to add the EJB and Web modules to the application module, in order todo that please refer to Appendix Section 10.6 Add and Remove Application Modulefrom Enterprise Project .

9.1.5 Add Jar Files in Build Path of EJB & Web ModuleNow, in your local copy, add the jar files in order to prevent from errors andExceptions, please refer to Section 10.5 Add JAR files in Build Path of ApplicationModule .

9.2 Revert the Changes in web.xml & application.xml done by EclipseIDE

Once you have done, you should see something like this:

Page 71: Eclipse & MyEclipse User Guide

Page 71 of 120

9.2.1 Revert the Changes of web.xmlExpand the WebRoot/WEB-INF folder inside the Web module; you’ll see the web.xmlfile. We must revert it in order to eliminate the MyEclipse changes to this file. Doubleclick on it. You should see something like this:

Right click on it, go to Team and select Revert…

Page 72: Eclipse & MyEclipse User Guide

Page 72 of 120

It shows you the next window, be sure that just the web.xml file is checked then clickon OK.

Once done you must see how this file changes its content.

9.2.2 Revert the Changes of application.xmlExpand the application project module and its META-INF folder, you’ll see theapplication.xml file, double click it and see it.

Page 73: Eclipse & MyEclipse User Guide

Page 73 of 120

As you saw, the application.xml file had changed to this.

You must revert the changes automatically done to the application.xml file, just likewe did with the web.xml file.

Page 74: Eclipse & MyEclipse User Guide

Page 74 of 120

You should see how the file’s content come back to the last version.

9.3 Check Project Structure in Java Perspective

You will see the same project structure in both, the SVN Repository Perspective andthe Java Perspective, but you can see in the Java Perspective you’ll see the projectlibraries were added.

9.4 Synchronizing the SVN Repository

When you are checking out or sharing a project and you are working in a Team, youmust synchronize with the repository, in order to do this, right click on the enterpriseapplication project of your local workspace, go to Team and select “Synchronize withRepository”. It will compare your local copy with the repository and show you alldifferences.

9.5 Adding new Packages and Classes in the Project

The way to create a new package and/or class is simple, you must mark the folderwhich in you want to create and right click, then new and select the package or classor whatever you want to create.

Lets create the “com.commons.framework” package inside the framework2.3sampleWeb/src.

Page 75: Eclipse & MyEclipse User Guide

Page 75 of 120

NOTE: When you see the ‘?’ symbol in a file/folder, it means that it has changessaved only in your copy of the project, but in the repository, so you must first add itto version control and then commit.

Now, in your Java Perspective right click on the new package, go to Team and select“Add to Version Control…”.

It will show you the new files to add to version control, just click on OK.

Page 76: Eclipse & MyEclipse User Guide

Page 76 of 120

Now create a “Testable” interface inside this package with a single method, lets say“String getName();”.

Page 77: Eclipse & MyEclipse User Guide

Page 77 of 120

Once done, you must add it to version control too.

And finally create two classes inside the same package, the “NewTester” class whichimplements the interface. Right click on the package, go to New and select Class.

Click on “Add…” and it will show you and empty window, write the name of theinterface you want to implement, select it and click on OK.

Page 78: Eclipse & MyEclipse User Guide

Page 78 of 120

Write the rest of the class’ code.

And add it to version control too. Now create the second class, lets say “NewTester”.

Page 79: Eclipse & MyEclipse User Guide

Page 79 of 120

With the next code:

And add it to version control too. Once you have done all your work, you can commitall your new classes with a right click on the src folder, go to Team and selectCommit…

The next screen will show you all the files to update in the repository, those whichhave been changed or added, write a comment of your changes or additions andclick on OK.

Page 80: Eclipse & MyEclipse User Guide

Page 80 of 120

Now you can see in the SVN Repository Perspective that your new file is added in therepository.

9.6 Editing existing files in the Project

To edit an existing file just find it and double click it in your Java Perspective, it will beshown in the workbench’s center, there you can edit it. Once finished save the fileand commit it, just like we did in the last section.

9.7 Deleting a File from Repository and Revert Back

NOTE: It’s important to know that you must do all changes in your local copy,because if you want to revert any change before committing, you can do it, like weare going to see in this section.

For this example let’s delete the config.properties file under framework2.3sampleWeb/src/resources. In order to do it select the file and right click on it, thenselect Delete option.

Page 81: Eclipse & MyEclipse User Guide

Page 81 of 120

It will prompt you to confirm the deletion. Clock on Yes

As we mentioned, this change just will happen in your personal copy until youcommit. If we made a mistake and want to revert it, we must select the file’s parentfolder and right click, go to Team and select Revert.

Page 82: Eclipse & MyEclipse User Guide

Page 82 of 120

It will show you all the recent deleted files, check all you want to come back and clickon OK.

You will see how the previously deleted file comes back to your local copy.

9.8 Deleting a File from Repository and CommitIf you had deleted or modified a file and you are sure the change is correct, you canthen Commit…, just like we did previously, and the changes will be done in therepository too.

9.9 DisconnectingOnce you have finished your work with the repository and you have saved andcommitted all changes, if you won’t work with this project any more, then right clickon the application module, go to Team and click on Disconnect

Page 83: Eclipse & MyEclipse User Guide

Page 83 of 120

It will prompt you to confirm if you want to just disconnect or want to delete theconnection files from your project. If you won’t connect again to the project, you cancheck “Also delete the SVN metainformation from the file system” and click in OK.

Repeat this with every module in your project. Once you have done, you can deletethe project from your workspace without risk to affect the repository.

9.10 Create and share a ProjectAnother common task is to create a new project in your local workspace and share itin the Repository. In order to do this we must first create the project, just like we did inthe 1.1 Create Enterprise Project section. Lets suppose that we already have createdthe NewAppTest project in our local with some packages and classes, like we can seein the next screenshot.

Change to the SVN Repository Perspective and right click on the repository, go toNew and select Folder.

Page 84: Eclipse & MyEclipse User Guide

Page 84 of 120

Write the folder name as your local project and click on OK. Now you can see thenew folder in the repository. Go back to the Java Perspective. Right click to theapplication folder of your project and go to Team -> Share Project…

Select the SVN repository type and click on Next.

Page 85: Eclipse & MyEclipse User Guide

Page 85 of 120

Check “Use existing repository location: ” and be sure that the URL in the squarebelow is your correct repository URL. Then click on Next.

Select the “Use multiple projects layout with the specified root name: ” radio, makesure that in the next text field is written the name of the folder you created in therepository and uncheck the “Use subversive recommended layout”. Then click onFinish.

Page 86: Eclipse & MyEclipse User Guide

Page 86 of 120

It will show you the Commit window, look for all the MyEclipse special files, like“.mymetadata” or “.myeclipse”, and uncheck it. Then click in OK.

Repeat all this steps to share the EJB and the Web modules to the same folder in therepository. At the end, you must see in the repository something like this:

Page 87: Eclipse & MyEclipse User Guide

Page 87 of 120

Page 88: Eclipse & MyEclipse User Guide

Page 88 of 120

10 Appendix

10.1 Installing and Configuring MyEclipse

This section follow all the steps to get and install MyEclipse IDE. You do not have toinstall any software to run the MyEclipse 5.5 GA, for early versions, please review therequirements.

10.2 eRequest Process to get MyEclipseTHIS IS ONLY THOSE LOCATED IN GE ASSET MANAGEMENT, STAMFORD OFFICE.

Raise E-Request to install Eclipse & MyEclipse to your desktop.

E-Request is hosted on home page of GEAM Intranet websitehttp://geam.home.ge.com/portal/site/corpam/.

Page 89: Eclipse & MyEclipse User Guide

Page 89 of 120

10.3 Personal Installation of Eclipse & MyEclipseYOU MUST HAVE ADMINISTARTOR RIGHT OF LOCAL MACHINE.

10.3.1 Installation of Java10.3.1.1 Check Available JavaCheck available JDK version on your machine. Go to command prompt and type java–version.

Java version must be 1.4.2_XX, preferred 1.4.2_15.

Note: - If Java version is other than 1.4.2 minor release, please uninstall available JDKand do fresh installation of Java.

10.3.1.2 Fresh Installation of JavaTake available j2sdk-1_4_2_15-windows-i586-p.exe from GE Libraries and install.http://libraries.ge.com/download?fileid=19291060101&entity_id=2603839101&sid=10110.3.1.3 Java PathSet bin path of installed JDK in PATH variable of System or User variable and checkJava version once again.

10.3.2 Installation of EclipseTake eclipse-SDK-3.2.2-win32.zip from GE libraries and unzipped in C: or D: drive.http://libraries.ge.com/download?fileid=19291321101&entity_id=2603839101&sid=101

10.3.3 Installation of MyEclipseTake MyEclipse_5.5.1GA_E3.2.2_Installer.zip from GE libraries.http://libraries.ge.com/download?fileid=19291451101&entity_id=2603839101&sid=101

10.3.3.1 Installation ExecuteExtract it in local drive. It contains “MyEclipse_5.5.1GA_E3.2.2_Installer.exe” and“MyEclipse 5.5.1 GA Release Notes.pdf”. Double click Installer Exe and follow theinstruction.

Page 90: Eclipse & MyEclipse User Guide

Page 90 of 120

10.3.3.2 License AgreementAccept the license agreement, and click Next.

Page 91: Eclipse & MyEclipse User Guide

Page 91 of 120

10.3.3.3 Eclipse FolderChoose installed folder of Eclipse 3.2.2.

Page 92: Eclipse & MyEclipse User Guide

Page 92 of 120

10.3.3.4 MyEclipse Installed FolderBy Default MyEclipse will installed under Programs Files. You could be installed anywhere in your local drive.

Page 93: Eclipse & MyEclipse User Guide

Page 93 of 120

Page 94: Eclipse & MyEclipse User Guide

Page 94 of 120

10.3.3.5 Shortcut FolderChoose Shortcut Folder: Select according your preferences.

Page 95: Eclipse & MyEclipse User Guide

Page 95 of 120

10.3.3.6 Pre-Installation SummaryReview the Pre-Installation Summary before click on install button. You can get backto change some option.

Page 96: Eclipse & MyEclipse User Guide

Page 96 of 120

10.3.3.7 Release NoteYou could very well see release note.

Page 97: Eclipse & MyEclipse User Guide

Page 97 of 120

10.3.3.8 Installation Completion ConfirmationConfirm successful completion of MyEclipse installation.

Page 98: Eclipse & MyEclipse User Guide

Page 98 of 120

10.3.3.9 Eclipse WorkspaceSet eclipse workspace. So all project created will in chosen workspace.

10.3.3.10 Entering the subscription codeTo have your MyEclipse installation done, you have to enter a subscription code. Goto Window > Preferences > MyEclipse > Subscription > Enter Subscription.

Page 99: Eclipse & MyEclipse User Guide

Page 99 of 120

10.3.3.11 Setting the standard JDKCheck JDK version. So Eclipse automatically pick Java version from classpath.

10.3.3.12 Compiler SettingSelect compliance level under compiler. It must be 1.4.

Page 100: Eclipse & MyEclipse User Guide

Page 100 of 120

Page 101: Eclipse & MyEclipse User Guide

Page 101 of 120

10.4 Importing/Copying Source files into ProjectFollow these steps for the same: -With-in Eclipse, select the “Project/Project-folder” in which the folders/files need to beimported. For example, if we would need to import the folders/files under ourenterprise application project folder, so we will select the project name “framework3-sample”.

Select “File->Import” (OR right click on project name and select Import)

Click Next

Depending upon the source of the files, select “File System” or “Zip file” or any othersource, as shown in the next screen. In our case, it is “File System”, since the sourcefiles are in a directory on the hard drive. Click Next.

Select the source folder for the files. After selecting the source folder, select thefolders/files to be imported.

On this screen, make sure of the following important points: -Correct folder name is selected in the “From directory” (source folder). Note here,since we need to import the contents of “META-INF” and “APP-INF” folders and theseare under “C:\framework3-sample\framework3-sample”, so we have selected thispath here.

Page 102: Eclipse & MyEclipse User Guide

Page 102 of 120

Select Checkboxes for APP-INF and META-INF folders in the left pane.Correct folder name is shown in the “Into Folder” textbox. By default it will be thesame folder, which you selected before starting the import. So, you can change ithere also, if you feel that it is not the correct one.Select folders APP-INF and META-INF from the folder list and select build.xml from thefile list.Select the correct radio button option under “Options” section.

Note:- Do not import any eclipse spesific file, vssver.scc and .file.Click Finish.

Now it will start importing folders/files in your project and if you already have thefiles with the same name in your project, you will be prompted for overwriting them.

Page 103: Eclipse & MyEclipse User Guide

Page 103 of 120

Once you get the prompt for overwriting, make your selections accordingly. Here, wewill select “Yes to all”.

After all the selected folders/files are imported successfully; you will be able to seethose folders/files into your project directory structure. See the screen below,showing the imported folders/files.

If you are not able to see the directory structure similar to this, then you need todelete the created folders/files and then try importing the files again into yourproject.

Page 104: Eclipse & MyEclipse User Guide

Page 104 of 120

10.5 Add JAR files in Build Path of Application ModuleSelect application module, right click and select menu option properties. Select Java BuildPath and go to Libraries tab.

Click Add JARs button and navigate to APP-INF/lib/framework of current project. If there isany application specific jar files, put also in build path in same way.

Page 105: Eclipse & MyEclipse User Guide

Page 105 of 120

Page 106: Eclipse & MyEclipse User Guide

Page 106 of 120

10.6 Add and Remove Application Module from Enterprise Project

10.6.1 Add Application Module to Enterprise ProjectSelect enterprise project folder in Package Explorer perspective and right click. SelectMyEclipse -> Add and Remove Project Modules. Click Add button.

Select New Application Module and click Finish.

Page 107: Eclipse & MyEclipse User Guide

Page 107 of 120

10.6.2 Remove Application Module from Enterprise ProjectSelect enterprise project folder in Package Explorer prospective and right click. SelectMyEclipse -> Add and Remove Project Modules.

Select module to be removed from Current Module Projects and click remove button.

Page 108: Eclipse & MyEclipse User Guide

Page 108 of 120

10.7 JBoss Installation

First, make sure you have taken latest JBoss distribution:http://libraries.ge.com/foldersIndex.do?entity_id=2647616101&sid=101&ohr_id=501082932&sf=1&prod_id=0

Installation for JBoss is quite simple, since you just need to extract the JBoss .zip fileon a hard drive folder and you are done.

Page 109: Eclipse & MyEclipse User Guide

Page 109 of 120

10.8 Ant Installation

Steps to install Ant.

Take Ant zip from library and unzip directly C: or D: local drive.Add the bin directory to your path.Set the ANT_HOME environment variable to the directory where you installed Ant.Set the JAVA_HOME environment variable. This should be set to the directory whereyour JDK is installed.

Page 110: Eclipse & MyEclipse User Guide

Page 110 of 120

10.9 VSS plugin prerequisites

10.9.1 Getting access to VSS DatabaseBefore you can use VSS capabilities with MyEclipse you have to get access to VSSDatabases, you can do this requesting access at erequest.http://erequest.geam.corporate.ge.com/erequest/eRequestHomeAction.do

10.9.2 Get Installed a Microsoft VSS clientAlso, you have to get installed a Microsoft VSS client. You can do this requestingaccess at erequest application.http://erequest.geam.corporate.ge.com/erequest/eRequestHomeAction.do

10.9.3 Add VSS database to local client

Following are the steps to add VSS database to local client.

In windows explorer, click on Tools->Map Network Drive. Select some Drive: say Z and against Folder: give \\geamstvss01\vss, uncheck

Reconnect at Logon box and click on Finish. A separate windows explorer screen will be opened. You can close that as we

don't do anything in that window. Now launch VSS client on your machine. VSS login screen will be displayed.

Provide user name and password. Click on Browse to provide the database. Another screen "Open Sourcesafe Database" will be displayed. Again click on

Browse button. "Find database" screen will be displayed. Go back one level up and click on My

Computer. You should see the drive Z you mapped earlier. Double click on that drive. All VSS databases will be displayed. Double click on your application folder. You should see sub-folders and files under

that folder. Select srcsafe file and click on Open. Now you should be able to see that database added to your Sourcesafe

Database screen. Click on the checkbox "open this database next time I run Visual sourcesafe" to

check, so that next time you login into VSS client directly with out mapping geamstvss01. This is just a one time exercise.

Page 111: Eclipse & MyEclipse User Guide

Page 111 of 120

10.10 Installation of Subversive

The Subversive project aims to provide Subversion (SVN) integration for Eclipse.Polarion Org started the Subversive project and it became and Eclipse official project,so you can find more info about in both sites, the Polarion Official site and the Eclipseofficial site:http://www.polarion.org/index.php?page=overview&project=subversivehttp://www.eclipse.org/subversive

Steps to install Subversive.

10.10.1 Proxy SettingsFirst you need to check if your Proxy Settings are already configured, in order to dothis, in you workbench, go to Window -> Preferences -> Internet ->Proxy Settings.Check the “Enable Proxy” checkbox and write you local Proxy Host and Proxy Port(Contact your local Network Administrator if you don’t know this).

Page 112: Eclipse & MyEclipse User Guide

Page 112 of 120

10.10.2 Installing SubversiveOnce done, you can install Subversive. Go to Help -> Software Updates -> Find andInstall… It will show you this screen:

Check the “Search for new features to install” radio and click on Next.

10.10.3 Update Site

This screen will vary depending on the features you have installed already. You wantto click on the “New Remote Site” button. Note: If you are behind a proxy and theEclipse install mechanism does not work, then you can download a zipped version ofthe update site and then click the “New Local Site” button instead.

Page 113: Eclipse & MyEclipse User Guide

Page 113 of 120

10.10.4 Downloading SubversiveIn this screen you must write the correct NAME and URL of the site to download theinstallation, with Eclipse 3.2.2 and MyEclipse 5.5.1 GA you must write:NAME: Subversive 1.1.xURL:http://www.polarion.org/projects/subversive/download/1.1/update-site/

Then click en OK. It will show you the sites window, something like this:

Be sure that the only site checked is the one you have added: “Subversive 1.1.x” andclick on Finish. In the next window expand all features and select “SVN Team Provider1.1.x”.

Page 114: Eclipse & MyEclipse User Guide

Page 114 of 120

10.10.5 InstallationAccept terms of license agreement and click on the Next > button.

Click on the Finish button in order to start the download of selected features.

Page 115: Eclipse & MyEclipse User Guide

Page 115 of 120

Click on the Install All button in order to confirm installation of downloaded features.

To apply installation changes and restart Eclipse click on the Yes button.

Page 116: Eclipse & MyEclipse User Guide

Page 116 of 120

10.10.6 SVN RepositoryFinally, after restarting Eclipse, the first thing you will typically want to do is open theSVN Repository perspective where you can define your repositories. Make sure thatyou have permissions to access it. It will show you this screen, select SVN RepositoryExploring and OK.

Page 117: Eclipse & MyEclipse User Guide

Page 117 of 120

10.10.7 Add SVN Repository

Enter URL of your project location on SVN and click Finish button.

On the example in this guide we are using the repository:svn://geamstlxsvn01p.geam.corporate.ge.com/framework

Page 118: Eclipse & MyEclipse User Guide

Page 118 of 120

10.11 Set Up Project on Source Management Server

10.11.1 eRequest

Submit an eRequest for project setup on Source Code Management System. Providefollowing details: -

Asset Class Name Project Name Application Name Brief about project modules

http://erequest.geam.corporate.ge.com

10.11.2 Standard Enterprise Project Folder Structure

Down load myproject.zip from library and unzip in at you local drive say undersourcecode_repository.http://libraries.ge.com/download?fileid=19531701101&entity_id=2603839101&sid=101

10.11.3 Rename the foldersmyproject: - Project Name. E.g. smart, pm-plm etc.myapp1: - Application Name. E.g. bank-recon, risk etc.

Page 119: Eclipse & MyEclipse User Guide

Page 119 of 120

10.11.4 Recommended Directory Contents

Directory Name Directory Contentsapps Base directory for applications.web Contains the static content of the resulting WAR file.web/WEB-INF Contains the web.xml deployment descriptor and static configuration

files such as struts-config.xml. May also include vendor-specific runtimedeployment descriptors, such as applicationContext-hibernate.xml.

test The top-level test/ directory contains project-wide tests. Each individualmodule should also include a unit test, which should be placed in thesrc/test directory for each module.

10.11.5 Scenario I - Source code available on existing Source Code ManagementSystem.Take latest version of source code of web and/or ejb module from existing Sourcecode management system i.e Visual Source Safe (VSS) in respective folders by usingVSS client. Search "vssver.scc" file in apps folder and delete them.

10.11.6 Scenario II - Source code is not available on existing Source CodeManagement System.Take latest source code of web and/or ejb module from shared folder, ftp server, localmachine etc and copy into respective folder.

Page 120: Eclipse & MyEclipse User Guide

Page 120 of 120

Map and add local folder myproject to new Source Management ManagementSystem with help of respective source management client.

Don't import following file or folder into source code management system.Class files.Eclipse specific folders and files.Enterprise project folder and files.Unwanted files. E.g. vssver.scc, test.sql etc.


Recommended