application server for developers

15
WebSphere Application Server for Developers V7 Quick Start Guide 1 Introduction This is a quick start guide to using WebSphere Application Server for Developers V7 on the Windows platforms. WebSphere Application Server for Developers is a free version of the WebSphere Application Server for use in a development environment only. It allows application developers to develop and unit test against the same run time as the production version of the WebSphere Application Server. The outline for this guide is as follows: Section 2 covers how to download, install, and set up WebSphere as well as how to use the web-based administrative console Section 3 covers how to download, install, and configure Eclipse to work with WebSphere Application Server for Developers V7. Section 4 demonstrates how to deploy and debug a web application with JDBC to the application server with a sample application. Section 5 provides additional references, including a description of WebSphere Application Server for Developers V7.0 red book, the benefits of upgrading to IBM Rational developer tools, and useful URLs. 2 Setting up WebSphere Application Server 2.1 Downloading WebSphere Application Server for Developers V7 To download WebSphere Application Server: 1. Go to . http://www.ibm.com/developerworks/websphere/downloads/ 2. Click on the link WebSphere Application Server for Developers V7.0. 3. Click on the link Download now, under the Download section. 4. Log in with your IBM ID and password if you have one or register for an IBM ID. You can also click on Proceed without an IBM ID. 5. Under Offering, select WebSphere Application Server for Developers V7.0 for Windows and click Continue. 6. Fill out the form on the next page as appropriate and click I confirm. 7. Under Download using Download Director , select the ZIP file, and click the Download now link. A Download Director window will pop up, where the File attribute is the file path to which your selected package is downloaded to. Download Director requires a plug-in, which you may not have, so alternatively, you can choose the tab Download using HTTP and click the Download now link next to the ZIP file. 2.2 Installing WebSphere Application Server To install WebSphere Application Server:

Upload: elihux

Post on 23-Nov-2015

14 views

Category:

Documents


0 download

DESCRIPTION

WebSphere Application Server for Developers V7Quick Start GuideThis is a quick start guide to using WebSphere Application Server for Developers V7 on theWindows platforms. WebSphere Application Server for Developers is a free version of the WebSphereApplication Server for use in a development environment only. It allows application developers todevelop and unit test against the same run time as the production version of the WebSphereApplication Server. The outline for this guide is as follows:

TRANSCRIPT

  • WebSphere Application Server for Developers V7 Quick Start Guide

    1 IntroductionThis is a quick start guide to using WebSphere Application Server for Developers V7 on theWindows platforms. WebSphere Application Server for Developers is a free version of the WebSphereApplication Server for use in a development environment only. It allows application developers todevelop and unit test against the same run time as the production version of the WebSphereApplication Server. The outline for this guide is as follows:

    Section 2 covers how to download, install, and set up WebSphere as well as how to use theweb-based administrative console

    Section 3 covers how to download, install, and configure Eclipse to work with WebSphereApplication Server for Developers V7.

    Section 4 demonstrates how to deploy and debug a web application with JDBC to theapplication server with a sample application.

    Section 5 provides additional references, including a description of WebSphere ApplicationServer for Developers V7.0 red book, the benefits of upgrading to IBM Rational developertools, and useful URLs.

    2 Setting up WebSphere Application Server

    2.1 Downloading WebSphere Application Server for Developers V7To download WebSphere Application Server:

    1. Go to . http://www.ibm.com/developerworks/websphere/downloads/

    2. Click on the link WebSphere Application Server for Developers V7.0.

    3. Click on the link Download now, under the Download section.

    4. Log in with your IBM ID and password if you have one or register for an IBM ID. You can alsoclick on Proceed without an IBM ID.

    5. Under Offering, select WebSphere Application Server for Developers V7.0 for Windowsand click Continue.

    6. Fill out the form on the next page as appropriate and click I confirm.

    7. Under Download using Download Director, select the ZIP file, and click the Download nowlink. A Download Director window will pop up, where the File attribute is the file path to whichyour selected package is downloaded to. Download Director requires a plug-in, which you maynot have, so alternatively, you can choose the tab Download using HTTP and click theDownload now link next to the ZIP file.

    2.2 Installing WebSphere Application ServerTo install WebSphere Application Server:

  • 1. Unzip the downloaded package.

    2. In the unzipped folder, navigate to the WAS folder.

    3. Double-click on Install.exe.

    4. Follow the steps provided by the install wizard. Some things to note: Though we are not using the sample applications that comes with the product, installation

    of sample applications may be useful for you to test deployment of different applications onyour own later.

    The default installation directory may be changed so it's easier to navigate to. At least one profile must be created to use WebSphere Application Server. Profiles may be

    created through the install wizard or later. We will show you how to create the profile postinstallation, in case you want to create more than one profile later. So choose none whenyou reach the WebSphere Application Server Environment screen to not create the profile,and click yes when prompted with a warning.

    The installation directory will be referred to as for the remainder of this document.

    2.3 Creating profilesA profile is the set of files that defines a single WebSphere Application Server run-time environment.You can configure multiple profiles on a single machine without having to perform a completeinstallations every time. An initial profile can be created during installation. Follow the steps below tocreate a profile called dev after installation via the Profile Management Tool, a graphical user interfacetool that offers a step-by-step approach to creating a profile which prompts you for information at eachstep.

    1. Access the Profile Management Tool by going to Start > All Programs > IBM Websphere >Application Server V7.0 > Profile Management Tool.

    2. Click the Launch Profile Management Tool button or the Profile Management Tool buttonlocated under the menu bar.

    3. You will see a screen listing the profiles already created. Since you did not create a profileduring installation, you will not see any profiles listed. Click on the Create button.

    4. Select the desired environment for which to create with your profile which in this case isApplication server. An Application server environment is an independent server which isable to run your application. The Management environment allows you to manage multipleapplication servers through an administrative server and other services. Click Next.

    5. Select the profile create option you would like. If you would like to install the sampleapplications and/or choose to not run your application server as a Windows service, chooseAdvanced Profile Creation. Else, choose Typical Profile Creation. In our case, chooseAdvanced Profile Creation. Click Next.

    6. Click next at the Optional Application Deployment screen to choose the default to installthe administrative console and default applications.

    7. Under Profile name, enter dev. For the Profile directory, enter \profiles\dev .Click Next.

  • 8. Fill out the fields as follows: devNode for the Node name, server1 for the Server name,localhost for the Host name.

    9. Next, you can manage your security settings. To enable administrative security, select theEnable Administrative Security check box and fill out a user name and password of yourchoice. For the dev profile, enable security and pick a user name and password. Then, clickNext.

    10. You can choose whether to create a new security certificate or import from existing key stores.For the dev profile, accept the default values. Click Next.

    11. You can configure the security certificate further here. For the dev profile, accept the defaultsas is. Click Next.

    12. Next, you can specify the different access ports for your server. For the dev profile, click theDefault Port Values button to use the default ports. Click Next.

    13. You can choose whether to run your application server process as a Window service. You canuncheck Run the application server process as a Windows service if you do not wantWindows service to monitor your application server. Click Next.

    14. Next, you can choose whether to WebSphere will create a web server definition for yourserver. Click Next to choose the default to not create the web server.

    In the Summary page, review your selections and click Create to create the profile.

    2.4 Verifying the installationsFrom Windows, go to the Start Menu > All Programs > IBM WebSphere > Application ServerV7.0> profiles > dev > First Steps. From the new first steps window, click on installationverification. Monitor the progress in the new Installation Verification window, and ensure that itreports success at the end. Note that install verification leaves the application server running after it isdone.

    2.5 Starting/stopping servers

    2.5.1 startServerThe startServer script located at \profiles\dev\bin\ and is used to startan application server. The usage is: startServer [options]

    Our server name is server1. The most useful options are: -help: print available options -trace: enables tracing of the startServer command itself. The trace may be found at

    /logs/server1/startServer.log.Here is a sample output from startServer:

  • startServer server1ADMU0116I: Tool information is being logged in fileC:\was\profiles\dev\logs\server1\startServer.logADMU0128I: Starting tool with the dev profileADMU3100I: Reading configuration for server: server1ADMU3200I: Server launched. Waiting for initialization status.ADMU3000I: Server server1 open for e-business; process id is 2512

    2.5.2 stopServerThe stopServer script is located at \profiles\dev\bin\ is used to stop theapplication server. The usage is: stopServer [options]Our server name is server1. The most useful options are:

    -help: print usage information -trace: turn out trace of the command. -username : user name to access the application server

    -password : password needed to access the application server.

    Note that sometimes the server may be hung to the extent that you are unable to connect to it throughJMX. This happens rarely, but when it does happen stopServer will report that it's unable to contactthe server. You'll need to use an operating system tool such as Windows task manager to kill theserver. In order to kill the server, you will need to know the process id which can be found in theoutput from the startServer call as shown in the example in Section 2.5.1. The process id can also befound in the header of the startServer.log file located at \profiles\dev\logs\server1\.More about the log files is discussed in Section 2.6.

    2.6 Log FilesAs the application server is running, it logs information about its tasks and processes. These log filesare useful for problem determination within the application server, such as debugging applications,trouble shooting server crashes, and diagnosing server startup errors. These log files are located inthe directory:

    2.7 Logging into the Administrative consoleThe Administrative Console offers a browser-based graphical administrative interface. This is themost user friendly administrative tool for getting started with WebSphere.

    After starting the application server, open your browser, and type in the following URL: http://localhost:9060/ibm/consoleAccept the certificate from the application server if prompted. Type in the user ID and password tologin to the administrative console. Click on the left hand navigation to explore the different sectionsof the administrative console, including applications, server, and resources.

    \profiles\dev\logs\server1\

  • 3 Installing and Configuring Eclipse

    3.1 Downloading Eclipse

    Eclipse is a Java Integrated Development Environment (IDE) originally created by IBM and maintainedby the Eclipse Foundation. It is a light weight yet powerful IDE that we recommend for you to use forviewing the example application: DictionaryApp.

    This task will involve downloading the Eclipse IDE with WTP for JEE developers. If you already haveEclipse for Java SE developers, it is recommended that you re-download Eclipse with the WTPpackage as it is easier and more reliable than using the built-in updater to find Java EE plugins. Forthose who already have Eclipse for Java EE developers, you can skip this section, but be sure toconfigure Eclipse to run with the IBM JRE to ensure compatibility with WebSphere (Section 3.2). To download Eclipse:

    1. Go to http://www.eclipse.org/downloads/.

    2. Under the Eclipse IDE for Java EE Developers section, click the Windows 32 Bit link for 32bit Operating Systems or the Windows 64 Bit link for 64 bit Operating Systems.

    3. In the Download Selection Page, click on the download link provided to begin downloadingthe Eclipse IDE.

    3.2 Installing EclipseThe Eclipse download package does not come with a setup wizard. The executable for the IDE ispackaged directly within the zip archive. Details for accessing and preparing the Eclipse IDE isoutlined below:

    1. Unzip the downloaded package to a convenient location. This will be the location whereEclipse will be accessed.

    2. Navigate to the extracted directory and run eclipse.exe in the eclipse folder. After Eclipsestarts, go to Windows > Preferences. Within the preferences window, expand the Javamenu, and click on Installed JREs. In order to develop web applications to be deployed onthe application server, it would be best to specify Eclipse to use the IBM JDK. Therefore, clickAdd..., and select Standard VM. Specify the following for the JRE home:

    3. Click Finish, and OK to apply the changes.

    Now the Eclipse environment should be ready for WebSphere Java EE development. For those whowould just like to see web applications in action in WebSphere Application Server, Section 4 will detailhow to import the DictionaryApp source code into Eclipse for reference.

    \java\jre

  • 4 Example Application: DictionaryAppAfter installing WebSphere Application Server, we will explore the application deployment process. Inthis section, you will learn how to deploy a sample application named DictionaryApp on the applicationserver.

    DictionaryApp is an associative mapping application which implements two functions of a dictionary:LOOKUP, which allows users to find the dictionary entry which is associated with the supplied word,and DEFINE, which allows users to update an existing entry or add a previously non-existent entry tothe dictionary. DictionaryApp will implement a dictionary as a servlet that forwards user requests forLOOKUP and DEFINE to a database connection manager, which will carry out these operations in adatabase containing the dictionary entries.

    4.1 DictionaryApp OverviewThe overall architecture of DictionaryApp is illustrated in Figure 1 as follows:

    Since this exercise focuses mainly on the application deployment process, we will not require you to construct the example application, DictionaryApp. We have provided a ZIP file that contains the Enterprise Archive (EAR) file of DictionaryApp and the Derby script to create the database DictionaryApp will run on. After you extract the contents of this archive, you can navigate to the DictionaryApp\ directory. This directory contains all the available files and will be referred to as in the future whenever any of these files will be needed.

  • Figure 1: DictionaryApp

    DictionaryApp will implement the Model View Controller (MVC) architecture by implementingDictionaryJDBCAdapter.java, a database adapter, as the model, showentry.jsp as the view, andDictionaryServlet.java as the controller. Whenever a user accesses DictionaryApp through theDictionaryServlet entry point, they will be directed to DictionaryServlet.java. From there,DictionaryServlet.java will process any requests specified by the user as tasks to be delegated to thedatabase adapter, DictionaryJDBCAdapter.java. After DictionaryJDBCAdapter.java has finished thetask, DictionaryServlet will forward the results to showentry.jsp, which will formulate the appropriateresponse to be sent back to the user.

    4.2 Importing DictionaryApp into EclipseThe EAR files provided with this document can either be directly deployed on the application server orimported into Eclipse for reference. The following instructions are applicable for importingDictionaryApp into Eclipse:

    1. Within Eclipse, go to File > Import in the top menu.

    2. Within the import wizard, select Java EE > EAR file, and click Next.

    3. Specify the file path to DictionaryApp.ear. You can also rename the EAR project which will beimported. Click Next.

    lookup.jsp

    DictionaryServlet

    DictionaryJDBCAdapter

    Database

  • 4. Select the checkbox next to DictionaryUtility.jar within the Utility JARs and web libraries sectionin order to import them into the project. Click Next.

    5. Click Finish to import the project.6. Add WebSphere j2ee.jar to the build classpath. This step is needed so that you don't get

    compilation errors for code that reference JEE specification defined classes. Go to Windows> Open Perspective > web. Right click on DictionaryWeb, and choose Properties. In thepop-up window, click on the Libraries tab, choose Java Build path, and click Add ExternalJars. Browse and add /lib/j2ee.jar.

    4.3 Creating a Derby DatabaseIn DictionaryApp, DictionaryJDBCAdapter.java implements LOOKUP and DEFINE through calling SQLcommands in the form of JDBC queries against a data source object with the JNDI namejdbc/DictionaryDB. Once DictionaryApp is deployed onto WebSphere, WebSphere will attempt to mapan actual data source resource to the DataSource object with the JNDI name jdbc/DictionaryDB inDictionaryServlet.java. This reference will then be passed into DictionaryJDBCAdapter.java to providea database connection for the database adapter.

    Thus, in order for DictionaryApp to run correctly, it is necessary to create a database to hold theentries of the dictionary and a data source to serve as the connection between the application serverand the database. Derby is a relational database management system which is included withWebSphere. You can configure any application to use a Derby database when a database resource isrequired. Instructions for creating a Derby database is outlined below:

    In Command Prompt, go to the directory:

    Run the prepared SQL script provided within the DictionaryApp attachment by invoking:

    This script contains all the instructions for ij.bat to open a database connection, create a database witha Dictionary table to store word and definition pairs, and populate the table with one entry ('IBM','International Business Machines').

    4.4 Creating a Data SourceAfter creating DictionaryDatabase, you can specify how the application server will accessDictionaryDatabase by configuring a data source, DictionaryDatasource. Take note of the specificnames provided in the configuration settings of the data source, because these names must match thebindings specified for DictionaryApp.

    Instructions for configuring DictionaryDatasource through the Administrative Console are outlinedbelow:

    1. Access the Administrative Console. Type in the user ID and password to login to the

    \derby\bin\embedded

    ij.bat \DictionaryAppDerbyScript.sql

  • administrative console.

    2. Inside the Administrative Console, expand the Resources section at the left. From the dropdown items, select JDBC. Under JDBC, select Data sources. This will take you to the Datasources page.

    3. Expand the drop down menu labeled All Scopes. This menu provides the list of all scopeswhich a data source can be created in. Select the scope which is the most appropriate for thedata source. For DictionaryApp, select the scope which includes your server name (server1 ifyou're using the same profile construction template as specified in Section 2.3), the mostspecific scope. Afterward, click the New button at the top left of the table to add a new datasource.

    4. Select the desired data source name and JNDI name for the data source. For DictionaryApp,use the name DictionaryDatasource and JNDI jdbc/DictionaryDB. Click Next.

    5. Select the desired JDBC provider for the data source. For DictionaryApp, choose Select anexisting JDBC provider and pick the Derby JDBC Provider from the drop down menu. ClickNext.

    6. Under the database name, supply the database directory created in Derby. ForDictionaryApp, simply type:

    Click Next.

    7. Choose the security settings as necessary. These settings dictate how applications will accessthe data source. For DictionaryApp, accept the defaults. Click Next to continue to theSummary page.

    8. Review the list of selected options, and select Finish when you are ready to create the datasource. Be sure to click the save link.

    4.5 Testing DictionaryDatasourceYou can also test the newly configured DictionaryDatasource. This can be done through theadministrative console by going to the Data sources page, selecting the target data source, andselecting the Test connection button. The application server will test whether it can establish aconnection with the database specified under the database name. The administration console shoulddisplay a message indicating whether the test connection was successful.

    It is advised that you test every data source you configure before you use it in order to make sure thatyou have specified the database name correctly and no other programs are currently using thedatabase. (One of the most common reasons the connection test could fail is if you did not disconnectfrom the database after you configured it with Derby).

    4.6 Deploying, Updating, and Access DictionaryAppThe last step is to deploy DictionaryApp onto the application server. This can be done through theAdministrative Console, which will prompt users for the necessary deployment information that must

    ${WAS_INSTALL_ROOT}\derby\DictionaryDatabase

  • be specified. This section will deal with how to install, start, view, update, and uninstall an applicationthrough the administrative console.

    4.6.1 Installing DictionaryAppInstructions for installing DictionaryApp through the administrative console are outlined below:

    1. Access the Administrative Console and select the Applications section at the left side of theconsole. Underneath the Application Types, select the Websphere enterpriseapplications category. This will take you to the Enterprise Applications page.

    2. Click the Install button.

    3. Select the Local file system option, and underneath, specify the file path to whereDictionaryApp is located in. Click Next.

    4. Choose the Fast Path installation. Using the fast path, the deployment wizard will skipadvanced settings and only prompt for the absolute minimum settings required to configure theapplication for deployment. Click Next.

    5. In Step 1 of the installation, configure the installation options as needed. For DictionaryApp,accept the defaults. Click Next.

    6. Select the server as to which the application will run on. For DictionaryApp, accept thedefaults. Click Next.

    7. In the Map resource references to resources section, you will be prompted to specify theJNDI names for all resource references within your application. For DictionaryApp, usejdbc/DictionaryDB, the JNDI name you specified for DictionaryDatasource, for the TargetResource JNDI Name. Click Next.

    8. In the Map virtual host for Web modules section, you will be prompted to specify the virtualhost for each web module in your application. For DictionaryApp, accept default_host as thevirtual host. Click Next.

    9. In the Summary, review your selections. Click Finish to install the application.

    10. Be sure to save the changes by clicking on the Save link.

    4.6.2 Starting/Stopping DictionaryApp

    After installing DictionaryApp, on the Enterprise Applications page, you will see that besideDictionaryApp, under the Application status, it is marked with an .

    This signifies that even though DictionaryApp has been installed, it has not been started. Therefore,you must start DictionaryApp in order to access it on the application server. Instructions for startingDictionaryApp through the administrative console is outlined below:

    1. Go to the Applications section at the left side of the Administrative Console. Underneaththe Application Types, select the Websphere enterprise applications category. This willtake you to the Enterprise Applications page.

  • 2. In the Enterprise Applications page, check the box next to DictionaryApp and click the Startbutton.

    If the application server is able to successfully start DictionaryApp, you should get an message statingApplication DictionaryApp on server server1 and node devNode started successfully.

    You can also follow the steps above to stop an application which has already started. In order to stopan application, select Stop instead of Start in the Enterprise Applications page

    4.6.3 Viewing DictionaryAppTo view DictionaryApp, the access URL:

    4.6.4 Changing DictionaryAppNow we will show you how to update DictionaryApp when changes are made to it. First, we willchange the source code as follows:

    1. In Eclipse, after importing DictionaryApp.ear, go to Window > Open Perspectives > web.You should see the web project, DictionaryWeb. In DictionaryWeb, expand the WebContentfolder, and open the file showentry.jsp.

    2. Make the additions outlined in black below to the showentry.jsp file to change color to blue.The additions will change the LOOKUP and DEFINE text to blue. Save your changes.

    Enter word:

    Enter definition:

    4.6.5 Exporting DictionaryApp EAR in EclipseTo see the changes we have made to DictionaryApp, we need to export a new EAR file so that we candeploy it on WebSphere. You should see an Enterprise Application project named DictionaryAppwithin your workspace. This project contains information about the modules contained within in theEAR file. If you make changes to any source files within DictionaryApp and would like to deploy it onthe application server, you can export an Enterprise Application project through Eclipse as a new EARfile containing the updated modules. Details for exporting the DictionaryApp project are outlined below:

    http://localhost:9080/DictionaryWeb/DictionaryServlet

  • 1. Right-click on the DictionaryApp Enterprise Application project and select Export > Ear File.2. A export wizard will open up. Within the export wizard, select the destination file path you

    would like to export the new EAR file to under Destination. You can check the Export sourcefiles option to tell Eclipse to export the source files within the EAR file. Also, you can check theOverwrite existing file option to tell Eclipse to overwrite any existing EAR files under thedestination file path. Click Finish to export the EAR file.

    The EAR file which is produced will be ready to be deployed on the application server.

    4.6.6 Updating DictionaryApp

    You can update any application you deploy on the application server. There are several ways toupdate applications on the application server. For this section, we will mostly focus on updating theentire application, which is similar to uninstalling and reinstalling the application. Instructions forupdating DictionaryApp with the changes you made in Section 4.6.4 are outlined below:

    1. Go to the Applications section at the left side of the Administrative Console. Underneaththe Application Types, select the Websphere enterprise applications category. This willtake you to the Enterprise Applications page.

    2. In the Enterprise Applications page, select the application to be updated and click the Updatebutton.

    3. Select Replace the entire application and Local file system. Specify the file path to theEAR file with the updated application module. Click the Next button, and you will be redirectedto Step 5 in the section Installing an Application just as if you had reinstalled the application.Be sure to click the save link to confirm your changes.

    If the installed application was running before it was updated, the application server will attempt tostart the application after the update. Otherwise, you will have to start the application by following theinstructions in Section 4.6.2. Now you can access the application URL to view the new updatedapplication.

    4.6.7 Enabling WebSphere Debug ModeRemote debugging in Java is the process of attaching a debugger from a different environment onto arunning JVM. This mode of debugging allows you to set up break points and debug applications step-by-step on a remote JVM. WebSphere Application Server debug mode allows you to attach anydebugger of your choice to the JVM running in your current process. Instructions for enablingWebSphere Application Server debug mode are outlined as follows:

    1. Access the Administrative Console.

    2. Inside the Administrative Console, expand the Servers section at the left. From the dropdown items, select Server Types. Under Server Types, select the WebSphere applicationservers option. This will take you to the Application servers page.

    3. Select server1 under the list of Application servers. This will take you to Applications servers>server1.

    4. Under the Additional Properties section, select Debugging service. This will take your to the

  • Debugging service page.

    5. Inside the Debugging service page, you can configure your process for debugging purposes.To enable debug mode upon server startup, check the Enable service at server startup box.Also, you can set up class filters to choose what classes the debugging process will ignore.Selecting a package, and clicking Add> will signal the application server to not stop withinclasses of that package in step-by-step debugging. Be sure to save by clicking the Save link.

    6. Restart the server to enable the configuration changes made.

    You can attach a debugger to your process JVM, specifying your server debug port (7777 if you areusing the default profile configured during installation). A tutorial for how to attach the Eclipsedebugger to the application server is documented in Section 4.6.8.

    4.6.8 Debugging DictionaryApp in EclipseThe Eclipse Remote Debugger is a powerful debugging tool with a user friendly interface. You candebug any application, including DictionaryApp, deployed on the application server with the EclipseRemote Debugger. This section will detail how to access DictionaryApp through the Eclipsedebugger. This method can be applied to any application deployed on the application server as longas you are able to import the source files within Eclipse. Details for starting and using the EclipseRemote Debugger is outlined below:

    1. Make sure the application server is configured to start in debug mode. Refer to section 4.6.7for how to enable debug mode on WebSphere.

    2. In Eclipse, navigate to Run > Debug Configurations.

    3. Select Remote Java Application in the navigation menu. Afterwards, click the New launchconfiguration icon, at the top of the menu.

    4. In the Create configuration screen, enter the name for this debugging configuration. This namewill be useful for referencing the same settings for future debugging session. For Project,select the name of the project you are trying to debug. For DictionaryApp, you can selectDictionaryWeb to debug DictionaryServlet. For Host, enter the hostname or IP address forapplication for which you are trying to debug. For DictionaryApp, if it is running within aWebSphere installation on the same machine, you can use localhost. For port, enter thedebug port for the server hosting the application you want to debug (7777 if you are using thedefault profile configured during installation). Click Apply to apply the debug configuration.Now that the configurations have been created, you can reapply this configuration every timeyou need to debug the same application with the same configurations.

    5. Open up DictionaryServlet, and add a breakpoint to the beginning of the doGet method by rightclicking on the left margin of the doGet method, and choosing toggle breakpoint. With remotedebugging, Eclipse does not control the JVM it is attempting to debug. Instead breakpointsmust be triggered from the application server. Therefore, deploy DictionaryApp if it has notalready been deployed. Access the application normally. The browser should hang whiledisplaying DictionaryApp, because the the application server process managing DictionaryAppshould trigger the break point set in doGet and report it to the Eclipse debugger. Check theEclipse debug perspective. If the break point was triggered correctly, you should be able to seethe contents of the thread running DictionaryServlet displayed.

    You are now able to debug step-by-step through DictionaryServlet.

  • 4.6.9 Uninstalling DictionaryAppAfter installing an application, you can uninstall it through the Administrative Console. Instructions foruninstalling DictionaryApp are outlined below:

    1. Go to the Applications section at the left side of the Administrative Console. Underneaththe Application Types, select the Websphere enterprise applications category. This willtake you to the Enterprise Applications page.

    2. In the Enterprise Applications page, select the application to be uninstalled and click theUninstall button.

    3. Confirm the uninstallation by clicking OK.

    4. You should be returned to the Enterprise Applications page. You will be able to see that theapplication DictionaryApp is not listed under the list of applications. Be sure to save to confirmyour changes.

    The above method can be used to uninstall any application through the administrative console.

    5 Additional Resources

    5.1 WebSphere Application Server for Developers V7.0 red bookThe WebSphere Application Server for Developers V7.0 red book provides in-depth coverage of howto use the WebSphere Application Server for Developers V7.0. It includes :

    how to administer WebSphere Application Server for Developers V7.0 via the administrativeconsole and scripting

    Enhancements to the dictionary application to cover Enterprise Java Beans (EJBs), JavaPersistence (JPA), Message Driven Beans (MDB), and web services.

    Additional debugging tools for memory leak, heap, and java core analysis available through theIBM Support Assistant.

    5.2 Rational Development ToolsYou can upgrade from Eclipse to IBM Rational Application Developer for WebSphere Software. It isbuilt on top of Eclipse, integrates directly with WebSphere, supports more than JEE programmingmodel, has a built in unit test environment, and is optimized for fast turn around with largeapplications. Use the following link to get more information about Rational Application Developer forWebSphere Software, and download a trial copy:

    http://www.ibm.com/software/awdtools/developer/application/

    Or you can move up to the full version of Rational Application Developer, which gives you additionalcapabilities such as code visualization (Java, EJB, JPA, WSDL), connecting to Enterprise InformationSystems (CICS, IMS, SAP), additional developer testing and analysis tools, collaborative coding anddebugging, and integration with source control, project management, and life cycle management toolssuch as Rational Team Concert, Rational ClearCase, and Rational RequisitePro. More informationabout Rational Application Developer can be found at:

    https://www.ibm.com/developerworks/wikis/display/rad/Home

  • Note that since Rational Application Developer is a super set of Rational Application Developer forWebSphere Software, you can use the materials in the education and training section of the RationalApplication Developer wiki with the trial copy of Rational Application Developer for WebSphere.

    5.3 Useful URLs

    WebSphere Application Server for Developers V7.0 redbook http://www.redbooks.ibm.com/abstracts/sg247913.html

    WebSphere Application Server For Developers http://www.ibm.com/developerworks/websphere/downloads/

    WebSphere Application Server V7 InfoCenter h t t p : / / pub l i b . bou lde r . i bm .com / i n f ocen te r /was in f o / v7 r0 / i ndex . j sp

    Rational Application Developer for WebSphere Software http://www.ibm.com/software/awdtools/developer/application/

    Radtional Application Developer wiki https://www.ibm.com/developerworks/wikis/display/rad/Home .

    Eclipse: http://www.eclipse.org