Tomcat as a Service in RH/CentOS/Fedora

May 8, 2009

This is the best tutorial on how to configure Tomcat as a service that I’ve come accross. The scripts provided just work with very few tweaks to point to your install paths etc. Check it out.


JSF Applications – JBoss Seam or Spring Web Flow?

April 29, 2009

I’ve had opportunity to use JBoss Seam from its 1.0 days, and also Spring Web Flow. I must admit that both frameworks really do hold their own in providing you with a full stack for rapid application development. This post does not attempt to look at these frameworks as a whole, but to focus on how easy it is to develop JSF
applications in them.

JSF is a Java standard for web application development. Therefore to judge any framework that depends on or claims to accelerate JSF, we will focus on how it scales over the gaping holes that are not handled by the standard, not just how they stick to it. Below are my observations. Note that the following points are not given in
any order of importance.

JSF’s UISelectItems Support

From somewhere in it’s 1.x version, Seam has provided the ability to use just a normal java.util.List of your own domain objects e.g. List<Student> directly to populate JSF’s UISelectItem controls like list boxes, drop down lists etc using their <s:selectItems/> component and it’s attached <s:convertEntity/> tag. Additionally, enums are easily handled in like manner using <s:convertEnum/> and <s:enumItem/>. This gets rid of the need to wrap domain objects in JSF SelectItem instances.

This is sorely lacking in Spring Faces, Spring’s JSF support for Web Flow, something I have even voted for in their JIRA instance.

Conversation Propagation in a Different Browser Tab

Seam provides the ability to invoke actions that start a new conversation or to move within states in a conversation using their provided <s:button/> or <s:link/> button and link respectively. Though Spring Faces has a Dojo backed
<sf:commandButton/> and <sf:commandLink/>, these are not yet capable of achieving this.

Integration with Hibernate Validator

Following the DRY principle, it can be very useful if JSF can also hook into the validation defined on your domain model using the defacto validation standard, Hibernate Validator. As you may already know, JSR-303 Bean Validation is targeted at standardizing the definition and enforcement of validation rules on your domain model,
with Hibernate Validator as the reference implementation. Seam provides the ability to enforce these validations in your JSF UI using the <s:validateAll/> tag.

Although requests have been made for this support, I’m yet to see it in Spring Faces.

Popup Screens

Sometimes it is cool to show modal panels for quick response from the user when interacting with the UI instead of a full page refresh. Spring Faces natively provides a Dojo based modal panel accessed just
by setting “popup” to true on any view state.

It is important to note however that though not natively supported in Seam, both it’s default JSF component library, RichFaces and the supported alternatives, ICEFaces and Trinidad, all provide this functionality
easily.

Display of byte[] images

JSF doesn’t provide any native control for the display of images from a byte array (byte[]) most probably retrieved from a database. The standard <h:graphicImage/> only deals with files accessible through a url. Seam however, provides support for display of images in a byte arrays using it’s <s:graphicImage/>.

There is no such support in Spring Faces, though RichFaces’s <a4j:mediaOutput/> could be used in displaying such content, however I have had problems using it with Spring Faces. ICEFaces also could be used to achieve this.

File Upload

Another vital component missing from the standard JSF toolkit is a file upload component of which Seam natively provides an <s:fileUpload/> component for achieving just that.

Unless you us a third party library like RichFaces or ICEFaces, I haven’t yet seen clear support for such a functionality in SpringFaces.

Rendering Components Based on Access Rights

Sometimes you want to hide a certain area of your UI from the user based on their roles/rights within the application. This is normally achieved in JSF using the “rendered” attribute on any tag or component. Seam provides a native way to easily hide or show components or sections using the s:hasRole EL function. An example of
this is below

<h:outputText value=”Hello”
rendered=”#{s:hasRole(’Admin’)}”/>

This same support is extended to its “s:hasPermission” function, allowing you to render components on the UI based on not only roles, but fine grained permissions even backed by the Drools engine. And these functions are accessible whether on the UI, in your navigation rules (when you use pages.xml or pdl) and even in your code on annotations.

Spring Faces has no native support for this on facelets (I think it’s only available on jsps). However, an open-source project, Acegi-JSF, has a UI component tag <acegijsf:authorize/> and other additional ones which allow you to render based on access rights. This is limited, in that it cannot be applied to the rendered” attributes of JSF components since it is by itself a component/tag, not an EL function like Seam’s approach. You have to be quite inventive (and verbose) to come up with your own solutions to this problem.

Extended EL Capabilities

JSF 1.2 is limited in it’s EL support, and as a result you cannot invoke an action with parameters on a facelet. The following is not allowed, though I’ve seen proposals to fix it natively in

<h:commandButton action=”#{shop.buyProduct(product)}”/>

Seam uses it’s own implementation of the EL-API called the JBoss EL, and this allows the invocation of such actions in a facelet and in your navigation rules.

Though Spring Faces also uses JBoss EL, for some reason I haven’t been able to do anything like the above in my facelet, though it is possible in flow (it is a heavily used feature Spring Web Flow).

Automatic Detection of Converters & Validators Through Annotations

One may be forced to write some converters or validators needed to meet specific business logic needs. JSF requires you to specify these classes in it’s faces-config.xml file before being used.

Seam provides annotations for auto-discovering JSF converters and validators, meaning there is no need for the “xml hell” when creating these components.

Spring Faces doesn’t yet have this support.

TimeZones & Themes

The JSF specification assumes that all dates and times are UTC. To override this behaviour, a timezone must specified using an <f:convertDateTime/> on each date being displayed. The inconvenience of this cannot be overstated as I’ve had to deal with this. Using a Seam component on which the Time Zone may be specified in your application, Seam overrides this behaviour in your JSF application, a feature I’m yet to see in SpringFaces.

Also, most of today’s webapps come with the ability to change themes on the fly, but JSF has no native support for  themes. This support however is provided by Seam in a very easy to configure way, and is yet to make it to Spring Faces.

Tools

JSF by nature is designed with tools in mind, as result, tool support is an important part of adoption of JSF and every JSF framework’s tool support must be brought under the scope.

JBoss provides JBoss Tools, a superb set of tools for rapid application design. It’s Richfaces VPE provides wysiwyg, drag n’ drop design of facelets with a palette of HTML,JSF, Facelets and Richfaces components. It also supports resolution of your seam components inside facelet using Seam component names as well as wysiwyg declaration of
nagivation rules in both the standard JSF faces-config.xml or and Seam’s pages.xml. Even resolution of component names in code is also available. See the JBoss Tools Developer Guide for more on this toolset.

Spring provides it’s own Spring IDE set of tools which also allow the resolution of Spring beans within your flow definitions. Unfortunately, there isn’t any wysiwig support and Spring beans cannot be resolved by the Richfaces VPE.

Other Non-JSF Stuff For UI Developers

Conversation Switcher

With both frameworks promising the ability to have long running conversations, it then becomes useful to be able to start different conversations concerning different things, and have knowledge on the UI of which conversations have been started and the state in which the user is in each conversation.

This is natively supported in Seam but not in Web Flow.

Debug page

It helps to know the state and content of the beans in your scopes, especially when you want to know why certain things are not showing up on your facelet, without having to set break points in your IDE and start a whole debugging process.

Seam gives you the ability to at any time in any conversation, see the contents of your components in their appropriate scopes. This I sorely missed in Web Flow.

Summary

There are a host of other things that we could also compare, but from these ones it is not difficult to see why people who develop using the JSF framework see Seam as a saviour. We could choose
to chastise JSF itself for its shortcomings and use other frameworks but when someone comes along and makes standards like JSF more attractive as their first priority, I think they deserve the support and commendation. And that is what I believe is the problem with Spring Web Flow and it’s
Spring Faces project.

Spring has it’s own MVC framework, SpringMVC which predates Web Flow. Web Flow can be developed either using SpringMVC or JSF aka Spring Faces. A lot of the limitations of Spring Faces noted here are already handled natively by SpringMVC. Obviously, Spring Faces has not had the kind of attention that the first class citizen, SpringMVC
has in the world of Spring. In fact, one wonders if the sudden entrance of Spring Faces is not just a knee jerk reaction to Seam winning the JSF folks over.

I believe that if you had to develop a JSF application and did not have any investments in Spring already, it will make more sense to go for Seam as your preferred framework. Coupled with it’s advanced tooling, there isn’t as yet a better choice. Trust me, you won’t regret it.

Seam also has support for other web frameworks like GWT and Wicket. Though Seam’s support of Wicket is very young, it will be interesting to see what
the community’s acceptance of it is.

Technorati Tags: , , , ,


Using Eclipse Dali with Hibernate as Persistence Provider

April 28, 2009

Eclipse Ganymede comes with in built support for the EclipseLink JPA implementation. However, we’ll want to explore how to use Hibernate’s JPA implementation with Eclipse Dali for JPA operations

To begin with, please make sure you have the following

  1. Eclipse Ganymede for JavaEE

  2. Hibernate EntityManager

  3. Hibernate Tools

  4. MySQL connector (or a jdbc connector of your choice if you are not using MySQL)

You will need to install Hibernate Tools as an Eclipse plugin. Next, you’ll have to add MySQL to your list of driver definitions. This you do by going to the “Window” → “Preferences”. On the left tree, navigate to “Data Management” → “Connectivity” → “Driver Definitions”. Click on the “Add” button. You now have a “New Driver Definition” window with three tabs – Name/Type, Jar List and Properties.


In the Name/Type tab, select MySQL. A list of choices now appears of “MySQL JDBC Driver”. Select System Version 5.0, click on the “Jar List” tab and delete the default MySQL driver file specified there. Click on “Add Jar/Zip” and add your MySQL connector. Please ensure that there are no spaces in the path to your MySQL connector, or you may have trouble later on. Click “Ok” to finish the driver definition.

Next is to add the Hibernate EntityManager libraries as your JPA implementation. First, extract the Hibernate EntityManager zip that you downloaded into a location without spaces in the path. Still in the “Preferences” window, click on “JPA” on the left tree. In the “Default JPA Implementation Library”, click the “Configure user libraries” link. Click on the “New” button and give this a good name e.g. HibernateJPA. Click on “Add JARs” and add the “hibernate-entitymanager.jar” that is available in your extracted Hibernate EntityManager folder. Next, add all the jars in the lib folder of the extracted folder. These should be

  • slf4j-api.jar
  • dom4j.jar
  • ejb3-persistence.jar
  • hibernate-annotations.jar
  • hibernate-commons-annotations.jar
  • hibernate-core.jar
  • javassist.jar
  • jta.jar


Click on “Ok” to complete adding the JPA implementation.

Now, create a Java Project called “jpaproject”. In the project explorer view, right-click the project and select “JPA Tools” → “Convert To JPA Project”. Click on “Next” on the “Project Facets” screen that shows up. On the “Configure JPA Settings” window, select “Hibernate” as your platform. You will now add your connection to the database by clicking on “Add connection” link. In the “Connection Profile” window, type MySQL in the filter. Select MySQL and enter the name “jpaprojectDB” in the “Name” field. Click “Next”, and specify your database connection details. Click “Test connection” to be sure, and then “Finish” when completed.

You should now have something like below


Remember to uncheck the “Create orm.xml” option. Its useless overhead we don’t need now. You now have a project that supports JPA, with a META-INF/persistence.xml file generated in your src folder. Funny enough, after all this information provided, Dali still refuses to populate your persistence.xml file with these details. You will have to do them yourself (talk about DRY).

Double-click on your persistence.xml. On the “General” tab, specify “org.hibernate.ejb.HibernatePersistence” as your Persistence Provider. In the “Connection” tab, choose “Resource Local” from the Transaction Type drop down list. Under “Hibernate” tab, select “MySQL” as Database dialect, “com.mysql.jdbc.Driver” as Driver class, “jdbc:mysql://localhost:3306/jaccra” as your connection URL, and then provided the username and password fields for the database connection. Click on “Source” and you should something close to the ff.


<?xml
version=“1.0″
encoding=“UTF-8″?>

<persistence version=“1.0″ xmlns=“http://java.sun.com/xml/ns/persistence”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd”
>

<persistence-unit name=“jpaproject” transaction-type=“RESOURCE_LOCAL”>

<provider>org.hibernate.ejb.HibernatePersistence</provider>

<properties>

<property name=“hibernate.dialect” value=“org.hibernate.dialect.MySQLDialect”/>

<property name=“hibernate.connection.driver_class” value=“com.mysql.jdbc.Driver”/>

<property name=“hibernate.connection.url” value=“jdbc:mysql://localhost:3306/jaccra”/>

<property name=“hibernate.connection.username” value=“edem”/>

<property name=“hibernate.connection.password” value=“edem”/>

</properties>

</persistence-unit>

</persistence>

Now you are all set up for your JPA machinations. One last and very important thing to do is to add the MySQL connect jar to your build path. Now when you right-click on your project in the project explorer, you should see an option “JPA Tools”, under which there are a couple of other options. Explore them and see what you get.


JPA 1.0 at Accra’s JUG (JAccra)

April 20, 2009

Last Saturday, I delivered a presentation on the Java Persistence API 1.0 a the Java Accra, Accra’s JUG. It was a very interesting session and we learnt a lot.

Here is the presentation slides and the sample code to go with the presentation. Any questions are very welcome


Book Release : JBoss Tools 3 Developers Guide

March 13, 2009

JBoss Tools is an impressive set of open source Eclipse plugins that allow rapid development of enterprise and SOA based applications. It is developed by the JBoss group under the leadership of Max Rhydal Anderson.

It include support for rapid Hibernate, Seam, JSF and Richfaces, jBPM, JBoss ESB development and a lot more.There is no doubt that with such a compelling toolset, JBoss Tools stands out as the best set of tools for Ajax based JavaEE development that you can get for free and compares very well with those for pay.

To quickly point out how to harness the power of JBoss Tools for rapid application development, Packt Publishing has just announced their book JBoss Tools 3 Developers Guide by Anghel Leonard, scheduled to be released in April 2009. I believe this is the first book on JBoss Tools, and it has come at the right time for us developers.

Taking a hands on step by step approach to the 11 Chapters detailing each of the plugins at the time of writing, a developer is immediately delved into productive use of JBoss Tools in their project through a small project developed per chapter.

Of course, you will not expect to learn everything about Seam, Hibernate, Richfaces, JBoss-WS etc from the book simply because that is not the aim of it. However pointers are given to the right resources that will get you up to speed on them.

It has been fun being a technical reviewer of this book and I have to congratulate Leonard and the staff at Packt Publishing (Sarah and Leena) for their hardwork. I eagerly look forward to the release in April.

Don’t say I didn’t tell you how good it is, because this post is evidence that I have.


DZone Releases Richfaces and Seam UI RefCardz

March 10, 2009

As part of DZone’s aim of informing the developer, especially Java developers of their choices in tools and technologies to be productive in their fields, it regularly publishes RefCardz. These are concise, straight to the point publications highlighting appropriate uses of different technologies. They have been very insightful to me.

In recent weeks, I’ve participated in reviewing the publication of Seam UI RefCard from Jacob Orshalick, the author of the just released Seam Framework: Experience the Evolution of Java EE and a committer on the Seam project. It contains some useful information on some of the best practices for managing and configuraing your Seam application’s UI. Just grap a copy here.

And just yesterday, a RefCard on Richfaces was published from the horse’s own mouth – Excadel. This publication features Nick Belaevski, Ilya Shaikovsky, Jay Balunas and Max Katz – author of the well acclaimed Practical Richfaces.

These give fans of Seam and Richfaces enough food for thought for the next few months. Enjoy chewing on them as I have.


JUG Accra Goes Live

March 2, 2009

In an effort to promote and share knowledge on Java platform technologies and tools in Ghana, a Java User Groups is being started by Java enthusiasts in the capital Accra.

JAccra wishes to promote and strengthen the Ghanaian base of expertise and proficiency in the plethora of Java platform tools and technologies.

As part of it’s start up process, JAccra is scheduled to have its first meeting on Saturday 7th March, and the details are provided below. This meeting will focus on deliberations by members of JAccra on the vision and objectives of JAccra and how those will be achieved.

If you are a Java enthusiast based in Accra, you can’t afford to miss this gathering. To register to join jaccra, just click here. Welcome to Java’s hotbed in Accra.

  • Venue: Meltwater Entrepeneural School of Technology, East Legon, Close to A &C Shopping Mall.
  • Date: Saturday 7th March, 2009
  • Time: 11am – 1pm.

Ebedded JOPR – The New JBoss AS Admin Console

January 6, 2009

I’ve enjoyed developing application and deploying to the JBoss Application Server, and have been using it since it’s 4.0 days. However, one thing that has starkly been missing from JBoss AS is an administration console, and a lot of us JBoss AS users have had to manually edit xml files to create JMS , JDBC DataSource and other application settings, and the experience hasn’t been gratifying.

So I was pleasantly surprised to come accross Embedded Jopr, a spin off of the Jopr project, for managing single JBoss AS installations. Embedded Jopr is a plugin structured, Seam based application packaged as a war. Just deploy to your JBOSS_HOME/server/default/deploy folder and you have your admin console. I’ve always envied Glassfish users for their admin console, but for once I couldn’t be happier with using JBoss.

Note that Embedded Jopr works only on JBoss AS 4.2 version only, and not yet on the newly released JBoss AS 5.  Can’t wait for JBoss AS 5 support though.

More information can be found below.

Ian Springer’s blog

Embedded jopr

Jopr

RHQ


JBoss Tools, Seam and XML Editing

September 1, 2008

I’d never been a fun of xml files. Never. I like to put my money where my mouth is, and that is not in xml files. Then came EJB3. And just when I was getting settled down with the new craze (Annotations), along came Seam. Now I could happily run away from my EJB 2.1 days of verbose xml and never go
down the trail of “xml hell” again, editing xml just when i
really, really need to. Alas, twas just a dream. When you are faced
with an application that needs to be flexible and extensible,
sometimes the best (and probably only) way is through xml. And that
is exactly what I was faced with recently. However, JBoss reminded me
of one of the reasons why Seam is a compelling choice of framework –
tools support through JBoss Tools. Now I’ve fallen in love with xml
editing – simply because I don’t have to do any.

Here’s the scenario. Let’s say I were
developing an application for playing games, allowing users to play
different games which obey a consistent API. This means a separation
into interfaces and implementations. Here is how I tried to create
that separation.

  • Plugnplay-api – consistent
    interfaces that are to be coded to.

  • Plugnplay-impl – implementations
    of the above api. Contains Seam components (i.e. Entities, Actions,
    UI components etc).

  • Plugnplay-web – the basic Seam
    application (here’s where the facelets as well as the aforementioned
    components finally end up).

This meant that I’d have to use the
components.xml file to specify the names (instead of @Name) as well
as other properties of my Seam entities and actions. No hustle. I
immediately realized how big such a file will get. Thankfully Seam
allows you to define one components.xml file for each component like
Hibernate (not my idea of fun) or one components.xml file per
package. I chose the second option and decided to put JBoss Tools to
work. The result was pleasing. Let’s look at mapping different
implementations of the Game interface – DominoGameImpl and
MonopolyGameImpl.

  1. Select File -> New -> Other.

  2. Scroll to XML subcontent and
    select XML.

  3. Enter the name “components.xml”
    as file name and click Next.

  1. In the “Create XML File From”
    screen, choose “Create an XML file from an XML schema file”.
    This forces our xml file to conform to a schema, in this case the
    components-2.0.xsd from Seam. Click Next.

  2. At XML Schema File, select “Select
    XML Catalog entry”. This should show a list of all schema files
    currently registered in your Eclipse installation.

  3. Scroll through the XML Catalog and
    find the key “http://jboss.com/products/seam/components-2.0.xsd”.
    Click Next.

  4. At the Root Element dialog box,
    change the default Root element of “action” to “components”.
    This is the root element in all components.xml files, and allow
    other child elements such as pdf, mail etc. You may leave the other
    checkboxes as their default. Click Finish to end the wizard.

Finally our components.xml file is
created and displayed in the Seam Components Editor. At this top
level we can add components, define factories, events and imports.
Without much ado we’ll add our Game components. This is the part I
love the most.

  1. Click “Add” to add a seam
    component.

  2. Enter the name of the Seam
    component.

  3. To add the particular class, click
    Browse. You have a window with 3 tabs – “Search”, “Browse”
    and “Recent”.

  4. In “Search” begin typing the
    name “DominoImpl” as our Seam component. A dynamic list of
    matching classes are displayed as you type to select the particular
    one you want.

  1. Select the appropriate class and
    click “OK”.

  2. In the Seam Components Editor, you
    may now specify the scope as well as other properties. I’ll choose
    CONVERSATION from the Scope drop down list. Press Ctrl+S to save.

  3. Repeat these steps to add the
    MonopolyGameImpl as a Seam component.

Now that we have our games, we want to
associate them with a particular user. Our User API defines a list of
Games as a field. We repeat the above process in the “admin”
package, selecting UserImpl as with the component name “user”.
Set the scope of the component as you wish.

To add properties to the “user”
component do the following.

  1. Click on it in Component Editor.
    In the Properties sub-section, click on Add… . You immediate get
    three options to select from; “Add Simple Property”, “Add List
    property” and “Add Map property”.

  2. Choose the 2nd option.
    In the dialog box that appears give our list the name “games”,
    mapping to the getGames and setGames of the UserImpl. We can now add
    values to the games list. Add the name “monopoly”.

  3. Repeat the steps above to add
    “domino” as another game to the “games” list.

  4. Your Editor should look like this
    now.

This XML support in JBoss Tools allows me to easily wire my components together (like Spring, though Spring IDE can’t compare) and still get all the ooze of Seam. So why wouldn’t I fall in love with XML editing with JBoss Tools. And note, JBoss Tools 3.0-alpha is out with experimental pages.xml editor, visual view of navigations, portlet and a host of other stuff that you are better of finding out for yourself. And I’ll definitely be blogging about my experiences with it very soon.

Technorati Tags: , ,


Tweaking JBoss Tools and Eclipse for Tomcat 6

July 8, 2008

Since I’d been using Eclipse for a while now, I decided to give the JBoss Tools 2.0.1.GA a spin, with a focus on using it with Tomcat 6 instead of JBoss AS. JBoss Tools is a set of plugins released by the JBoss team for rapid Seam application development. However, by default it supports development to the JBoss Application Server, although Seam applications can be deployed to most application servers.

I followed the instructions detailed in the new Chapter 3 of the Seam Reference Manual in Seam 2.0.2.GA, making sure that I rather specified my installed Tomcat 6 instead of JBAS and also specified a WAR instead of EAR structure. After the project structure is created, there are a few changes that need to be made to make things nice and easy.

To make sure that we all have the same view of the project structure, open the Seam perspective.

Tomcat enables us to put resources that are needed in each application (like datasources) in a META-INF/context.xml. Here is what mine looks like.

<?xml version="1.o" encoding="UTF-8"?>

<Context crossContext="true" debug="5" docBase="seamweb" path="/seamweb" reloadable="true">

<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/seamweb" password="" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/seamweb" username="edem"/>

</Context>

In Eclipse, this file should go into the WebContent/META-INF folder.

Next is to work on the persitence.xml file which will be found under src/model/META-INF. Change the following line in that file which looks like this

<jta-data-source>java:/seamwebDatasource</jta-data-source

to this

<jta-data-source>java:comp/env/jdbc/seamweb</jta-data-source>

This is the standard way of declaring JNDI names, and Tomcat expects that. Also, change the “transaction-type” from “JTA” to “RESOURCE_LOCAL”.

Next thing to deal with is the components.xml file under WebContent/WEB-INF/. Remove the jndi-pattern = “@jndiPattern” attribute since we are not using EJBs here. Your file should now look like this.

<core:init debug="true"/>

<core:manager conversation-timeout="240000" concurrent-request-timeout="500" conversation-id-parameter="cid"/>

<transaction:entity-transaction entity-manager="#{entityManager}"/>

<persistence:entity-manager-factory name="seamweb"/>

<persistence:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{seamweb}"/>

<security:identity authenticate-method="#{authenticator.authenticate}"/>

<event type="org.jboss.seam.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>

</event>

<event type="org.jboss.seam.postAuthenticate">
<action execute="#{redirect.returnToCapturedView}"/>

</event>

Take note of “seamweb” declarations. Its the same as the persistence-unit name provided in the persitence.xml file.

Now delete the WebContent/WEB-INF/jboss-web.xml file. It’s definitely not necessary to tomcat.

The last but most important part of this exercise is making sure you have the right jar files in WEB/lib. After creating the project, JBoss Tools copies all the jar files from seam’s lib folder into your web application. The only way to know the jars needed for tomcat deployment only is to jpa example in seam distribution you have. Follow the instructions on my post about setting up NetBeans 6.0 for Tomcat 6 and you’ll see how i did it.

But to save you that trouble, this list of jars seem to work for me

  1. antlr.jar

  2. asm.jar
  3. cglib.jar

  4. commons-beanutils.jar

  5. common-collections.jar

  6. commons-digester.jar

  7. commons-lang.jar

  8. commons-logging.jar

  9. dom4j.jar

  10. hibernate-annotations.jar

  11. hibernate-commons-annotations.jar

  12. hibernate-entitymanager.jar

  13. hibernate.jar

  14. hibernate-validator.jar

  15. javassist.jar

  16. jbos-archive-browsing.jar

  17. jboss-el.jar

  18. jboss-seam-debug.jar

  19. jboss-seam.jar

  20. jboss-seam-ui.jar

  21. jsf-api.jar

  22. jsf-facelets.jar

  23. jsf-impl.jar

  24. jstl.jar

  25. jta.jar

  26. persistence-api.jar

  27. richfaces-api.jar

  28. richfaces-impl.jar

  29. richfaces-ui.jar

If everything went well, the application should run inside tomcat without a problem.