1. Create an EJB3 project
2. Write an ANT file that will compile your EJB classes and deploy them to JBoss
for the persistence.xml file you should provide something like this:
finally you need a Data Source to connect to the Database, you could find most Database data sources under the directories of JBoss for JBoss 5 its under you will find them under the directory <JBoss>/docs/examples/jca
choose the appropriate data source for you database and modify it.
Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
V Sahdev
Greenhorn
Joined: Jun 18, 2008
Posts: 14
posted
0
I doubt Stateless bean need persistence.xml
Mihai Radulescu
Ranch Hand
Joined: Sep 18, 2003
Posts: 912
posted
0
Hi, Sahdev
You are right you can build an ear (and deploy it) without to have a persistence.xml, but this will be atypical.
An classical enterprise application has 4 layers and one is the persistence layer (and this one requires the persistence.xml). I can not imagine a real situation when you build a enterprise application only with stateless beans.
Regards,
Mihai
Omar Al Kababji
Ranch Hand
Joined: Jan 13, 2009
Posts: 357
posted
0
Yes you are both right you don't need persistence.xml if your EJB jar will contain only session beans, its needed only if you want to use JPA. but I supposed that since its EJB3 it would need JPA sooner or later.