Thursday November 10, 2005
How to develop CMP beans for JBoss in NetBeans I have recently read one question about developing CMP beans for Jboss in NetBeans. The user asked for some details that are related to CMP beans for JBoss, e.g. setup database in Jboss, server specific deployment descriptors, ... I decided to write simple tutorial about developing CMP beans for JBoss.
Let's start to develop simple application that manages issues for your product. The issues are persisted in MySQL database, application tier has two beans, one is CMP bean that represents issue and stateless session bean with remote and local interface. This bean represents facade for business logic. The client is simple J2SE client that invokes business methods in session bean. We will develop application tier today and client tomorrow. Eneterpise module sources are avalaible here.
CREATE TABLE ISSUE (
ID SERIAL,
TYPE CHAR(1),
PRIORITY SMALLINT,
OWNER VARCHAR(20),
SUMMARY VARCHAR(30),
PRIMARY KEY(ID));
If you don't want to creat the table manually, you can download sources and in a directory setup is file setup.sql that creates table and inserts values into table. You can the command mysql -u your_user -p < setup.sql.
Bound EJB LocalHome 'IssueBean' to jndi 'local/IssueBean@17546680' Bound EJB LocalHome 'IZFacadeBean' to jndi 'local/IZFacadeBean@17637582' Bound EJB Home 'IZFacadeBean' to jndi 'IZFacadeBean' Deployed: file:/home.local/blaha/servers/jboss/server/default/deploy/Issues.jar