Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Beginners Guide

Sean Rogers

Version: 3.2.0.Beta


1. Introduction
2. The interface
2.1. Eclipse
2.2. JBoss Application Server
2.2.1. Using the application server shipped with the JBoss Developer Studio
2.2.2. Adding a new application server for use with the JBoss Developer Studio
3. Java Web (EE) and Standard Edition (SE) Plug-Ins
3.1. Visual Web Tools
3.2. Seam Development Tools
3.3. Hibernate Tools
3.4. Portal Tools
3.5. JMX Tools
3.6. JSF Tools
3.7. JBoss AS Tools
3.8. Archive Tools
4. Service-Oriented Architecture Development
4.1. jBPM Tools
4.2. ESB Editor
4.3. Web Services Tools
4.4. Drools Tools
4.5. Eclipse Guvnor Tools
5. Where to go from here
6. Workshops
6.1. RESTEasy
6.2. Seam
A. Revision History

The JBoss Developer Studio is an Integrated Development Environment (IDE) that includes JBoss Tools and assists with the development of applications and services on JBoss Middleware software. These tools have been developed and are used by developers for increased efficiency and productivity with JBoss software.

This guide covers the basics of the interface you will be working with and the tools within it, assuming as little knowledge on your side as possible. If you are not familiar with JBoss Developer Studio then this guide is the best place to begin.

The interfaces that the JBoss Developer Studio IDE is built for are discussed.

Eclipse is the container for all development work in the JBoss Developer Studio. It allows for control over the running of the application server, the applications on it and provides an interface for developing your own applications.

Eclipse is started by double-clicking on the eclipse executeable in your installation directory.

Following this you will be asked to specify a workspace. A workspace is the location on your computer where your files will be stored relating to the multiple sessions. If you wish to change your workspace location after this step you can do so by following the menu items File, Switch Workspace, Other....


After selecting a workspace location, you will be greeted with the Welcome screen. This screen provides a few pathway options, including a Getting Started link to a selection of documentation, an option to create a new project with the Create New... option and an option to skip straight to your Workbench.


Skipping straight to your workbench, you will see a screen with a few sections and the JBoss Application Server listed in the bottom area of the interface.


In the bottom left hand corner of the screen is a picture of a white column with a blue bar and a yellow plus sign beside it. Clicking on this button will open a menu of different views and windows.


The window that may be of most use to you can be found by following: Other...JBoss Tools WebJBoss Tools Palette. This window opens an interface to the tools included with the JBoss Developer Studio.

Refer to the Welcome to JBoss Developer Studio section of the Getting Started with JBoss Developer Studio guide for further details.

The JBoss Application Server provides the full range of Java EE 5 features as well as extended enterprise services including clustering, caching, and persistence.

This section discusses the JBoss Application Server with regards to its use through Eclipse. Once you have started the Eclipse interface for the JBoss Developer Studio, the JBoss Application Server can be started by clicking on its name in the lower part of the window and then clicking the green arrow to the right.


Note

If the Servers view is not displayed at the bottom of your Workbench, you can activate it through WindowShow ViewOtherServerServers and then click the OK button.

After the server has been successfully started the status next to the server name will change from displaying Stopped to displaying Started, Synchronized.


Once Eclipse and the server are started, double click on the server name in Eclipse to see an Overview screen in the center.


From this Overview section there are six subsections consisting of: General Information, Login Credentials, Publishing, Timeouts, Server Polling and Server Ports.

The General Information subsection allows you to change the Server name and Host name to your own preferences. By clicking on the Runtime Environment label a dialog box with options to change the name of the server runtime, the home directory, the Java Runtime and which server configuration should be used when running the application server. The Open launch configuration button displays a dialog box for configuring the technical details of the application server instance.

Below the General Information subsection is the Login Credentials subsection. Set the User Name and Password for secure access to your server.

The Publishing subsection at the top right of the Overview section allows you to set when applications will be published to the location specified (whether the applications will be made available through the application server depends on the server running and if it is configured to recognise dynamic changes). You can select to either never have an application be published automatically or for a check of new applications yet to be published to occur at a certain timed interval.

The Timeouts subsection below Publishing allows you to set the start and stop time (in seconds) for the server to complete all of its operations. This setting is made available in order to decrease the chance of the server freezing or hanging.

Below the Timeouts subsection is the Server Polling subsection. A server poller gathers information about the server at certain points in time, capturing information about processes and applications. This section allows you to select between either the JMX Poller or Timeout Poller for startup and the Process Terminated Poller or Timeout Poller for shutdown.

The final subsection is Server Ports, below Server Polling. This section allows you to alter the port numbers that the server pollers gather their information from. The two settings of JNDI Port and Web Port are set to be automatically detected by default; normally there should be no reason to manually select the port numbers.

Note

Changing the Server Ports subsection configuration will not alter which ports the server itself listens on.

Default access to the server can be achieved by typing the address http://localhost:8080 into your Internet browser address bar.


Refer to the Manage JBoss AS from JBoss Developer Studio chapter of the Getting Started with JBoss Developer Studio guide for further details.

Though the JBoss Developer Studio may come with a pre-configured application server, you can still add your own servers. This section details how to add additional servers for use with the JBoss Developer Studio.

To add a new server runtime follow these steps:

Once the new sever has been added, you can select it for use by clicking on its name in the Server Runtime Environment list and then clicking the OK button that will then take you back to the main Eclipse interface.

To start your new server, select it from those available through the Servers view and click the white arrow in a green circle.

Included JBoss Developer Studio Java plug-ins are detailed.

Visual Web Tools aids in the development of web pages and web projects.

Visual Page Editor

The Visual Page Editor allows an application to be developed alongside a visual preview. The application can be viewed either as the source code, as a preview of the application, or both simultaneously in a split-screen presentation. The Visual Page Editor can be used for developing an application using technologies such as JavaServer Faces (JSF), JavaServer Pages (JSP), Struts, and Hypertext Markup Language (HTML). The Visual Page Editor also features a graphical toolbar for in-line styling.


Refer to the Editors chapter of Visual Web Tools Reference Guide for full details.

JBoss Tools Palette

The JBoss Tools Palette provides access to tag libraries for creating JSP and JSF pages. Tags can be quickly inserted into pages from a number of included libraries:

  • HTML

  • JBoss

  • JSF

  • JSTL (JSP Standard Tag Library)

  • MyFaces

  • Oracle ADF (Application Development Framework) Faces

  • Struts

  • XHTML (Extensible Hypertext Markup Language)

Custom-made tags and third-party tag libraries can also be included in the JBoss Tools Palette.


Refer to the JBoss Tools Palette chapter of Visual Web Tools Reference Guide for full details.

Web Projects View

The Web Projects View is an additional view. It enhances project authoring with a number of features:


Refer to the Web Projects View chapter of Visual Web Tools Reference Guide for full details.

OpenOn

OpenOn provides an easy method for switching directly from one project resource to another without navigating through the Package Explorer view. Pressing F3 or Ctrl+click when a reference to another file is highlighted will open the file in the editor.

Refer to the Editors chapter of Visual Web Tools Reference Guide for full details.

Content Assist

Content Assist displays context-specific code completion suggestions while typing, speeding up development and reducing typing errors. Content Assist is supported in a number of contexts:

The suggestion list can be displayed by pressing Ctrl+Space, and the highlighted entry can be selected and inserted by pressing Enter.


Refer to the Editors chapter of Visual Web Tools Reference Guide for full details.

Drag-and-Drop

Properties, managed bean attributes, navigation rules, tag library file declarations, and JSP pages can all be dragged from the Web Projects view and dropped into the editor to add content.

Refer to the Web Projects View chapter of Visual Web Tools Reference Guide for full details.

RichFaces Support

RichFaces and Ajax4jsf tag libraries can be used from the JBoss Tools Palette, and RichFaces components are rendered in the Visual Page Editor.

Refer to the Editors chapter of Visual Web Tools Reference Guide for full details.

JBoss Seam combines several technologies to reduce the complexity of developing modern Web 2.0 applications:

Seam provides an interface to these different technologies through simple Plain Old Java Objects (POJO), user interface components, and XML. Seam does not distinguish between presentation-tier components and business logic components in an effort to present a simple, unified component model for the Java Enterprise Edition platform. Seam also provides mechanisms to manage application states across multiple workspaces, methods to manage workflow and pageflow through jBPM, and comprehensive integrated testing features.

The Seam Development Tools in the JBoss Developer Studio allow for easy Seam application development:

New Seam Project wizard

The New Seam Project wizard allows the details of the Seam project to be configured, including target runtimes, target servers, project facets, and web module settings, then generates all the necessary files for a Seam project.


Other Seam wizards

Wizards are also included for creating new Seam Actions, new Seam Forms, new Seam Conversations, and new Seam Entities.

Entity generation

Another wizard exists for generating Seam entities. The wizard produces a set of CRUD (create-read-update-delete) Seam components and web pages. These can be generated by reverse-engineering an existing database, or by using existing entities in the application.

Editors and views

There are a number of editors available in the JBoss Developer Studio for working with Seam in addition to the Visual Page Editor:

The Seam Editors feature Content Assist and OpenOn; for more details on these technologies refer to Section 3.1, “Visual Web Tools”. Seam Editors also feature validation tools to highlight potential issues with the application.

CRUD database applications

CRUD refers to the four basic SQL commands: create, read, update, and delete. A CRUD database application uses forms to retrieve data from and submit data to a database.

CRUD database applications can be created through the New Seam Project wizard.

TestNG

TestNG (Testing, the Next Generation) is a Java-based unit testing framework. TestNG suites can be added to a project through the New Seam Action wizard.

Refer to the Seam Development Tools Reference Guide for full details.

Included JBoss Developer Studio plug-ins for development on Service-Oriented Architecture (SOA) are detailed.

The Enterprise Service Bus (ESB) is an abstraction layer that interacts with the messaging system in a Service-Oriented Architecture (SOA).


The JBoss Developer Studio includes a tool called the ESB file Editor. Through the use of this tool you can develop an application that will utilize the advantages of ESB technology. Features of the ESB Editor include:

ESB syntax validation

Contextual error checking is provided constantly, with error checking on incorrect or incomplete tags also included when using the Source viewer.

XML schema support

By checking the child elements of the providers, the ESB Editor relays incorrect usage combinations to you through error messages upon startup.

ESB XML content assistance

Content Assist enables you to write code fast and with accuracy when using the Source mode.

Synchronized source and visual editing

The ESB Editor gives you the choice of using a graphical view (Tree), a code view (Source) or both when developing your ESB applications. With both instances open at once, the changes made to one can be directly viewable in the other, ensuring that you are always working with the most current version of your application no matter your choice.

Refer to the ESB Editor chapter of the ESB Tools Reference Guide for further information.

JBoss ESB intergrates component messaging into the JBoss Service-Oriented Architecture, serving as an integral part of JBoss middleware suite. For information on how to use and configure JBoss ESB with the JBoss Service-Oriented Architecture refer to the Using and Configuring SOA Platform chapter of the ESB Tools Reference Guide.

Eclipse Guvnor Tools work with Drools Guvnor through rich web based GUIs and editors to provide a centralized repository for a vast quantity of rules. You can store versions of rules, models, functions, processes and other Drools generated components that all relate to executeable knowledge bases. Access to the Guvnor is controlled, allowing you to lock down access and restrict features so domain experts (non programmers) can view and edit rules without being exposed to all the features at once.

The tools included for Eclipse Guvnor are outlined as follows:

Guvnor Connection Wizard

The Guvnor Connection Wizard is used to create a connection to a Guvnor repository. This wizard can be started by following the menu items FileNewOtherGuvnorGuvnor repository location, through the Guvnor Repositories View and other locations throughout Eclipse Guvnor Tools. Refer to the Guvnor Connection Wizard section of the Functionality Overview chapter within the Eclipse Guvnor Tools Reference Guide for more details.


The Guvnor Repositories View

The Guvnor Repositories View tool displays the contents of a repository using a tree structure. From within this tool you can create a new Guvnor repository connection, remove a Guvnor repository connection, refresh the tree display and expand or condense the tree layout. Refer to the Guvnor Repositories View section of the Functionality Overview chapter within the Eclipse Guvnor Tools Reference Guide for more details.


Guvnor Resource History View

The task of the Guvnor Resource History View is to display the revision history details for files that are both locally stored and within Guvnor repositories. Refer to the Guvnor Resource History View section of the Functionality Overview chapter within the Eclipse Guvnor Tools Reference Guide for more details.


Guvnor Resource Importing Wizard

The Guvnor Resource Importing Wizard assists with the copying of one or more files from a Guvnor repository to the local workspace (while keeping file association with the Guvnor repository). This wizard can be started by following the menu items FileImportGuvnorResource from Guvnor. Refer to the Importing Guvnor Repository Resources section of the Functionality Overview chapter within the Eclipse Guvnor Tools Reference Guide for more details.


Actions for Local Guvnor Resources

Through Eclipse Guvnor Tools a variety of actions can be performed on a file. Those actions are:

Refer to the Actions for Local Guvnor Resources section of the Functionality Overview chapter within the Eclipse Guvnor Tools Reference Guide for more details.

For documentation on the plugins available as part of the JBoss Developer Studio visit http://www.redhat.com/docs/en-US/JBoss_Developer_Studio/.

For documentation about the JBoss Enterprise Application Platform visit http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/.

For information pertaining to Eclipse visit http://www.eclipse.org/.

Follow the instructions in these workshops to broaden your knowledge and understanding of the JBoss Developer Studio.

In this RESTEasy workshop we will provide an example of how to solve the problem of creating new customers for an online store. This will be achieved through the creation of a shopping application and adding customer records through a web browser.

Prerequisites

The following technologies are necessary for this workshop:

Make sure the JBoss Developer Studio is open with the application server running. For the purpose of simplicity it will be assumed for the rest of the workshop that you are running the JBoss Enterprise Application Platform 5, however the steps will be the same if you are using the JBoss Service Orientated Architecture Platform 5.

In the JBoss Developer Studio navigate to HelpProject Example.


In the Project Example menu dialog box, scroll to RESTEasyRESTEasy Simple Example and click Finish.


There may be two issues to fix before you can continue. The description for each of these will be Target runtime JBoss 4.2.2 Runtime is not defined and Java compiler level does not match the version of the installed Java project facet. If they do not appear skip to Figure 6.7, “Completed fixing the issues”. If they do appear, the following steps will resolve these issues.


To fix the first issue with the description Target runtime JBoss 4.2.2 Runtime is not defined click on this description and then click the Quick Fix button.


The next dialog box will display two runtime issues to fix, however by fixing the second one labeled as Configure Targeted Runtimes both issues will be corrected.

Select the issue called Configure Targeted Runtimes and click the Finish button.


A large dialog box will open with a long list of property categories on the left hand side. Navigate down to and click on the Targeted Runtimes property title. To the right of the menu where the JBoss 4.2.2 Runtime box is selected, deselect it and then select the name of your JBoss Enterprise Application Platform 5 runtime.

Once the JBoss Enterprise Application Platform 5 is selected and the old runtime deselected, click the Apply button and then the OK button.

Note

In Figure 6.6, “Selecting the correct runtime”, the runtime that will be used is the one called JBoss EAP 5.0 Runtime Server, though the name will depend on what you called it when you configured the server for use with the JBoss Developer Studio.


To fix the second issue with the description Java compiler level does not match the version of the installed Java project facet click on this description and then click the Quick Fix button.

After clicking the Quick Fix button the Java compiler issue should disappear because the JBoss Developer Studio has made the necessary changes in the background to fix it.

The Quick Fix dialog box should now be empty. Click the Finish button.


To add the project to the JBoss Enterprise Application Platform 5 server right click on the server name in the Servers tab in the bottom section of your workbench. Click on the Add and Remove... option.


From the Add and Remove dialog box ensure the box labeled If server is started, publish changes immediately is ticked. In the left-hand menu, highlight the project you just created called simple by clicking on it.


Click the Add > button to move it from the left-hand menu labeled Available to the right-hand menu labeled Configured. Once this is completed click the Finish button.

Your RESTEasy project has now been deployed onto your server. We will now test the application by using the REST Client plug-in within the Firefox web browser.

Open your Firefox web browser and navigate to ToolsREST Client.


In the REST Client click on the Add Request Header button and type content-type for the Name and application/xml for the Value. This will ensure that the content will be consumable by the Plain Old Java Object (POJO) service at the server.

Select POST from the Method drop-down menu, copy http://localhost:8080/simple/rest-services/customers into the drop-down menu beside the Method and paste the following into the Request Body:

<customer><first-name>Bill</first-name><last-name>Burke</last-name><street>256 Clarendon Street</street><city>Boston</city><state>MA</state><zip>02115</zip><country>USA</country></customer>

The XML for the Request Body must not contain any spaces between XML tags to avoid exceptions occurring at the server end.

Click the Send button to add the customer information.


To ensure the customer details were added, change the Method type to GET and the URL address to http://localhost:8080/simple/rest-services/customers/1. The /1 is added to the URL to select the customer with the customer id of 1, since that is the number that was given to the customer.

Click the Send button to retrieve the information. Select the Response Body tab beneath the Request Body section to view the returned information.


We have added a customer and retrieved their information, now we will update their information. To achieve this change the Method to being PUT and copy the following into the Request Body (overwriting anything that may be in the Request Body already):

<customer><first-name>Gary</first-name><last-name>Lamperillo</last-name><street>256 Clarendon Street</street><city>Venice</city><state>CA</state><zip>90291</zip><country>USA</country></customer>

Remember to make sure there are no spaces between the XML tags when you copy the information into the Request Body.

Check to make sure the URL still reads http://localhost:8080/simple/rest-services/customers/1 from when you retrieved the customer information. By using the URL that references the ID of the customer you are updating that customer's record.

Click the Send button to update the information.


To verify that the record has been updated change the Method type to GET, ensure the URL still references customer ID 1 and click the Send button.

Select the Response Body tab beneath the Request Body section to view the returned information.


The RESTEasy workshop is now complete.

Revision History
Revision 1Mon Feb 22 2010Isaac Rooskov
Review and editing
Revision 0Thu Nov 26 2009Isaac Rooskov
Initial creation of book by publican