Overview (& RAD Comparison) of MyEclipse for WebSphere
1. MyEclipse, WebSphere & RAD
This document introduces you to MyEclipse by taking a look at each of the important features related to using WebSphere. This document also makes note of key similarities and differences between MyEclipse and IBM Rational Application Developer® (RAD) in an attempt to help familiarize IBM RAD developers with MyEclipse. The MyEclipse and RAD IDEs share many common concepts, tools and facilities such as Perspectives, Views, Preferences, etc. Additionally, there are a number of important differences between the two IDEs such as default workbench layout, tool names and functional scope representation. We will try to clarify the most fundamental differences to help make MyEclipse a comfortable fit for you.
Note: WebSphere support requires a MyEclipse Blue or Bling subscription.
MyEclipse (and IBM RAD) is built on top of the Eclipse platform. Because of this, the interfaces, layout, concepts and naming of a lot of the UI elements in both IDEs are either the same or look very similar. This section of the document reviews the most general areas of the IDE such as the default perspective layout, the available perspectives, project creation, and getting help.
MyEclipse opens to the default MyEclipse Java Enterprise perspective.
Note to RAD Users: The layout of this perspective is similar to the RAD Java EE Perspective.
The MyEclipse Explorer on the left is your main mode for navigating and working with project resources. You also have the Problems, Tasks, Servers, Console and other views. In addition to the default MyEclipse Java Enterprise Perspective in MyEclipse, there are many other perspectives available for working with additional technologies like persistence technologies, databases, Swing GUI Design, enterprise reports, and more.
While you are free to open any of the perspectives and work with them, any time you work with a resource that is related to a perspective (like designing a Swing GUI), MyEclipse displays a prompt allowing you to switch to the appropriate perspective.
You can create a new MyEclipse project from the toolbar shortcut button.
You can also open the New Project window by selecting File>New>Project. The New Project window displays a listing of all the supported project types.
Starting a new project from the menu
Coming from IBM RAD, you may be wondering where certain project types went, if those technologies are still supported in MyEclipse, and if they are, how to continue working with them. As a quick reference for new users, we provide the following matrix that gives you a good idea of how your old IBM RAD project types map to projects or functions in MyEclipse.Notes:
- When the same project is used in both IBM RAD and MyEclipse, it will be indicated as “(Same)”.
- Some project types carry the same name across the two IDEs, but they are in fact different project types.
|IBM RAD Project Type||MyEclipse Project Type|
|General ( Same)||General ( Same)|
|Java ( Same)||Java ( Same)|
|CVS ( Same)||CVS ( Same)|
|Static Web Project / Dynamic Web Project||Web Project|
|EJB Project||EJB Project|
|Enterprise Application Project||Enterprise Application Project|
|Utility Project||Java Project|
|Application Client Project||Application Client Project|
|Connector Project||Connector Project|
|Portlet Project||Portlet Project|
|BIRT / Crystal Reports||Report Web Project|
|Eclipse Modeling Framework ( Same)||Eclipse Modeling Framework (Same )|
|Plug-in Development ( Same)||Plug-in Development ( Same)|
You’ll notice that for the majority of projects you are used to working with in IBM RAD, the same or similar project type is supported in MyEclipse.
Adjust preferences for MyEclipse by selecting either Window>Preferences>MyEclipse or MyEclipse>Preferences:
Now that you are a bit more familiar with MyEclipse, for developers that want to learn how to use the MyEclipse tools, a good place to start is the tutorials listed in the Help Contents. Each of the tutorials walks you through the step-by-step process of creating a new project and working with a specific technology or technique in that project. For developers that like to dive head-first into a new technology, we encourage you to utilize the Examples On-Demand repository. You can find these examples by selecting MyEclipse>Examples On-Demand or clicking the Examples tab on the MyEclipse Dashboard.
The repository contains many projects that can be installed directly into your workbench with a single click, and then run by following the instructions provided with the project (usually in the README.txt file).
As you saw in Section 2.3, MyEclipse supports quite a few project types out of the box. A common project type that you will work with in MyEclipse is the Enterprise Application project. Enterprise Application projects are assigned modules (other projects) that belong to them but don’t contain project contents like source files themselves.
You can easily modify the modules (or projects) that belong to an Enterprise Application project including any number of EJB, Web or Java projects that belong to and are deployed with the Enterprise Application project (EAR). You can also include Application Client projects, and Connector projects with JCA support for connecting with one or more enterprise information system (EIS). You can create, deploy, and test projects across all deployment modes to WebSphere 6.1 and above.
3.1 Web Projects
A MyEclipse Web project is an Eclipse Java project that includes metadata defining the project’s web nature and a directory structure patterned after the Java EE web archive (WAR) structure. For Web Projects in MyEclipse, there is no distinction between a Static or Dynamic Web Project. There is only a Web Project that, once created, has a very standard “exploded WAR” layout to it by default:
When including a Web project as a EAR module, you can either use an existing Web project or create a new one during the creation of a new EAR project.
Use the Web Deployment Descriptor editor for configuring web.xml.
To learn more about Web projects, see the MyEclipse Web Project Tutorial.
3.2 EJB Projects
A MyEclipse EJB Project is a basic Eclipse Java project that includes a META-INF folder and additional metadata required by the MyEclipse EJB tools, such as the EJB Creation wizards and the MyEclipse Deployment Services. Thus, standard Eclipse and third-party Java tools can be used within a MyEclipse EJB project. You can distinguish MyEclipse EJB Projects from other project types by the project icon,. When including an EJB project as a EAR module, you can either use an existing EJB project or create a new one during the creation of a new EAR project.
Easily edit a project’s EJB deployment descriptor with the form-based deployment descriptor editor.
To learn more about EJB projects, see the MyEclipse EJB Development.
3.3 Connector Projects (JCA)
EAR projects can include JCA (connector) project modules for connecting with one or more enterprise information system (EIS). When you create a Connector project, you specify the EAR project with which to associate.
The connector configuration file, ra.xml, can be easily edited using the JCA editor.
3.4 Application Client Projects (ACP)
When you create an Application Client project, you specify the EAR project with which to associate.
The Application Client editor allows advanced, but easy editing of the application-client.xml file.
You can make significant application client project launch customizations using the ACP Launch Configuration wizard. Access configurations by right-clicking the project, and selecting either Run As>Run Configurations or Debug As>Debug Configurations.
Projects for Java EE 5 and higher support IBM WebSphere-specific descriptor files for bindings, extensions, and programming model extensions. MyEclipse includes visual editors for these descriptor files, which are used by EAR, EJB, Application Client, and Web projects. Access these special descriptor files through the application deployment descriptor file editor for each of these project types. When you click the WebSphere deployment descriptor links, the editor checks to see if the file exists. If not, you can choose to have the file generated for you.
Binding and extension files are created as either version 1.0 or 1.1, depending on the version of WebSphere selected as a project’s target runtime environment. WebSphere 8.0 or higher uses binding and extension files of version 1.1. WebSphere 7 uses version 1.0.
In MyEclipse, you deploy, or publish, your projects to an application server. To run or debug your project, you select an application server configured in MyEclipse to deploy your project to, and then run the application server. However, before discussing deployment, there are a few concepts you should know so you are aware of the deployment options available.
The selected WebSphere deployment mode determines whether or not have a choice of general deployment modes. The WebSphere deployment mode is set in the WebSphere server configuration file. The general deployment mode can be selected when you deploy a module to the server.
WebSphere Deployment Modes
Classic Mode: Both the Exploded deployment and Packaged general deployment modes are available as options when you deploy a project to a server.
In-Workspace Mode: This is the default setting, and neither general deployment mode is available as an option. This mode is a hybrid Exploded deployment mode. This mode deploys EAR files from the Workspace location rather than being copied to the WebSphere profile location. This is the fastest mode, but can be used on only EAR projects. Synchronization of resources and code is handled by WebSphere directly. This mode is most appropriate for rapid application evolution while debugging.
General Deployment Modes
Exploded Deployment (Development Mode): This is a development-centric, but non-standard Java EE application packaging and deployment model. Similar to packaged deployment, an application’s deployable resources are organized to conform to a Java EE standard folder/file structure. But, rather than create and deploy a single archived file, the entire application resource structure – folders and files – is copied by the application server connector to the server’s special deployment location for exploded archives. The MyEclipse Deployment Service, using “Sync-on-Demand” technology, keeps all MyEclipse project deployments synchronized with all source changes in their corresponding MyEclipse project.
Packaged Deployment (Production Mode): This is the production-centric Java EE standard application packaging model for deployment. It consists of packaging an application’s resource into a single ZIP archive file with an internal Java EE standard file structure. The resulting single archive file is then deployed to a target application server by the application server’s connector. Packaged archive deployment does not support incremental or automatic archive update. Thus a package deployment becomes out of sync with its source project as edits are made to the project’s resources. Periodic publishing is required to synchronize a deployed application’s state with the latest version of its MyEclipse project source.
Deploying a project can be done several ways:
- Drag a project to a server in the Server’s view
- Right-click a project and select MyEclipse>Add and Remove Project Deployments
- Click the Manage Deployments icon on the main toolbar
- Right-click a server in the Servers view, and select Add/Remove Deployments
- Click the Add/Remove Deployments icon on the Servers view toolbar
Deploying using the drag and drop method immediately adds the project to the server as exploded by default. You can change the default deployment mode of a project in the project preferences. Right-click the project, and select Properties from the menu. Expand MyEclipse, and select Server Deployment.
Using the Manage Deployments icon on the main toolbar allows you to view projects deployed to servers and add and remove deployed projects. You can also publish a selected server to sync all deployed projects. You can set up any number of deployments for a project to any number of servers. You can have a single Web project deployed to WebSphere, Tomcat, JBoss and Glassfish at the same time, and MyEclipse keeps all of those deployments in sync for you.
Note to RAD Users: This is different from IBM RAD in that your project isn’t tied to the Runtime you configure for your project.
When you add a project to a server, the Add and Remove window opens, allowing you to add/remove one or more projects.
Deployments for Web, EJB, EAR. projects are all handled the same way. When adding projects to a server that uses a MyEclipse connector (as opposed to a third-party connector), you can control the deployment mode, exploded or packaged. On the Add and Remove window, you can change the default deployment mode using the drop-down list beside the module once you’ve moved it to the Configured column. The icon beside the module indicates the deployment mode. For example, indicates an exploded web module, and indicates a packaged web module.
Note: If deploying to WebSphere using the default WebSphere Deployment mode of In-Workspace, exploded and packaged deployments are not applicable.
We encourage developers working on actively changing projects to stick to the exploded mode to make deploying and testing changes as they work faster and easier, but you can work with whatever kind of deployment you prefer. For a faster deployment experience, you can disable EJB project deployment for EAR projects deployed to WebSphere 6.1 and up. Disable the EJB deploy step on the EAR properties page, and then run the EJB deploy manually only when required.
Deploy the EJB manually by right-clicking the EJB project, and selecting MyEclipse>Run EJB Deploy.
EJB Deploy properties for an EJB 2.x project allows you to configure the EJB deployment.
Before jumping to this section, be sure you have covered Section 5 and understand how deployments are handled in MyEclipse. After your project is deployed to your application server, you need to make sure the application server is running and hosting your project (web or enterprise application) so you can connect to it and run it. You can manage your configured application servers from the toolbar or from the Servers view.
These controls give you the ability to Start, Stop and Restart the application server of your choosing. Any server run from MyEclipse displays its output directly in the Console view.
From the Console view, you can monitor all output from the server (error, logging, etc.) and from your own projects deployed to it. After your project has been deployed to an application server and that application server is running in Debug mode, you can place breakpoints directly in your project source files, and then exercise that application so those breakpoints are activated (hit).
Note to RAD Users: This debugging process should feel somewhat familiar to IBM RAD users as the fundamental mechanics of setting and hitting breakpoints is similar. As an example, the following illustration uses the MyBlogStrutsHibernateExample project from the Examples On-Demand repository.
In the browser in the top center is running the application that, in this case, is about to post a new blog message. You can see below it, the PostDAO class is open. Also note the text that mentions the PostDAO.save method is the one called when the user clicks the Submit button to post a new blog message. Assuming we want to debug this save operation, we set a breakpoint in the editor by double-clicking in the left hand margin. You can see the breakpoint marker looks like a small sphere. After clicking Submit in the browser, MyEclipse executes up to the line where we set the breakpoint, and then pause execution of the application and opens the Debug perspective to dig into any and all runtime states of the application we want to inspect.
In the screen above, you see we hit the set breakpoint. You can also see that we are inspecting the value of transientInstance and its Title and Content values match exactly what we typed into the form. These are a few examples of how debugging works in MyEclipse. You can set more breakpoints, conditional breakpoints, watch expressions and more, but from this example you now know how to get started.
In MyEclipse, the ability to work with additional technologies on a given project (Java Project, Web Project, etc.) is handled by adding additional configuration information and possibly libraries to a project at which point specialized tools become available to work with that new technology. This is done by adding facets to a project. Facets are project and context-sensitive, meaning, not every capability can be added to every project. Some are intended only for Web projects, others work on any project. Additionally, some facets cannot be added to a project after other facets have already been added. In this case, those particular facets are disabled from the Project Facets menu.
When adding most facets, you are prompted for additional metadata required to configure and install that feature for the given project. For example, adding JavaServer Faces or Struts facets require that you let MyEclipse know where critical files for the particular framework reside in your project so it can provide additional tooling for them.
After those facets are enabled, you can make use of the specialized tools that MyEclipse provides to work with them. Examples are tools such as the Visual Report Designer, Visual JSF Page Designer (shown below), Struts Flow Designer (shown above) and many more specialized tools available in MyEclipse for your enterprise development.
While we have covered all the basics you need to get started working with MyEclipse, there are hundreds of features we didn’t cover that could become your next favorite feature. In an effort to make you feel more comfortable with MyEclipse, we want to point out some of the hottest and most popular features our users like using in the IDE. We hope you see a lot of things you like.
SWT/Swing GUI Designer
Advanced Persistence Tools
Enterprise Report Designer
Ajax Workbench and Tools
… JAX-RPC/JAX-WS Web Services, Spring, XDoclet, HTML/JSP/Struts/JSF Visual Page Designers, Facelets or support for whatever other technology you are utilizing in your project or want to utilize.
See MyEclipse Plays Well with RAD & WebSphere for a RAD/MyEclipse feature comparison.