Notes on JBoss Tools

tieplantharrasInternet and Web Development

Nov 12, 2013 (3 years and 4 months ago)

81 views

Page
1

of
11

Notes on
JBoss Tools

Created 02/23/08

Updated 03/11/08,
Updated 12/17/08, Updated 01
/12/09, Updated 03/05
/09
, Updated 03/30/09, Updated 04/04/09

Updated 06/01/09
, Updated 09/20/09
, Updated 10/26/09
, Updated 02/15/10
, Updated 05/31/10
, Updated 06/30/10

Intr
oduction

JBoss
T
ools is a library

of plug
-
ins

that adds JBoss management functions to Eclipse
.
The web site describes it as:


JBoss Tools is an umbrella project for a set of Eclipse plugins that supports JBoss and related technology;
there are support for

Hibernate, JBoss AS, Drools, jBPM, JSF, (X)HTML, Seam, Smooks, JB
oss ESB,
JBoss Portal and more.


Examples of the capabilities within JBoss Tools are to start, stop, and publish to the JBoss server; to handle
Hibernate functions such as schema generation
and reverse engineering; and to handle Seam functions such as
managing page flow definitions, etc. It is similar to the facilities within MyEclipse, and in fact is based on the same
WTP, EMF, and GEF projects within the Eclipse projects, but doesn’t have
a subscription license

fee
.


There over 12 different tools within JBoss Tools, and you can download install only those that are relevant. We
currently work
with
only about 4
-
6 of them.


Eclipse plus JBoss Tools is often called
the “JBoss Developer Studio”
. We

think that it is marketed this way on the
“paid
-
for” sites. In this respect, it is clearly
intended to compete

with both the Sun Developer Studio

(built

on
NetBeans)
, and with MyEclipse.


The current version for Ec
lipse 3.5.x is JBoss Tools 3.1.1
, r
eleased on
06/11
/10
.

Components



Visual Page Editor
-

for Richfaces, JSF and HTML / CSS




3.1.1
.GA



Drools IDE
-

for Drools Rul
es and Drools Ruleflow





5.1.0
.CR1



Hibernate Tools
-

Hibernate wizards, query editor, r
everse engineering and more


3.3.1
.GA



JBo
ss AS Tools
-

for running deploying to,
and configuring JBoss AS



2.1.1
.GA



Portlet Tools
-

for supporting JBoss Portal and JSR
-
286 portlets



1.0.1.GA



JBoss Archive Tools
-

for incremental

archiving and packaging



3.0.2
.GA



JBoss Birt Tools
-

Hibernate an
d Seam exte
nsions for Eclipse BIRT



1.0.1
.GA



JBoss ESB Tools
-

project wizards, editors and deployment JBoss's ESB


1.1.1.GA



Project Examples
-

Tooling for easy i
nstallation of Examples




1.0.1
.GA



Smooks Tools
-

transformation editor






1.0.0.GA



JBoss
WS Tools
-

enabling Web Services support in Eclipse for JBoss WS


1.0.1.GA



jBPM Convert
-

Convert BPMN files to jBPM files





1.0.0.GA



jBPM Designer
-

Design and deploy jBPM business processes




3.1.7.GA



FreeMarker IDE
-

Syntax highlighting Editor for Fr
eemarker files



1.0.2.GA



JMX Tools
-

Java Management Extensions (JMX) Console in Eclipse



1.0.0.GA



Seam Tools
-

for creating Seam
Components and Projects




3.0.2
.GA



Struts Tools
-

for

Struts 1.x framework






3.0.1
.GA



JBoss AS TPTP Tools
-

TPTP support

for JBoss AS servers




1.0.0.GA



XulRunner
-

provides a common back
-
end for XUL applications



1.0.0.GA

Example Configuration

This was late 2009

Page
2

of
11



Our initial installation selected the following tools:



JBoss AS

T
ools



lets you deploy to the server, and
start and stop the server.



Seam Tools


lets you create a Seam project quickly, and also have editors for Seam artifact such as page
flow files.



Hibernate Tools



allows you to reverse engineer a data schema, and to manage the Hibernate configuration



JBoss

Web Services tools



Project Examples



this is a loader for examples regarding Seam, Portlets, etc.



The
resulting
Feature
display looked like:



Another Example Configuration

This was June 2010, using JBoss Tools 3.1.1.
At this time we were focused on

creating Seam examples
, no web
services, and no Seam
-
g
en.
We began from the minimal Eclipse (non
-
JEE).
Selected
:




Hibernate Tools


mostly interested in the Hibernate query window



JBoss RichFaces T
ools


mostly to provide validation in the source editor



JBoss AS

T
ools



lets you deploy to the server, and start and stop the server


The resulting Feature display looked like:



Resources

“JBoss Tools 3 Developer’s Guide”

by Anghel Leonard. Packt Publishing,
April

2009,
408

pages.

List price
$39.99, Amazo
n price $35.99, used from $35.99
.

Rated 5 stars on

Amazon.com

(from 1 review)
. The book
summary states that it helps you develop JSF, Struts, Seam, Hibernate, jBPM, ESB, web services, and portal
applications faster than ever using JBoss Tools for Eclipse

and the JBoss Application Server
. From what we have
seen in some other Packt books, this is probably
mostly material that is already available from online sites,
organized into a book.


“Seam in Action” by Dan Allen.
Manning Press,
August 2008, 624

pa
ge
s. List price $49.99, Amazon price $29.69,
used from $25.33. Rated 5 stars on Amazon.com. Considered the
best
overall book on Seam. It is as well
-
written
as most other Manning books, and has good examples. The author was on several of the Seam committ
ees, and has
written several articles on Seam. We bought a copy in March 2009.


Page
3

of
11

“JBoss in Action
: Configuring the JBoss Application Server

by Javid Jamae and Peter Johnson.
Manning Press,
January 2009, 496 pages. List price $49.99, Amazon price $31.49,

used from $23.77.
Rated 5 stars, from 4
reviews
. This i
s the first book to focus on teaching readers in detail how to use the JBoss application server. Unlike
other titles about JBoss, the authors of

JBoss in Action


go deeper into the advanced feature
s and configuration of
the server. In particular, it focuses on enterprise
-
class topics, such as high availabil
ity, security, and performance.
This book walks readers through the JBoss 5 Application Server from installation to configuration to production
development.

It is not as much of a developer’s guide, as it is an
administrator’s

guide and an architect’s guide to
some of the advanced features, which include JBoss Seam and JBoss Portal.

In
stallation

Typically, you install JBoss tools on top of an
Ecl
ipse JEE download. The 3.0.1
.GA
and 3.0.2.GA
release
s require

Eclipse “Ganymede” 3.4.2.


However, the installation page suggests that you can also start with the platform Eclipse download, for a smaller
download and footprint. This download skips some of

the JEE support functions, but since the main one that we use
is the Server administration, it will work, since the Java Tools installation fetches the minimal set of pieces that it
needs.

We tested this on the T43.


It is recommended that you install by

using the “Updates Sites” opt
ion of the Help Menu in Eclipse, rather than
trying to copy files into the Eclipse plugins and features directories manually.

Results

The installation of JBoss tools also provides a number of custom perspectives, such as a Sea
m perspective
, and their
views. The Seam perspective is covered in more detail below.


One piece of the JBoss tools that we were not familiar with was Smooks.
Smooks

is a Java framework for filtering
content (XML/XHTML/HTML etc) in a manner that can be o
ptimized for a given execution context, for example a
servlet.


After installation,

the list of Project T
ypes looks like:


Page
4

of
11


We will be focusing on the Seam Web Project in this list.

JBoss AS Tools

Allow you to define configuration for a JBoss server to be

started from Eclipse, then start, stop, and restart the
server.


In order to get started cre
ating, running, and debugging J
EE applications, we
must

create our runtime and server
instances.


The runtime instance is the Java Environment
. In this

case, we a
re at Java 1.6
.0
_13


The server instance is

the JBoss instance.


The follow
i
ng table lists possible server statuses.


Status

Description

Republish

The status which allows you to see if changes are awaiting

Publishing...

The status which shows if changes
are being updated

Synchronized

The status which allo
ws you to see if changes are in
sync


All available context menu commands are described in the following table:


Page
5

of
11



Publish to the server

button will republish any modules where it has determined the wo
rkspace is out of sync with
the server. It will attempt to do an incremental publish if it turns out that the module in question is capable of doing
one.


Press
Clean

if you need to clean projects
/modules

published on the server, i.e. remove invalid resou
rces from the
server.

Note that this doesn’t undeploy a project/module


the only way to do that is to use the Add and Remove
Projects dialog, move the project to the left side, then click OK, then reverse the process.


The server configuration dialog loo
ks like:



Page
6

of
11


An important note here is the “deploy directory”, in the plug
-
in, at
<workspace>
\
.metadata
\
.plugins
\
org.jboss.ide.eclipse.as.core
\
JBoss_4.2_Server
. If this directory con
tains old
copies of a deployable

module, you will get “duplicate deployme
nt” messages.


In order to debug your applications or EJB's that are deployed to the server, you must start the server in debug mode.
By star
ting the server in debug mode, E
clipse will allow you to set breakpoints on code in your workspace and step
through

the code.

This is very useful!


Start the server in profiling mode

button
enable
s

profiling actions for your application.

For more details on how to
start using TPTP profiling with
JBoss Tools

refer to
TPTP Support

chapter.

Seam Tools

The most useful

capability in Seam tools is the updated version of the
Seam Project G
enerator.
This is an interactive
facility to run the Seam
-
gen tool, which can also be run from the command line. The best explanation is located in
Chapter 2 of the “Seam in Action” book.


However, please note that JBoss Tools Seam Gen and the command
-
line Seam
-
gen produce different results. A site
comparing th
e two is located at:


http://blog.xebia.com/2009/04/21/differences
-
between
-
seam
-
gen
-
and
-
jboss
-
tools/




This produced a project group like:


Page
7

of
11



This empty shel
l application includes:




Ant build script



Deployment to JBoss AS (EAR or WAR)



Development and production profiles



Integration testing using TestNG and Embedded JBoss



JavaBean or EJB 3.0 Seam components



JPA entity classes



A configurable DataSource and JPA E
ntityManager



Templated Facelets views



RichFaces panels and tables



Default CSS stylesheet



Internationalization support


Note that the project name must begin with a lower case, due to a Seam naming restriction. This is documented on
the web site, and menti
oned in the dialog box.


In this case, the projects are organized as:



alpha


this is a container, and has the web content directory.



alpha
-
ear


this is used for building



alpha
-
ejb


this contains the place for the main business code



alpha
-
test


this con
tains test code, and is mostly empty.


It
also

created the alpha
-
ds.xml file, which contained the database connection information.

This must be deployed
manually.


One problem that took a great deal of time to solve is that the security/drools code requir
es mvel, not mvel14 if you
are running on Java 1.6. Created a very difficult to find problem with message:


U
nable to create object org.mvel.impl
.
LocalVariableResolverFactory


Apparently this class was changed from an interface to a class on the non 1.4 v
ersions.


The WebContent contains the following:


Page
8

of
11



This allows us to have an index page, a home page, and a login page, plus an error display page.

The index page
simply forwards to
the
home
.xhtml

page
.
The h
ome
.xhtml

page
can display a user name or no
t. It also offers links
to
log in, log out, and view the Seam web site page.


What is handy about these pages is not their function (which is almost none), but that they have been implemented
with Facelets, including the use of a master template. Hence,
you can add pages and provide a common navigation
area.


In the layout, there is a sub
-
component called “menu.xhtml”, and it would be easy to add one for “footer.xhtml”.
Each of these would be decorated with an Facelets <ui:component> tag.


The

starter pr
ogram also includes J
ava P
ersistence and MySQL database connectivity.


There are also options to run the Seam project generator such that it doesn’t produce a Seam, JSF, Facelets project,
but only a JSF, Facelets project.

The main difference between this
approach and running the JBoss Tools Web/JSF
application project is that the Seam project generator gives you the persistence configuration and the persistence
context.

Follow
-
on Questions

What do the options to create and drop schema and content do? They

change the values for persistence.xml.


How do I

ta
ke the security and Drools out (at least for now)?


Where do the entities go?

These should be put into
the com.incra.
alpha.entity

directory.


Where do the actions go?

Into the com.incra.actions director
y.


What is in the test project?

Not much.


What is provided within Eclipse once Seam Tools are loaded? See below.

Page
9

of
11


Plus you get the Seam perspective, which looks like:


This perspective is mostly useful for controlling the Server (see the bottom), and
building up the XHTML files of
the presentation (see tool palette in upper right, and properties display in lower left).

Page
10

of
11

Hibernate Tools

The primary purpose of these tools is to support

reverse engineering
.

JBoss Web Services Tools

These tools can generate

a web services client from the WSDL file.

JBoss Rules (Drools) tools

This is the Drools IDE, which is described in more detail in our document “Notes on Drools”.

Rich Faces Tools

The following features are implemented and fully supported for the current v
ersion of the RichFaces components:



Content Assist



OpenOn



Additional RichFaces tools in the tools Palette of the visual editor

Content Assist

This provides an interactive guide to specifying and configuration Rich Faces components. Without this, the conte
nt
assist facility only handles regular JSF component, not the Rich Faces components.

OpenOn

Working with
.jsp/.xhtml

pages in VPE you can also take the advantage of
OpenOn

feature for the RichFaces
components.


For example, Richfaces tags
<rich:insert>

an
d
<a4j:include
>

has OpenOn support.

RichFaces in the Visual Editor

For example, see below:


Page
11

of
11


Example

Projects

This plug
-
in adds a
n option to your Help menu.


This facility provided about 2 dozen different sample projects, each downloaded from the main sit
e, and built on
your computer. The Seam sample projects were based o
n the Pet
store/DVD
store examples, and the B
ookings
example.


There were also ones for Portlet, RichFaces, ESB, and more.

Few of these are critical at the moment, however the
plug
-
in does
n’t take up much space (since the content is downloaded
)
.

Open Questions

Could we tailor the generation of

Seam project
s

by changing some template files?

Basically, yes, since it i
s running
the Seam generator. They are simply FreeMarker templates. Howev
er, there is little documentation on how to do
this
.