Thursday, July 12, 2007

JBoss Seam Configurations - JARs and Details

I've sucessfully implemented NetBeans 6.0 M10 and Netbeans 5.5.1 projects using the JBOSS Seam framework. I can successfully deploy these projects to both Glassfish V1, JBoss 4.2.0, and JBoss 4.1. This blog post is a log so that I can remember the specific JAR files and details required for each of these projects. I intend to add onto this blog as time goes on and I encounter more detailed information.

Seam 1.2.1 GA and Glassfish V1:
This project utilizes the Ajax4Jsf and RichFaces APIs. I have been unable to make this setup work with Glassfish V2 as yet. If you have figured that one out, please let me know.

Follow these steps in either NB 5.5.1 or NB 6.0 M10

1) Create new Enterprise Application, and also create the following libraries within the IDE:

jbpm-3.1.2.jar (If you plan to use JBpm...I have not tested as yet)


2) Add those two libraries to your ejb sub-project along with these others:
jsf-facelets.jar (unless you intend to add facelets support via the ide)

3) Add the following JARs to your war sub-project:
dom4j.jar (may not need this one...)

4) Add configuration files to your ejb sub-project:
a) Add ejb-jar.xml to src/conf
b) Create empty within src/conf
c) Create log4j.xml within src/conf
- Easiest configuration is to copy one of the log4j.xml files contained in the
example projects within the Seam 1.2.1 GA download.
d) Create persistence.xml within src/conf
- Use NetBeans to create persistence unit by right-clicking on the ejb sub-project
and then selecting New->Persistence Unit. Follow directions to create a unit
based upon one of the existing database connections you have defined in the IDE.
I use Toplink by default, but Hibernate works just as well.

5) Add configuration files to your war sub-project
a) Configure web.xml and faces-config.xml as suggested in Carol McDonald's Blog or Brian Leonard's Blog. It is also a good idea to take a look at the web.xml file from within one of the sample projects which comes with your Seam download. You will require a Seam filter, and Ajax4Jsf context-parameter if you plan to use that technology. I almost always use the same configuration contained within the sample project web.xml files, but also add the ejb references as discussed in the blog posts above.
b) Make sure the following additional xml files reside within your WEB-INF directory:
components.xml - Copy and use the one from the glassfish example in your Seam download. You will need to update it according to your ejb project name.
pages.xml - this one can be left blank
c) You may need to add META-INF to root of web pages and place application.xml within it.

I'll add the other configurations as time goes on, but this one will get you started with Seam application development on Glassfish V1.

Friday, July 06, 2007

Seam 2.0 and Netbeans 6.0 M10

Seam 2.0 works with Netbeans 6.0 M10 and the Netbeans Seam plugin. I've spent some time preparing an application based upon some of the examples given in the Seam 2.0 documentation.

I've managed to deploy and successfully run an application on JBoss 4.2.0 using Netbeans 6.0 M10 and the seam plugin. I only used the plug-in to generate the initial application. I did not use any of the other plug-in automation.

Monday, July 02, 2007

Saw It, Got It, Using It

Netbeans 6.0 M10 is now available to the community. There are quite a few enhancements in this milestone.

I'll blog more about the M10 release as needed as time goes on. I've been using it all day with the Netbeans Seam plugin and Facelets plugin...and haven't experienced any issues thus far.