Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Setting Up JBoss Tools for Seam Application Development : Page 4

The Seam Web Framework joins the worlds of JavaServer Faces and EJB 3.0, and JBoss Tools is a suite of Eclipse plugins that make developing Seam applications easy and productive.


advertisement
Creating Your First Seam Project
In order to create a new Seam project, you need to invoke the "New Seam Web Project" wizard (see Figure 6). The name is somewhat misleading, since this project will contain not only the web part but also all the separate projects required to host your EJBs, EAR configuration, and unit tests.

 
Figure 6. New Seam Web Project Wizard: In order to create a new Seam project you need to invoke the "New Seam Web Project" wizard.

Author's Note: Do not use a dash (-) in the project name (e.g., "devx-seam"). I used one and got a deployment exception. I then had to go to the ${PROJECT_ROOT}/resources/<project name>-ds.xml file and change the default name of the Entity Manager.



Before you can create your first project, you must complete a few prerequisite steps. The first step is to create a new runtime for the application/web server that you will be using, JBoss in this case (see Figure 7).

Next, you need to create a configuration for an actual server, using the previously specified runtime (see Figure 8). Make sure you have the administrator user name/password on hand (the default in JBoss is "admin"/"admin"), in order to have access to the JMX console.


Figure 7. New JBoss Runtime Wizard: Use this wizard to create a new runtime for the application/web server that you will be using.
 
Figure 8. New JBoss Server Wizard: You need to create a configuration for an actual server, using the previously specified runtime.

The wizard also will ask you to create a new Seam runtime, which will point to your local installation of the Seam libraries (see Figure 9). Surprisingly, the runtime is not included with the base version of JBoss Tools. Since I had deployment issues with the combination of Seam 1.2.1 and JBoss 4.2.2, I did most of my testing with the brand new Seam 2.0.1 runtime.

After all of this, you your initial setup of the project should be complete (see Figure 10).


Figure 9. New Seam Runtime Wizard: These are typical add/remove list controls in RichFaces.
 
Figure 10. Finishing the New Seam Web Project Setup: Your initial setup of the project should look like this.

However, because Seam provides functionality for automatically creating new entities (and maintenance pages for them) from the database, you will need to define a database connection for your project's JPA Entity Manager. The first step for meeting this requirement is to define the database driver to use (see Figure 11). Make sure you have it downloaded locally. (In my case, it was the MySQL JDBC driver.)

The next step is to specify the actual connection details for your development database (see Figure 12).


Figure 11. Setting Up the Database Driver: Figure 12. Setting Up the Database Connection Details: You will need to define a database connection for your project's JPA Entity Manager.
 
Figure 12. Setting Up the Database Connection Details: You will need to specify the actual connection details for your development database.

At this point, you should have created a base project. Right-click on the main project node and select Run -> Run on Server should to deploy the project to the server, open the integrated browser within the Eclipse IDE, and show a login page, the base starting point of a new web application.

Occasionally when creating a new Seam project, I notice that the EJB portion of it shows up with compilation errors. In this case, clean and recompile your workspace to correct this.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap