Seam 2.2.2 Project Creation

classypalmInternet and Web Development

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

104 views

1


Piotr Zabawa, PhD. Eng.

Krak
ow,
0
6
th

of
November
, 2011

Software Engineering Section

Faculty of Physics, M
athematics and Computer Science

Cracow University of Technology

e
-
mail:

pzabawa@pk.edu.pl


www:

http://www.pk.edu.pl/~pzabawa/en


www:

http://www.pk.edu.pl/~pzabawa/
en/busin
e
s
s.html


Seam
2.2.2
Project Creation

in JBoss Tools

3.2.1

SeamKickOff
WAR/EAR
Project
s

In order to verify installation correctness as well as to start from non
-
empty Seam project the JBoss
Tools Seam project wizard may be used. This wizard
helps to configure

all elements of the
environment
,

and at the end
,

executes seam
-
gen
to generate simple project. The steps of
new Seam
project creation

process are described below.

Convention
-

press blue buttons in order to follow from one slide to the next one.

1.

Create
an empty
Seam
KickOffDb

MySQL
UTF
-
8
database

for polish collation
:

>m
ysql

m
ysql>
CREATE DATABASE Seam
KickOffDb

CHARACTER SET utf8

COLLATE utf8_
polish
_ci
;


2.

Create new Seam project in Eclipse.

2




3.

Configure an application server [JBoss AS]

3




4





5




6



4.

Configure Seam framework



7




5.

Configure data base connection [MySQL
]


8




9





10





11




12



6.

Check correctness of data base configuration


13



7.

Switch to the Seam perspective


8.

Start project execution

in Eclipse internal web browser


14




15




16




9.

Check if it looks the same in Mozilla Firefox web browser.

17




10.

In order to be able to make use of Hibernate with MySQL the appropriate data source
configuration must be done.

This configuration is not applied in the KickOff projects due to
the lack of persistence layer
, but is necessary for SeamHelloWorld projects.



co
py
mysql
-
ds.xml f
ile from
%JBOSS_HOME%/docs/examples/jca

to
%JBOSS_HOME%/server/default/deploy

directory



edit the following items in the
%JBOSS_HOME%/server/default/deploy/mysql
-
ds.xml

file

o

<jndi
-
name>
MySqlDS
</jndi
-
name>

o

<connection
-
url>
jdbc:mysql://localhost:3306/SeamKickOffEARDb
</connection
-
url>

o

<user
-
name>
uname
</user
-
name>

o

<password>
passwd
</password>



edit the following items in the file
persistence.xlm

located in the
KickOffEar
-
ejb

project in
the source folder
ejbModule

and in its subfolder
META
-
INF

o

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



Note
: The Seam wizard creates a test project for TestNG plugin. The test does not run may be due to
the warning saying that TestNG should run in JavaSDK5 not in JavaSDK6 like

in my case. To be
checked later.